Update commands to use create and update stack APIs#10
Conversation
There was a problem hiding this comment.
Pull request overview
This PR splits the existing push behavior into a branch-only push command and a new submit command that handles PR creation plus GitHub Stack API syncing, while removing the unstack command pending deletion endpoints.
Changes:
- Add
gh stack submitto push branches, create/update PRs (with optional interactive titling), and create/update a GitHub Stack via new REST endpoints. - Simplify
gh stack pushto only push active branches and update local base SHAs (no PR operations). - Remove
gh stack unstackand update docs/help text/tests accordingly.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/gh-stack/SKILL.md | Updates skill documentation/examples to reflect push vs submit and removes unstack. |
| README.md | Updates user-facing docs for the new submit command and the narrowed push behavior. |
| internal/stack/stack_test.go | Removes outdated comment referencing unstack. |
| internal/github/mock_client.go | Updates mock GitHub client interface for stack create/update operations. |
| internal/github/github.go | Implements CreateStack (POST) and UpdateStack (PUT) REST calls to the stacks API. |
| internal/github/client_interface.go | Replaces DeleteStack with CreateStack/UpdateStack in ClientOps. |
| cmd/unstack.go | Removes the unstack command implementation. |
| cmd/unstack_test.go | Removes tests for the deleted unstack command. |
| cmd/submit.go | Introduces submit command: push + PR creation + stack sync. |
| cmd/submit_test.go | Adds test coverage for submit flow and stack sync scenarios (create/update/HTTP error handling). |
| cmd/root.go | Registers the new submit command and removes unstack. |
| cmd/root_test.go | Updates expected subcommand list after command changes. |
| cmd/rebase.go | Updates post-rebase guidance to reference gh stack submit. |
| cmd/push.go | Removes PR creation logic/flags; now pushes branches and updates base SHAs only. |
| cmd/push_test.go | Updates tests to match push’s new behavior and adds submit-hint assertions. |
| cmd/merge.go | Updates guidance to reference gh stack submit when PRs are missing. |
| cmd/merge_test.go | Updates expectation to reference submit instead of push. |
| cmd/init.go | Updates onboarding output to reference gh stack submit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a new gh stack submit command for PR creation + GitHub Stack API syncing, while simplifying gh stack push to only push branches and removing the unstack command.
Changes:
- Added
submitcommand to push stack branches, create PRs, and create/update GitHub Stacks via new REST endpoints. - Simplified
pushto only push branches and update local base SHAs; removed PR-creation responsibilities and deletedunstack. - Updated docs and guidance strings across commands to reflect the new
submitworkflow.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/gh-stack/SKILL.md | Updates skill docs to reflect push vs submit and removes unstack references. |
| README.md | Updates user-facing docs and examples for submit, new behavior of push, and removes unstack. |
| internal/stack/stack_test.go | Removes outdated comment reference to unstack. |
| internal/github/mock_client.go | Updates mock client to support Create/Update Stack API methods. |
| internal/github/github.go | Implements REST calls for CreateStack/UpdateStack endpoints. |
| internal/github/client_interface.go | Replaces DeleteStack with CreateStack/UpdateStack in the GitHub client interface. |
| cmd/unstack.go | Removes the unstack command implementation. |
| cmd/unstack_test.go | Removes tests for unstack. |
| cmd/submit.go | Adds submit command implementation, including PR creation and stack syncing logic. |
| cmd/submit_test.go | Adds unit tests for submit, PR body generation, and stack sync behaviors. |
| cmd/root.go | Registers submit and removes unstack from the CLI root command. |
| cmd/root_test.go | Updates subcommand registration expectations for submit/unstack. |
| cmd/rebase.go | Updates post-rebase guidance to direct users to gh stack submit. |
| cmd/push.go | Simplifies push behavior and adds hinting to use submit for PR creation. |
| cmd/push_test.go | Updates push tests for the new behavior and hinting. |
| cmd/merge.go | Updates guidance to direct users to gh stack submit when no PR exists. |
| cmd/merge_test.go | Updates merge test expectation to reference submit. |
| cmd/init.go | Updates init guidance to direct users to gh stack submit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
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. |
ktravers
left a comment
There was a problem hiding this comment.
Left one thought, definitely not blocking. Overall changes look good to me. Caveat: I'm reviewing as someone with only the most cursory understanding of Go 😅 so definitely good to get 👀 from someone with more expertise there.
| 5. **Server-side stack discovery is not supported.** `checkout` only works with locally tracked stacks. | ||
| 6. **PR title and body are auto-generated.** There is no flag to set a custom PR title or body during `submit`. The title and body are generated from commit messages plus a footer. Use `gh pr edit` to modify PR title and body after creation. |
There was a problem hiding this comment.
Instead of removing unstack entirely, would it be helpful to let users know they can unstack from the web interface? 🤔
| 5. **Server-side stack discovery is not supported.** `checkout` only works with locally tracked stacks. | |
| 6. **PR title and body are auto-generated.** There is no flag to set a custom PR title or body during `submit`. The title and body are generated from commit messages plus a footer. Use `gh pr edit` to modify PR title and body after creation. | |
| 5. **Stack deletion is not supported.** Direct users to open the PR URL in a browser to unstack PRs. | |
| 6. **Server-side stack discovery is not supported.** `checkout` only works with locally tracked stacks. | |
| 7. **PR title and body are auto-generated.** There is no flag to set a custom PR title or body during `submit`. The title and body are generated from commit messages plus a footer. Use `gh pr edit` to modify PR title and body after creation.``` |
There was a problem hiding this comment.
I decided to remove any mentions of unstack because we don't have the APIs yet for getting or deleting stacks. There are some weird edge cases you could get stuck into. Def not ideal, but hoping to add this all back in the next release once we have the proper APIs in place.
Introduce
submitcommand and wire up Stack APIsThis PR separates the concerns of
pushand introduces a newsubmitcommand that handles PR creation and stack management on GitHub.Changes
submitcommand — pushes branches, creates/updates PRs (with interactive title prompting), and syncs the stack to GitHub via the new API. Absorbs the PR-creation logic previously inpush. Includes--auto,--draft, and--remoteflags.push— now only pushes branches to the remote (more akin togit push) and updates base SHAs.unstack— deleted command pending API endpoints for stack deletion.