Skip to content

feat(cli): add agentflare git ship -- push+PR+CI-wait in one command - #391

Merged
getappz merged 4 commits into
masterfrom
task/292
Aug 5, 2026
Merged

feat(cli): add agentflare git ship -- push+PR+CI-wait in one command#391
getappz merged 4 commits into
masterfrom
task/292

Conversation

@getappz

@getappz getappz commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Auto-opened on item done for h7qSgZkp1qK7MC1HDFWEb.

Summary by CodeRabbit

  • New Features
    • Added the agentflare git ship command to validate repository state, verify pull request titles, push feature branches, and find or create pull requests.
    • Supports configuring the base branch, pull request title and description, CI waiting behavior, and timeout duration.
    • Reports CI failures and recoverable GitHub issues with actionable status information.

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.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c57f0957-eadb-49ee-9cd9-e35df42461c2

📥 Commits

Reviewing files that changed from the base of the PR and between 04eda5e and 7bc5bd3.

📒 Files selected for processing (1)
  • src/cli/git.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/cli/git.rs

📝 Walkthrough

Walkthrough

Adds agentflare git ship. The command validates the repository and branch, pushes changes, finds or creates a GitHub pull request, generates default metadata, and optionally waits for CI checks. Conventional PR title validation is now crate-visible.

Changes

Git ship workflow

Layer / File(s) Summary
CLI contract and dispatch
src/cli/git.rs
Adds GitCommand::Ship, ShipArgs, and dispatch to the shipping workflow.
Branch validation and pull request flow
src/cli/git.rs, src/mcp_server.rs
Validates repository state, confirms commits exist ahead of the base, pushes the branch, resolves GitHub data, finds or creates a pull request, and generates default title and body values. The title validator is now pub(crate).
CI check polling
src/cli/git.rs
Adds bounded polling for successful, failed, unavailable, and pending CI checks.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description contains only an auto-generated note and omits the required summary, test plan, and reviewer notes. Replace the auto-generated note with the repository template, including the change summary, test plan status, risk areas, and backwards compatibility.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the new agentflare git ship command and its push, PR, and CI-wait behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/292

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ca2775e and 04eda5e.

📒 Files selected for processing (2)
  • src/cli/git.rs
  • src/mcp_server.rs

Comment thread src/cli/git.rs Outdated
Comment thread src/cli/git.rs
Comment thread src/cli/git.rs Outdated
Comment thread src/cli/git.rs Outdated
- 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
@getappz getappz changed the title Adopt: ship pipeline — commit+push+PR create+live CI/PR status (cwt reference) feat(cli): add agentflare git ship -- push+PR+CI-wait in one command Aug 5, 2026
….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.
@getappz getappz changed the title feat(cli): add agentflare git ship -- push+PR+CI-wait in one command feat(cli): add agentflare git ship - push+PR+CI-wait in one command Aug 5, 2026
@getappz getappz changed the title feat(cli): add agentflare git ship - push+PR+CI-wait in one command feat(cli): add agentflare git ship -- push+PR+CI-wait in one command Aug 5, 2026
@getappz
getappz merged commit fc8be8f into master Aug 5, 2026
16 checks passed
@getappz
getappz deleted the task/292 branch August 5, 2026 17:51
@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant