Conversation
Adds a new git subcommand that collapses the commit-is-done -> push -> open (or find) a PR -> poll CI status sequence into a single call, for branches outside the item-claim worktree flow (which already has this via item done/check_merge). Deliberately never stages or commits -- matches item done's existing push_and_open_pr convention of only ever pushing what's already committed. Reuses existing pieces rather than reinventing them: RepoId/Client/pulls::create,find_existing (already used by push_and_open_pr and the flare_git MCP tool), branch::current_branch and resolve_default_branch, and github::mcp::checks_wait_summary (the same pending/failed classification the flare_git pr_wait MCP action uses), so the CLI and MCP paths agree on what CI green means. v1 scope: a bounded synchronous poll, not a TUI live-refresh loop.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds ChangesGit ship workflow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant GitCommand
participant GitHub
participant PullRequest
participant Checks
User->>GitCommand: Run `agentflare git ship`
GitCommand->>GitCommand: Validate branch and commits
GitCommand->>GitHub: Push branch and resolve repository metadata
GitCommand->>PullRequest: Find or create pull request
GitCommand->>Checks: Poll checks when waiting is enabled
Checks-->>User: Report success, failure, error, or timeout
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/cli/git.rs`:
- Around line 922-926: Update the existing-match handling in the
`pulls::find_existing` flow to distinguish open pull requests from closed or
merged ones using `PullRequest.state` and `merged_at`; only reuse an open match,
while treating non-open matches as absent so `ship` creates a new pull request,
or explicitly report the closed state without polling it.
- Around line 1013-1024: Update the CI status handling around
checks_wait_summary so a total_checks value of zero is treated as pending rather
than successful. Prevent the “CI green (0 checks)” branch from returning, and
preserve normal success and failure reporting once at least one check is
registered.
- Around line 890-900: Update the git ship flow in the `rev-list` check so an
unresolvable `base` ref is detected before computing `ahead` in
`src/cli/git.rs`. Replace the current `shell::run_in(...).unwrap_or_default()`
path with logic that distinguishes `git rev-list` failures from a valid
zero-count result, and report a separate error when the base ref cannot be
resolved. Keep the existing “no commits ahead” message only for the valid `ahead
== "0"` case, using the same surrounding ship/exit handling.
- Around line 928-936: Move title resolution via default_pr_title and validation
via AgentflareMcp::validate_conventional_pr_title before the git push in the
shipping flow, so invalid titles fail before any remote changes. Reuse the
validated title for PR creation and remove the current post-push validation/exit
path, preserving the existing title behavior for explicitly provided and default
titles.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d9a80fc3-2527-49ea-bc72-e0de3b5c658e
📒 Files selected for processing (2)
src/cli/git.rssrc/mcp_server.rs
- distinguish an unresolvable base ref from a genuine zero-commits-ahead result (verify the ref before counting, surface rev-list errors instead of silently treating them as 0 commits) - only reuse an existing PR when it's actually open; a closed/merged match on the same branch now falls through to opening a new PR for the new commits, instead of being misreported as already open - resolve and validate the PR title before the push, not after, so an invalid title fails before the branch is pushed with no PR opened - treat a zero-check-runs result as still pending rather than a false CI green -- GitHub hasn't registered any workflow run against the head SHA yet in that state
ship pipeline — commit+push+PR create+live CI/PR status (cwt reference)….97.1) Local rustfmt 1.9.0-stable accepted these unwrapped; CI's newer toolchain wants them multi-line. Known local/CI rustfmt version drift in this repo.
Auto-opened on
item donefor h7qSgZkp1qK7MC1HDFWEb.Summary by CodeRabbit
agentflare git shipcommand to validate repository state, verify pull request titles, push feature branches, and find or create pull requests.