feat(cmd): add submit command for unified cascade, push, and PR workflow#11
Merged
feat(cmd): add submit command for unified cascade, push, and PR workflow#11
Conversation
Owner
Author
Stack
Managed by gh-stack |
71df290 to
40adc81
Compare
Adds 'gh stack submit' which combines three phases into one command: 1. Cascade: rebase current branch and descendants onto their parents 2. Push: force-push all affected branches with --force-with-lease 3. PRs: create PRs for new branches (as drafts if mid-stack), update bases for existing Supports --dry-run, --current-only, and --update-only flags. The continue command now handles submit operations, resuming push/PR phases after conflict resolution. Includes state extensions (Operation, UpdateOnly fields), CreateSubmitPR method with auto-generated titles, comprehensive e2e tests, and README documentation.
40adc81 to
9449ea6
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a new submit command that unifies the workflow of cascading, pushing, and creating/updating PRs into a single command. It also introduces fork point tracking to enable more intelligent rebasing when parent branches have been modified.
Changes:
- Adds
gh stack submitcommand combining cascade, push, and PR operations - Implements fork point tracking to handle parent branch modifications (amendments, rebases)
- Extends state management to support different operation types (cascade vs submit)
- Updates continue command to resume submit operations after conflict resolution
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/submit.go | New submit command with three-phase workflow |
| cmd/continue.go | Enhanced to handle submit operation resumption |
| cmd/cascade.go | Added fork point-aware rebasing with --onto support |
| cmd/create.go | Stores fork point when creating branches |
| cmd/adopt.go | Stores fork point when adopting branches |
| cmd/orphan.go | Removes fork point when orphaning branches |
| cmd/sync.go | Uses fork points for retargeting after merges |
| internal/state/state.go | Added Operation and UpdateOnly fields for submit |
| internal/github/github.go | Added CreateSubmitPR with auto-generated titles |
| internal/git/git.go | Added CommitExists and RebaseOnto functions |
| internal/config/config.go | Added fork point storage/retrieval functions |
| README.md | Documented new submit command and updated command table |
| e2e/submit_test.go | Comprehensive end-to-end tests for submit |
| *_test.go | Unit tests for new functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When submit encounters multiple cascade conflicts, the state's Pending list gets progressively smaller. This caused the push/PR phases to miss branches that were cascaded before the final conflict. Adds Branches field to CascadeState to store the complete original set of branches being submitted. On continue, this list is used to rebuild the full branch set for push/PR phases. Addresses PR #11 review feedback.
The submit command now provides a unified workflow that covers the use cases of both push and pr. Removing these commands simplifies the CLI surface area. - Remove cmd/push.go and cmd/pr.go - Remove e2e/push_test.go - Update e2e/chaos_remote_test.go to use git push directly or submit --dry-run - Update README.md to remove push and pr documentation
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When creating new PRs via submit, auto-generate the PR body from commit messages: - Single commit: use the commit body - Multiple commits: format as markdown sections with headers This restores functionality that was lost when the standalone 'pr' command was removed.
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.
Adds 'gh stack submit' which combines three phases into one command:
Supports --dry-run, --current-only, and --update-only flags. The continue
command now handles submit operations, resuming push/PR phases after
conflict resolution.
Includes state extensions (Operation, UpdateOnly fields), CreateSubmitPR
method with auto-generated titles, comprehensive e2e tests, and README
documentation.