Skip to content

unstack command#12

Merged
skarim merged 5 commits intomainfrom
skarim/unstack
Apr 8, 2026
Merged

unstack command#12
skarim merged 5 commits intomainfrom
skarim/unstack

Conversation

@skarim
Copy link
Copy Markdown
Collaborator

@skarim skarim commented Apr 8, 2026

New Command: unstack
Adds the gh stack unstack (alias delete) command, which removes a stack from local tracking and deletes it on GitHub, with a --local flag 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 --adopt logic 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.

Copilot AI review requested due to automatic review settings April 8, 2026 16:42
Copy link
Copy Markdown

Copilot AI left a 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 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 delete to delete a stack on GitHub and remove local tracking (or --local for local-only).
  • Adds GitHub client support for deleting stacks (DeleteStack) plus command-level tests for success and failure cases.
  • Updates init --adopt to 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

Comment thread cmd/unstack.go Outdated
Comment thread cmd/unstack.go Outdated
Comment thread cmd/unstack.go Outdated
Comment thread cmd/init.go
Copy link
Copy Markdown

Copilot AI commented Apr 8, 2026

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.

@skarim skarim merged commit 0ba54a4 into main Apr 8, 2026
7 checks passed
@skarim skarim deleted the skarim/unstack branch April 8, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants