✨ push: add support for pushing draft pull requests#167
Merged
Conversation
Introduce --draft CLI flag and spr.push.draft configuration to allow pushing pull requests in draft state. #### Why Support pushing draft pull requests using the --draft CLI flag or spr.push.draft configuration. #### The code changes include: - Add `draft` field to `PushConfig` and default it to `false`. - Add `draft` field to `PullRequest` model and update GraphQL query to fetch `isDraft`. - Update `real` and `fakes` GitHub adapters to support `draft` status. - Add `draft` option to `PushOptions` CLI options. - Update `push` command to resolve draft status and pass it to `new_pull_request`. - Add unit and integration tests for CLI parsing and push draft behavior. go/traj/47f0453c-c152-4121-90cc-ac82c8774421 TESTED=UNITTESTS RELNOTES=NONE TAG=agy CONV=4ef8c914-cbfd-45b5-a0fd-661a9cba8365
Ongy
approved these changes
Jun 16, 2026
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.
Introduce --draft CLI flag and spr.push.draft configuration to allow pushing pull requests in draft state.
Why
Support pushing draft pull requests using the --draft CLI flag or spr.push.draft configuration.
The code changes include:
draftfield toPushConfigand default it tofalse.draftfield toPullRequestmodel and update GraphQL query to fetchisDraft.realandfakesGitHub adapters to supportdraftstatus.draftoption toPushOptionsCLI options.pushcommand to resolve draft status and pass it tonew_pull_request.go/traj/47f0453c-c152-4121-90cc-ac82c8774421
TESTED=manually
RELNOTES=NONE
TAG=agy
CONV=4ef8c914-cbfd-45b5-a0fd-661a9cba8365