Repository navigation
Conversation
A finished `gh pr create` (or GitHub MCP `create_pull_request`) call links its session to the new PR, so PR activity notifications follow it. An agent-opened PR replaces a linked issue but never an earlier PR.
A bare /pr (or /pr --draft) checks the branch, then writes a proposed title and body into the composer as editable /pr text. Sending the edited text pushes with upstream tracking, runs gh pr create (adding --draft when asked) and links the pull request to the session. The title comes from the session, the body from its latest reply plus the branch's commits. Preconditions, each with its own error: git repository, not detached, not the default branch, gh installed and signed in, no uncommitted changes (hinting /commit), commits ahead of the base. An open pull request for the branch is returned as is, with nothing pushed or created. The git and gh calls sit behind a small PrTools trait in scm/open_pr.rs, so the rules are tested with a fake. scm.rs gains gh_exec, git_capture and pr_url_from_output, which pr_create now shares.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
What changed
Adds a
/prcommand that pushes the session's branch and opens a GitHub pull request./pr(or/pr --draft) checks the branch, then puts a proposed title and body in the composer as editable/prtext. The title comes from the session; the body comes from the latest reply plus the branch's commits.gh pr create(with--draftwhen asked), and links the new PR to the session through Native: Link a session to the pull request its agent opens #1230's linking.Each precondition has its own error message: a git repository, not detached, not the default branch,
ghinstalled and signed in, no uncommitted changes (it suggests/commit), and commits ahead of the base.Why
Opening a PR from a session meant asking the agent to do it, or leaving MonoCode for a terminal.
/prdoes it in one step, with a body you can edit before anything is pushed.Where
monocode-core/src/scm/open_pr.rs: the rules, behind a smallPrToolstrait for the git andghcalls, so they're tested with a fake.monocode-core/src/scm.rs: newgh_exec,git_captureandpr_url_from_output, whichpr_createnow shares.monocode-gpui/src/conversation/open_pr.rs, plus small hooks inconversation.rs,commands.rs,git_actions.rsandcomposer_completion.rs.UI
No new chrome.
/prshows up in slash-command completion, and the proposed PR text goes in the composer.Checks
None of the checks ran for this PR. The build machine is out of disk space (about 1.45 GB free), so
cargo fmt --check,cargo check,cargo clippy -D warningsand the tests (including thePrToolsfake tests inscm/open_pr.rs) have not run on this branch. I opened it as a draft so CI can run them; it stays a draft until they pass locally too.Checklist
cargo fmt --check,cargo clippy -D warningsand the affected tests (not run, see above)