ref:main

anvil pr rebase <num> — CLI subcommand for the rebase action (server work needed first) #14

open Opened by cole.christensen@gmail.com

Links

No links yet.

Problem

fangorn/anvil#206 added a standalone PR rebase action via the LiveView. There’s no API endpoint for it, and no CLI command. CLI can’t trigger a rebase end-to-end.

Proposal

Two-step:

  1. Server: add `POST /api/v1/:org/:repo/pulls/:n/rebase` that calls `Anvil.CodeReview.rebase_pr_head/2`. Returns the typed-error atoms as JSON (already established in #206).
  2. CLI: `anvil pr rebase ` — POST to that endpoint, surface the typed error atoms with friendly messages.

Acceptance criteria

  • Server endpoint exists and returns JSON for both success and the full atom error set (`already_up_to_date`, `force_push_protected`, `unauthorized`, `cas_failed`, `{conflicts, […]}`, etc.)
  • `anvil pr rebase 42` triggers a rebase against an open PR with diverged head
  • Conflicts surface filenames + count
  • Tests cover both halves

Status

Blocked on server work — the server-side ticket should be filed on `fangorn/anvil` separately.

Origin

Out-of-scope follow-up from fangorn/anvil#206.