open PRs as draft by default#76
Open
skarim wants to merge 2 commits intoskarim/fetch-before-pushfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes gh stack submit and gh stack link to create draft PRs by default, and introduces a new --open flag to create PRs as ready for review (and to convert existing draft PRs to ready-for-review). It also adds a GitHub GraphQL mutation to mark draft PRs ready, plus accompanying docs and tests.
Changes:
- Switch default PR creation mode to draft, replacing the old
--draftbehavior with a new--openflag. - Add
MarkPRReadyForReviewto the GitHub client interface + implementation (GraphQL mutation) and use it when--openis set. - Update documentation and expand test coverage for the new default/flag behavior.
Show a summary per file
| File | Description |
|---|---|
| skills/gh-stack/SKILL.md | Updates skill docs/examples to reflect draft-by-default and --open. |
| README.md | Replaces --draft docs with --open for submit/link. |
| internal/github/mock_client.go | Adds mock hook for MarkPRReadyForReview. |
| internal/github/github.go | Implements MarkPRReadyForReview GraphQL mutation. |
| internal/github/client_interface.go | Extends ClientOps with MarkPRReadyForReview. |
| docs/src/content/docs/reference/cli.md | Updates CLI reference to replace --draft with --open. |
| docs/src/content/docs/faq.md | Updates FAQ wording to reflect new default PR creation mode. |
| cmd/submit.go | Removes --draft, adds --open, defaults new PRs to draft and converts existing drafts when requested. |
| cmd/submit_test.go | Adds tests for default draft behavior and --open behavior/conversion. |
| cmd/link.go | Removes --draft, adds --open, defaults new PRs to draft and converts existing drafts when requested. |
| cmd/link_test.go | Updates/extends tests for default draft behavior and --open behavior/conversion. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 11/11 changed files
- Comments generated: 5
c4d183c to
2fb3a99
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Default to creating draft PRs in
submitandlinkcommands.The
--draftflag is removed and replaced with--open, which:Motivation
Draft PRs are the safer default — they signal that work is in progress and prevent accidental reviews or merges. Users who want to open PRs that are ready for review can opt in with
--open.Changes
New GitHub API method:
Command changes (submit + link):
--draftflag--openflag (default: false, meaning PRs are drafts by default)--openis set on existing draft PRs, they are converted to ready for reviewTests:
6 new tests covering default-draft behavior, --open flag for new PRs, and draft→ready conversion for existing PRs.
Docs:
Updated README, CLI reference, FAQ, and agent skill file.
Examples
Stack created with GitHub Stacks CLI • Give Feedback 💬