fj pr merge --auto: schedule a merge once required checks pass #164

Closed
opened 2026-06-15 15:00:44 +00:00 by stephen · 0 comments
Owner

Problem

fj pr merge is immediate-only. CI-gated merges force you to poll (fj pr checks / fj run watch) and merge after green, or babysit the PR. gh pr merge --auto and glab mr merge --when-pipeline-succeeds hand the wait to the server.

Acceptance criteria

  • fj pr merge <n> --auto registers a scheduled merge the server completes when all required checks pass; honors --style, --delete-branch, --title / --message.
  • fj pr merge <n> --disable-auto cancels a pending scheduled merge.
  • When the host build lacks scheduled-merge support, exit nonzero with a clear "not supported on this host" message (reuse the #162 merge-error diagnosis, no opaque 405).
  • --auto on an already-green PR merges immediately instead of erroring.
  • fj pr view / fj pr checks show pending state (e.g. Auto-merge: scheduled (squash)), reusing the Mergeable: line from #162.

Value

Removes the poll/babysit loop at the center of every CI-gated merge; an agent or human can fire-and-forget a merge.

Priority

p1 (highest absolute value).

Dependencies / sequencing

Builds on the pr merge + mergeability surfacing shipped in #162. START with a short spike to confirm the Forgejo build exposes scheduled auto-merge (merge_when_checks_succeed on the merge endpoint + DELETE to cancel); that spike gates the rest.

Overlap

None. Shares the pr view / pr checks rendering touched by #159 / #160 / #162.

## Problem `fj pr merge` is immediate-only. CI-gated merges force you to poll (`fj pr checks` / `fj run watch`) and merge after green, or babysit the PR. `gh pr merge --auto` and `glab mr merge --when-pipeline-succeeds` hand the wait to the server. ## Acceptance criteria - [ ] `fj pr merge <n> --auto` registers a scheduled merge the server completes when all required checks pass; honors `--style`, `--delete-branch`, `--title` / `--message`. - [ ] `fj pr merge <n> --disable-auto` cancels a pending scheduled merge. - [ ] When the host build lacks scheduled-merge support, exit nonzero with a clear "not supported on this host" message (reuse the #162 merge-error diagnosis, no opaque 405). - [ ] `--auto` on an already-green PR merges immediately instead of erroring. - [ ] `fj pr view` / `fj pr checks` show pending state (e.g. `Auto-merge: scheduled (squash)`), reusing the `Mergeable:` line from #162. ## Value Removes the poll/babysit loop at the center of every CI-gated merge; an agent or human can fire-and-forget a merge. ## Priority p1 (highest absolute value). ## Dependencies / sequencing Builds on the `pr merge` + mergeability surfacing shipped in #162. START with a short spike to confirm the Forgejo build exposes scheduled auto-merge (`merge_when_checks_succeed` on the merge endpoint + DELETE to cancel); that spike gates the rest. ## Overlap None. Shares the `pr view` / `pr checks` rendering touched by #159 / #160 / #162.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rasterstate/fj#164
No description provided.