diff --git a/DotNet.DocsTools/GitHubObjects/StoryPointSize.cs b/DotNet.DocsTools/GitHubObjects/StoryPointSize.cs index eaf20e69..4b82f885 100644 --- a/DotNet.DocsTools/GitHubObjects/StoryPointSize.cs +++ b/DotNet.DocsTools/GitHubObjects/StoryPointSize.cs @@ -98,6 +98,19 @@ private StoryPointSize(int CalendarYear, string Month, string Size, int? Priorit public string Size { get; } public int? Priority { get; } + public string FullMonthText + { + get + { + if (!TryGetMonthOrdinal(Month, out int ordinal)) + { + return Month; + } + + return System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat.GetMonthName(ordinal); + } + } + public bool IsPastIteration { get diff --git a/actions/sequester/Quest2GitHub.Tests/BuildExtendedPropertiesTests.cs b/actions/sequester/Quest2GitHub.Tests/BuildExtendedPropertiesTests.cs index d944c256..c715b998 100644 --- a/actions/sequester/Quest2GitHub.Tests/BuildExtendedPropertiesTests.cs +++ b/actions/sequester/Quest2GitHub.Tests/BuildExtendedPropertiesTests.cs @@ -26,6 +26,7 @@ public class BuildExtendedPropertiesTests [ new () { Label = ":checkered_flag: Release: .NET 9", Tag = "new-feature" }, new () { Label = labelForTag, Tag = "content-curation" }, + new () { Label = labelWithReplacement, Tag = "Highlight-$FullMonthText$" } ]; private static ParentForLabel[] _parentMap = @@ -41,6 +42,8 @@ public class BuildExtendedPropertiesTests private const string labelWithParent = "user-feedback"; private const string labelWithoutParent = "bug"; + private const string labelWithReplacement = ":sparkler: Highlight :sparkler:"; + private const string PastProject = """ { @@ -256,13 +259,13 @@ public class BuildExtendedPropertiesTests }, "labels": { "nodes": [ - { - "name": "{{labelForTag}}", - "id": "MDU6TGFiZWwzMDkwMTEzMzI1" - }, { "name": "{{labelWithoutTag}}", "id": "LA_kwDOFn2dfM8AAAABK0cMjA" + }, + { + "name": "{{labelWithReplacement}}", + "id": "NA" } ] }, @@ -665,7 +668,7 @@ public static void BuildExtensionForFutureProjectWithTag() Assert.Equal(2, extendedProperties.Priority); Assert.Equal(ExpectedFutureProject, extendedProperties.IterationPath); Assert.Equal("New", extendedProperties.WorkItemState); - Assert.Equal(["content-curation"], extendedProperties.Tags); + Assert.Equal(["Highlight-March"], extendedProperties.Tags); Assert.Equal(33, extendedProperties.ParentNodeId); } diff --git a/actions/sequester/Quest2GitHub/Models/WorkItemProperties.cs b/actions/sequester/Quest2GitHub/Models/WorkItemProperties.cs index c5a05917..7a16050a 100644 --- a/actions/sequester/Quest2GitHub/Models/WorkItemProperties.cs +++ b/actions/sequester/Quest2GitHub/Models/WorkItemProperties.cs @@ -182,12 +182,13 @@ month descending private static IEnumerable WorkItemTagsForIssue(QuestIssueOrPullRequest issue, IEnumerable tags, string copilotTag) { + string? sprint = LatestStoryPointSize(issue)?.FullMonthText?.ToString(); foreach (var label in issue.Labels) { var tag = tags.FirstOrDefault(t => t.Label == label.Name); - if (tag.Tag is not null) + if ((tag.Tag is not null) && (sprint is not null)) { - yield return tag.Tag; + yield return tag.Tag.Replace("$FullMonthText$", sprint); } } // Add custom tag if one of the assignees is "Copilot": diff --git a/quest-config.json b/quest-config.json index 0ea8482e..a7757464 100644 --- a/quest-config.json +++ b/quest-config.json @@ -6,5 +6,19 @@ }, "ImportTriggerLabel": ":world_map: reQUEST", "ImportedLabel": ":pushpin: seQUESTered", - "DefaultParentNode": 405108 -} \ No newline at end of file + "DefaultParentNode": 405108, + "WorkItemTags": [ + { + "Label": ":sparkler: Highlight :sparkler:", + "Tag": "Highlight-$FullMonthText$" + }, + { + "Label": ":mag_right: AISDLC :mag:", + "Tag": "SP-AISDLC" + }, + { + "Label": ":mag_right: AIPlatform :mag:", + "Tag": "SP-AIPlatform" + } + ] +}