Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions actions/sequester/ImportIssues/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private static async Task<QuestGitHubService> CreateService(ImportOptions option
options.ImportedLabel,
options.UnlinkLabel,
options.ParentNodes,
options.DefaultParentNode,
options.WorkItemTags,
options.TeamGitHubLogins,
options.CopilotIssueTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ public static void BuildExtensionForOpenIssueSinglePastProject()
Assert.Equal("Content\\Future", extendedProperties.IterationPath);
Assert.Equal("New", extendedProperties.WorkItemState);
Assert.Empty(extendedProperties.Tags);
Assert.Equal(0, extendedProperties.ParentNodeId);
Assert.Equal(33, extendedProperties.ParentNodeId);
}

[Fact]
Expand All @@ -698,7 +698,7 @@ public static void BuildExtensionForOpenIssueMultiplePastProject()
Assert.Equal("Content\\Future", extendedProperties.IterationPath);
Assert.Equal("New", extendedProperties.WorkItemState);
Assert.Equal(["content-curation"], extendedProperties.Tags);
Assert.Equal(0, extendedProperties.ParentNodeId);
Assert.Equal(33, extendedProperties.ParentNodeId);
}

[Fact]
Expand All @@ -712,7 +712,7 @@ public static void BuildExtensionForNoProject()
Assert.Equal("Content\\Future", extendedProperties.IterationPath);
Assert.Equal("New", extendedProperties.WorkItemState);
Assert.Empty(extendedProperties.Tags);
Assert.Equal(0, extendedProperties.ParentNodeId);
Assert.Equal(33, extendedProperties.ParentNodeId);
}

[Fact]
Expand All @@ -726,7 +726,7 @@ public static void BuildExtensionForNoProjectClosed()
Assert.Equal("Content\\Future", extendedProperties.IterationPath);
Assert.Equal("Closed", extendedProperties.WorkItemState);
Assert.Empty(extendedProperties.Tags);
Assert.Equal(0, extendedProperties.ParentNodeId);
Assert.Equal(33, extendedProperties.ParentNodeId);
}

private static WorkItemProperties CreateIssueObject(string jsonDocument)
Expand All @@ -738,7 +738,7 @@ private static WorkItemProperties CreateIssueObject(string jsonDocument)
issueNumber = 1111
};
JsonElement element = JsonDocument.Parse(jsonDocument).RootElement;
return new WorkItemProperties(QuestIssue.FromJsonElement(element, variables), _allIterations, _tagMap, _parentMap, "copilotTag");
return new WorkItemProperties(QuestIssue.FromJsonElement(element, variables), _allIterations, _tagMap, _parentMap, _defaultParentId, "copilotTag");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public WorkItemProperties (QuestIssueOrPullRequest issue,
IEnumerable<QuestIteration> iterations,
IEnumerable<LabelToTagMap> tags,
IEnumerable<ParentForLabel> parentNodes,
int defaultParentNodeId,
string copilotTag)
{
StoryPointSize? storySize = LatestStoryPointSize(issue);
Expand All @@ -41,7 +42,7 @@ public WorkItemProperties (QuestIssueOrPullRequest issue,
};
IterationPath = latestIteration.Path;

ParentNodeId = 0;
ParentNodeId = defaultParentNodeId;

if (WorkItemState is not "New")
{
Expand Down
5 changes: 5 additions & 0 deletions actions/sequester/Quest2GitHub/Options/ImportOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public sealed record class ImportOptions
/// </remarks>
public List<ParentForLabel> ParentNodes { get; init; } = [];

/// <summary>
/// The default parent node ID to use when no other parent has been configured.
/// </summary>
public int DefaultParentNode { get; init; } = 0;

/// <summary>
/// A map of GitHub labels to Azure DevOps tags.
/// </summary>
Expand Down
5 changes: 3 additions & 2 deletions actions/sequester/Quest2GitHub/QuestGitHubService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class QuestGitHubService(
string importedLabelText,
string removeLinkItemText,
List<ParentForLabel> parentNodes,
int defaultParentNodeId,
IEnumerable<LabelToTagMap> tagMap,
IEnumerable<string> gitHubLogins,
string copilotTag) : IDisposable
Expand Down Expand Up @@ -97,7 +98,7 @@ async Task ProcessItems(IAsyncEnumerable<QuestIssueOrPullRequest> items)
QuestWorkItem? questItem = (request || sequestered || vanquished)
? await FindLinkedWorkItemAsync(item)
: null;
var issueProperties = new WorkItemProperties(item, _allIterations, tagMap, parentNodes, copilotTag);
var issueProperties = new WorkItemProperties(item, _allIterations, tagMap, parentNodes, defaultParentNodeId, copilotTag);

Console.WriteLine($"{item.Number}: {item.Title}, {issueProperties.IssueLogString}");
Task workDone = (request, sequestered, vanquished, questItem) switch
Expand Down Expand Up @@ -184,7 +185,7 @@ public async Task ProcessIssue(string gitHubOrganization, string gitHubRepositor
? await FindLinkedWorkItemAsync(ghIssue)
: null;

var issueProperties = new WorkItemProperties(ghIssue, _allIterations, tagMap, parentNodes, copilotTag);
var issueProperties = new WorkItemProperties(ghIssue, _allIterations, tagMap, parentNodes, defaultParentNodeId, copilotTag);

Task workDone = (request, sequestered, vanquished, questItem) switch
{
Expand Down
Loading