Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new gh stack unstack command for tearing down stacks (with a delete alias), and adjusts adoption behavior to better handle existing PRs while expanding documentation and test coverage.
Changes:
- Introduces
gh stack unstack/gh stack deleteto delete a stack on GitHub and remove local tracking (or--localfor local-only). - Adds GitHub client support for deleting stacks (
DeleteStack) plus command-level tests for success and failure cases. - Updates
init --adoptto associate only open/draft PRs and to no longer hard-fail when an adopted branch already has a PR.
Show a summary per file
| File | Description |
|---|---|
| skills/gh-stack/SKILL.md | Documents unstack for restructuring stacks. |
| README.md | Adds user-facing docs for gh stack unstack / delete. |
| internal/stack/stack_test.go | Updates test section header comment for RemoveStackForBranch. |
| internal/github/client_interface.go | Adds DeleteStack to ClientOps. |
| internal/github/mock_client.go | Implements DeleteStack on the mock client. |
| internal/github/github.go | Implements REST DeleteStack call. |
| docs/src/content/docs/reference/cli.md | Adds unstack reference documentation. |
| docs/src/content/docs/introduction/overview.md | Mentions stack teardown via unstack. |
| docs/src/content/docs/guides/workflows.md | Adds a workflow section for restructuring stacks using unstack. |
| docs/src/content/docs/faq.md | Updates FAQs to recommend unstack/init --adopt for restructuring/deleting. |
| cmd/unstack.go | New command implementation for remote+local (or local-only) stack deletion. |
| cmd/unstack_test.go | New tests covering unstack success paths and API error handling. |
| cmd/root.go | Registers the new unstack subcommand. |
| cmd/root_test.go | Extends subcommand registration expectations to include unstack. |
| cmd/init.go | Adjusts --adopt PR association logic (open/draft only) and removes prior hard failure. |
| cmd/init_test.go | Adds tests for the updated --adopt behavior with existing PRs. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 16/16 changed files
- Comments generated: 4
|
Warning This is an internal experiment to assess Copilot's ability to auto-approve PRs. Please 👍 this comment if the assessment below is correct and 👎 if not. Feedback in #f-ccr-auto-approve is appreciated! Copilot thinks this PR is not ready to approve — see review comments for details. |
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.
New Command:
unstackAdds the
gh stack unstack(aliasdelete) command, which removes a stack from local tracking and deletes it on GitHub, with a--localflag to only remove local tracking. Handles error cases such as missing stack IDs and remote API failures, ensuring local state is not modified if there is a remote failure.Also includes improvements to the
init --adoptlogic to record only open/draft PRs for adopted branches, ignoring closed/merged PRs, and removed the strict error that previously blocked adoption if a branch already had a PR.