From 04ef3ebe15a37f60d20914130f2f2449bf5415ca Mon Sep 17 00:00:00 2001 From: William Laugesen Date: Fri, 31 Oct 2025 17:51:02 +1300 Subject: [PATCH 1/3] Upgraded Tentacle's "NuGet.Packaging" dependency to the latest re-fork --- .../Octopus.Tentacle/Octopus.Tentacle.csproj | 2 +- .../Packages/NuGetPackageInstaller.cs | 22 +++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/source/Octopus.Tentacle/Octopus.Tentacle.csproj b/source/Octopus.Tentacle/Octopus.Tentacle.csproj index c5a814c15..6017a58a6 100644 --- a/source/Octopus.Tentacle/Octopus.Tentacle.csproj +++ b/source/Octopus.Tentacle/Octopus.Tentacle.csproj @@ -57,7 +57,7 @@ - + diff --git a/source/Octopus.Tentacle/Packages/NuGetPackageInstaller.cs b/source/Octopus.Tentacle/Packages/NuGetPackageInstaller.cs index fc5ecabc3..f089cda1f 100644 --- a/source/Octopus.Tentacle/Packages/NuGetPackageInstaller.cs +++ b/source/Octopus.Tentacle/Packages/NuGetPackageInstaller.cs @@ -29,10 +29,24 @@ public int Install(string packageFile, string directory, ILog log, bool suppress public int Install(Stream packageStream, string directory, ILog log, bool suppressNestedScriptWarning) { - var extracted = PackageExtractor.ExtractPackage(packageStream, - new SuppliedDirectoryPackagePathResolver(directory), - new PackageExtractionContext(NullLogger.Instance) { PackageSaveMode = PackageSaveMode.Files, XmlDocFileSaveMode = XmlDocFileSaveMode.None, CopySatelliteFiles = false }, - CancellationToken.None); + // The 'source' parameter is used for logging/tracking purposes in NuGet's new API. + // It can be null or any string identifier. We use null here as we don't need tracking. + // Signature verification is bypassed by passing null for ClientPolicyContext (3rd param in PackageExtractionContext). + var extracted = PackageExtractor.ExtractPackageAsync( + null, // source - not needed for our use case and can be null because ClientPolicyContext is null. + packageStream, + new SuppliedDirectoryPackagePathResolver(directory), + new PackageExtractionContext( + PackageSaveMode.Files, + XmlDocFileSaveMode.None, + null, // ClientPolicyContext - null bypasses signature verification + NullLogger.Instance) + { + CopySatelliteFiles = false + }, + CancellationToken.None) + .GetAwaiter() + .GetResult(); return extracted.Count(); } From 28b43e94a9b56ab98863c7347112ef0ec33438b6 Mon Sep 17 00:00:00 2001 From: William Laugesen Date: Mon, 3 Nov 2025 14:50:33 +1300 Subject: [PATCH 2/3] Replaced NuGet.Versioning with Octopus.Versioning --- source/Octopus.Tentacle/Octopus.Tentacle.csproj | 1 + source/Octopus.Tentacle/Versioning/SemanticVersionInfo.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/Octopus.Tentacle/Octopus.Tentacle.csproj b/source/Octopus.Tentacle/Octopus.Tentacle.csproj index 6017a58a6..4ebac15aa 100644 --- a/source/Octopus.Tentacle/Octopus.Tentacle.csproj +++ b/source/Octopus.Tentacle/Octopus.Tentacle.csproj @@ -59,6 +59,7 @@ + diff --git a/source/Octopus.Tentacle/Versioning/SemanticVersionInfo.cs b/source/Octopus.Tentacle/Versioning/SemanticVersionInfo.cs index e7e7124a6..53ceb37c3 100644 --- a/source/Octopus.Tentacle/Versioning/SemanticVersionInfo.cs +++ b/source/Octopus.Tentacle/Versioning/SemanticVersionInfo.cs @@ -1,6 +1,7 @@ using System; using System.Reflection; -using NuGet.Versioning; +using Octopus.Versioning; +using Octopus.Versioning.Semver; namespace Octopus.Tentacle.Versioning { @@ -11,7 +12,7 @@ public class SemanticVersionInfo { public SemanticVersionInfo(Assembly assembly) { - SemanticVersion = SemanticVersion.Parse(assembly.GetInformationalVersion() ?? "0.0.0"); + SemanticVersion = SemVerFactory.Parse(assembly.GetInformationalVersion() ?? "0.0.0"); MajorMinorPatch = SemanticVersion.ToString("V", new VersionFormatter()); BranchName = assembly.GetCustomAttribute()!.BranchName; NuGetVersion = assembly.GetCustomAttribute()!.NuGetVersion; From 8e60c3f706a94183a0db6c55e7c803dd9ad28bd4 Mon Sep 17 00:00:00 2001 From: William Laugesen Date: Mon, 3 Nov 2025 16:41:10 +1300 Subject: [PATCH 3/3] Removed dependency on `Octopus.Client.Model.SemanticVersion` that used the NuGetVersion.ToString to instead use SemanticVersion directly. --- source/Octopus.Tentacle/Properties/OctopusTentacle.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/Octopus.Tentacle/Properties/OctopusTentacle.cs b/source/Octopus.Tentacle/Properties/OctopusTentacle.cs index 2a3a15d08..dfe0605b4 100644 --- a/source/Octopus.Tentacle/Properties/OctopusTentacle.cs +++ b/source/Octopus.Tentacle/Properties/OctopusTentacle.cs @@ -1,8 +1,7 @@ using System.Reflection; -using Octopus.Client.Model; using Octopus.Tentacle.Util; using Octopus.Tentacle.Versioning; -using AssemblyExtensions = Octopus.Tentacle.Versioning.AssemblyExtensions; +using Octopus.Versioning.Semver; namespace Octopus.Tentacle.Properties { @@ -10,8 +9,8 @@ public static class OctopusTentacle { public static readonly Assembly Assembly = typeof (OctopusTentacle).Assembly; public static readonly string InformationalVersion = Assembly.GetInformationalVersion() ?? "0.0.0"; - public static readonly SemanticVersionInfo SemanticVersionInfo = new SemanticVersionInfo(Assembly); - public static readonly SemanticVersion Version = new SemanticVersion(SemanticVersionInfo.NuGetVersion); + public static readonly SemanticVersionInfo SemanticVersionInfo = new(Assembly); + public static readonly SemanticVersion Version = SemanticVersionInfo.SemanticVersion; public static readonly string[] EnvironmentInformation = EnvironmentHelper.SafelyGetEnvironmentInformation(); } } \ No newline at end of file