From a2330f20faa656989d48439c78ebb95f6010626a Mon Sep 17 00:00:00 2001 From: Marty Tippin <120425148+tippmar-nr@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:15:00 -0600 Subject: [PATCH 1/4] chore: Typo in packageInfo.json --- .../scripts/nugetSlackNotifications/packageInfo.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/nugetSlackNotifications/packageInfo.json b/.github/workflows/scripts/nugetSlackNotifications/packageInfo.json index 006f0b7b7..86c95ad43 100644 --- a/.github/workflows/scripts/nugetSlackNotifications/packageInfo.json +++ b/.github/workflows/scripts/nugetSlackNotifications/packageInfo.json @@ -122,10 +122,10 @@ "packageName": "nservicebus" }, { - "packageName": "orcacle.manageddataaccess" + "packageName": "oracle.manageddataaccess" }, { - "packageName": "orcacle.manageddataaccess.core" + "packageName": "oracle.manageddataaccess.core" }, { "packageName": "rabbitmq.client", From c951f3a0b659b884786928a639a6daff24c0048b Mon Sep 17 00:00:00 2001 From: Marty Tippin <120425148+tippmar-nr@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:24:09 -0600 Subject: [PATCH 2/4] Logic update, WIP --- .../scripts/nugetSlackNotifications/Program.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/nugetSlackNotifications/Program.cs b/.github/workflows/scripts/nugetSlackNotifications/Program.cs index dfacde909..721e090e3 100644 --- a/.github/workflows/scripts/nugetSlackNotifications/Program.cs +++ b/.github/workflows/scripts/nugetSlackNotifications/Program.cs @@ -238,10 +238,14 @@ static async Task CreateGithubPullRequestForNewVersions(IEnumerable CreateGithubPullRequestForNewVersions(IEnumerable Date: Wed, 15 Jan 2025 09:49:24 -0600 Subject: [PATCH 3/4] * added ignoreTFMs config for packageInfo * fixed bug in creating new PR, probably related to OctoKit major version bump --- .../scripts/nugetSlackNotifications/CsprojHandler.cs | 4 ++-- .../nugetSlackNotifications/NugetVersionData.cs | 5 ++++- .../scripts/nugetSlackNotifications/PackageInfo.cs | 2 ++ .../nugetSlackNotifications/PackageReference.cs | 5 +---- .../scripts/nugetSlackNotifications/Program.cs | 10 +++++----- .../scripts/nugetSlackNotifications/packageInfo.json | 4 +++- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/scripts/nugetSlackNotifications/CsprojHandler.cs b/.github/workflows/scripts/nugetSlackNotifications/CsprojHandler.cs index b4aa59eb5..ec4d67ad0 100644 --- a/.github/workflows/scripts/nugetSlackNotifications/CsprojHandler.cs +++ b/.github/workflows/scripts/nugetSlackNotifications/CsprojHandler.cs @@ -36,9 +36,9 @@ public static async Task> UpdatePackageReferences(string csprojPath foreach (var package in matchingPackages) { - if (package.VersionAsVersion < versionData.NewVersionAsVersion && package.Pin) + if (package.VersionAsVersion < versionData.NewVersionAsVersion && !string.IsNullOrEmpty(versionData.IgnoreTfMs) && versionData.IgnoreTfMs.Split(",").Contains(package.TargetFramework)) { - Log.Warning($"Not updating {package.Include} for {package.TargetFramework}, it is pinned to {package.Version}. Manual verification recommended."); + Log.Warning($"Not updating {package.Include} for {package.TargetFramework}, this TFM is ignored. Manual verification recommended."); continue; } diff --git a/.github/workflows/scripts/nugetSlackNotifications/NugetVersionData.cs b/.github/workflows/scripts/nugetSlackNotifications/NugetVersionData.cs index 1ac092872..30b624fb8 100644 --- a/.github/workflows/scripts/nugetSlackNotifications/NugetVersionData.cs +++ b/.github/workflows/scripts/nugetSlackNotifications/NugetVersionData.cs @@ -10,8 +10,10 @@ public class NugetVersionData public Version NewVersionAsVersion { get; set; } public string Url { get; set; } public DateTime PublishDate { get; set; } + public string IgnoreTfMs { get; } - public NugetVersionData(string packageName, string oldVersion, string newVersion, string url, DateTime publishDate) + public NugetVersionData(string packageName, string oldVersion, string newVersion, string url, + DateTime publishDate, string ignoreTfMs) { PackageName = packageName; OldVersion = oldVersion; @@ -19,6 +21,7 @@ public NugetVersionData(string packageName, string oldVersion, string newVersion NewVersionAsVersion = new Version(newVersion); Url = url; PublishDate = publishDate; + IgnoreTfMs = ignoreTfMs; } } } diff --git a/.github/workflows/scripts/nugetSlackNotifications/PackageInfo.cs b/.github/workflows/scripts/nugetSlackNotifications/PackageInfo.cs index dc0c93556..572a513f1 100644 --- a/.github/workflows/scripts/nugetSlackNotifications/PackageInfo.cs +++ b/.github/workflows/scripts/nugetSlackNotifications/PackageInfo.cs @@ -14,5 +14,7 @@ public class PackageInfo public bool IgnoreMajor { get; set; } [JsonPropertyName("ignoreReason")] public string IgnoreReason {get; set;} + [JsonPropertyName("ignoreTFMs")] + public string IgnoreTFMs { get; set; } } } diff --git a/.github/workflows/scripts/nugetSlackNotifications/PackageReference.cs b/.github/workflows/scripts/nugetSlackNotifications/PackageReference.cs index 06235055f..bdec52593 100644 --- a/.github/workflows/scripts/nugetSlackNotifications/PackageReference.cs +++ b/.github/workflows/scripts/nugetSlackNotifications/PackageReference.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text.RegularExpressions; using System.Xml.Serialization; @@ -33,8 +33,5 @@ public string TargetFramework return match.Success ? match.Value : null; } } - - [XmlAttribute] - public bool Pin { get; set; } } } diff --git a/.github/workflows/scripts/nugetSlackNotifications/Program.cs b/.github/workflows/scripts/nugetSlackNotifications/Program.cs index 721e090e3..9b959d239 100644 --- a/.github/workflows/scripts/nugetSlackNotifications/Program.cs +++ b/.github/workflows/scripts/nugetSlackNotifications/Program.cs @@ -168,7 +168,7 @@ static async Task CheckPackage(PackageInfo package, PackageMetadataResource meta var previousVersionDescription = previous?.Identity.Version.ToNormalizedString() ?? "Unknown"; var latestVersionDescription = latest.Identity.Version.ToNormalizedString(); Log.Information($"Package {packageName} was updated from {previousVersionDescription} to {latestVersionDescription}."); - _newVersions.Add(new NugetVersionData(packageName, previousVersionDescription, latestVersionDescription, latest.PackageDetailsUrl.ToString(), latest.Published.Value.Date)); + _newVersions.Add(new NugetVersionData(packageName, previousVersionDescription, latestVersionDescription, latest.PackageDetailsUrl.ToString(), latest.Published.Value.Date, package.IgnoreTFMs)); } else { @@ -242,11 +242,11 @@ static async Task CreateGithubPullRequestForNewVersions(IEnumerable CreateGithubPullRequestForNewVersions(IEnumerable Date: Wed, 15 Jan 2025 10:17:43 -0600 Subject: [PATCH 4/4] emoji --- .github/workflows/scripts/nugetSlackNotifications/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripts/nugetSlackNotifications/Program.cs b/.github/workflows/scripts/nugetSlackNotifications/Program.cs index 9b959d239..717b48661 100644 --- a/.github/workflows/scripts/nugetSlackNotifications/Program.cs +++ b/.github/workflows/scripts/nugetSlackNotifications/Program.cs @@ -267,7 +267,7 @@ static async Task CreateGithubPullRequestForNewVersions(IEnumerable