Support tree structure in status command#262
Merged
geofflamrock merged 6 commits intomainfrom Jun 11, 2025
Merged
Conversation
8a4f024 to
f82a4b6
Compare
This was referenced Jun 3, 2025
3347e31 to
fc1dffc
Compare
92f521d to
7d1dbc2
Compare
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of supporting a tree structure with stack, where a branch can have multiple child branches:
Fixes #254