-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for tree structure in config file #252
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
f13a05b to
541d77e
Compare
b640a5f to
474acfd
Compare
474acfd to
1c12811
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
This PR introduces support for a tree structure in stack branches by replacing the old flat branch representations with a nested structure using the new Config.Branch type. Key changes include removal of the temporary directory implementation from one helper file, refactoring of test data builders to use a new TestStackConfigBuilder with nested branch objects, and updates to various tests to account for the new hierarchical branch design.
Reviewed Changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Stack.Tests/Helpers/TestGitRepositoryBuilder.cs | Removed duplicate TemporaryDirectory implementation to improve maintainability. |
| src/Stack.Tests/Config/FileStackConfigTests.cs | Updated test expectations for both V1 and V2 JSON formats to use the new nested branch structure. |
| Various test files under src/Stack.Tests/Commands/… | Refactored test setup to consistently use TestStackConfigBuilder with new Config.Branch objects, supporting the tree structure in stacks. |
Comments suppressed due to low confidence (3)
src/Stack.Tests/Helpers/TestGitRepositoryBuilder.cs:398
- The TemporaryDirectory class has been removed from this file and moved into its own helper file. Please verify that all tests referencing temporary directories now correctly use the new implementation.
-public class TemporaryDirectory(string DirectoryPath) : IDisposable { ... }
src/Stack.Tests/Config/FileStackConfigTests.cs:61
- The test now uses new Config.Branch instances with explicit empty child arrays to represent leaf branches. Ensure that both the serialization logic and the equivalence assertions properly handle this nested branch structure in V1 and V2 formats.
new Config.Stack(stackName, remoteUri, sourceBranch, [ new Config.Branch(branch1, [ new Config.Branch(branch2, []) ]) ]);
src/Stack.Tests/Commands/Stack/UpdateStackCommandHandlerTests.cs:33
- [nitpick] The refactor to use TestStackConfigBuilder with nested branch definitions improves clarity of test setup. Consider adding a brief comment in the tests to explain the intended tree structure (parent and child branches) for improved future maintainability.
var stackConfig = new TestStackConfigBuilder()
This PR is part of supporting a tree structure with stack, where a branch can have multiple child branches:
Fixes #253