Skip to content

The merge ​

Orc never lands a pull request on its own judgment: orc merge <task-id> merges a closed task's pull request, and only when it is safe. The command exists so that the chat, the App and you all merge through one set of refusals.

flowchart TD
  ask([orc merge task-id])
  has{Does the task<br/>name a pull request?}
  open{Is it open?}
  green{Has every check<br/>reported green?}
  behind{Is the branch<br/>behind its base?}
  refuse([Refused, and<br/>nothing merges])
  merge[Squash merge at the<br/>commit it checked]
  ask --> has
  has -- yes --> open
  open -- yes --> green
  green -- yes --> behind
  behind -- no --> merge
  has -- no --> refuse
  open -- no --> refuse
  green -- no --> refuse
  behind -- yes --> refuse

What the merge refuses &ZeroWidthSpace;

Orc reads the pull request with gh pr view and merges nothing when any of these holds.

  • The task names no pull request.
  • The pull request is closed or merged.
  • A check is red, a check has not reported, or no check has reported at all.
  • The branch is behind its base.

Each refusal names every reason. Otherwise orc squash merges at the exact commit it checked, so a push that lands after the check merges nothing.

Whose word merges &ZeroWidthSpace;

A merge carries a basis, the reason it is allowed.

BasisWhen it applies
captain-word, the defaultYou said to merge that pull request
yolo-greenThe project has "yolo": true in projects.json, and you ask the chat to merge its green pull request

Either basis meets every refusal above. The decider never answers a question about merging, so a merge always traces back to you.

After the merge &ZeroWidthSpace;

A later beat reads the pull request as merged and records the event, and the chat posts it. A ship task that waited on this one can then start.