-
Notifications
You must be signed in to change notification settings - Fork 0
Support tree structure in status command #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8a4f024 to
f82a4b6
Compare
3347e31 to
fc1dffc
Compare
92f521d to
7d1dbc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds hierarchical tree support to the status command by extending JSON output, console rendering, and tests to carry and display nested branch children.
- Introduces generic
Tree<T>/TreeItem<T>and adds aTree(Tree<string>)overload toILogger/ConsoleLogger - Extends JSON output records and mapping functions to include
Childrencollections - Refactors
StackHelpersand commands to build and render nested branch trees; updates tests to use aTestLogger
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Stack/Stack.csproj | Added MoreLinq reference for tree traversal utilities |
| src/Stack/Infrastructure/ConsoleLogger.cs | Implemented Tree(Tree<string>) and recursion helper |
| src/Stack/Commands/Stack/StackStatusCommand.cs | Updated JSON records, mapping logic, and schema‐version handling |
| src/Stack/Commands/PullRequests/CreatePullRequestsCommand.cs | Updated output methods to accept schema version and tree items |
| src/Stack/Commands/Helpers/StackHelpers.cs | Added methods to build, traverse, and output nested branch lists |
| src/Stack.Tests/Helpers/TestLogger.cs | Stubbed Tree logger (needs deeper recursion) |
| src/Stack.Tests/... | Switched tests to use TestLogger with ITestOutputHelper |
Comments suppressed due to low confidence (2)
src/Stack.Tests/Helpers/TestLogger.cs:54
- [nitpick] The TestLogger.Tree method only writes top‐level children and skips nested nodes. Implement recursive traversal so tests can verify deeper levels of the rendered tree.
// TODO: Handle child nodes if needed
src/Stack.Tests/Commands/Stack/StackSwitchCommandHandlerTests.cs:13
- Class declarations cannot take constructor parameters directly. Move the
ITestOutputHelperparameter into a proper constructor inside the class body to compile correctly.
public class StackSwitchCommandHandlerTests(ITestOutputHelper testOutputHelper)
fc1dffc to
9dcde11
Compare
e402dd8 to
e4848f7
Compare
e4848f7 to
9ad4e8e
Compare
This PR is part of supporting a tree structure with stack, where a branch can have multiple child branches:
Fixes #254