All docs

Working on code

Approvals, submitting and the merge queue

When a change can merge, how submitting a stack works, and how the merge queue merges changes for you as soon as they're ready.

When a change can merge

A change is Ready to submit when the branch's completion rules are met. By default that's one approval from someone other than the author. The rules can also ask for:

  • more approvals;
  • every discussion someone is waiting on to be resolved;
  • no outstanding Ask for changes;
  • an approval from everyone asked to review;
  • approval from the code owners of the files it touches;
  • named checks to have passed;
  • signed commits.

The Review panel shows how many approvals it has of how many it needs, and what's still holding it.

Submit

Someone who can write to the branch chooses Submit. In a stack, Submit stack up to here merges that change and every change below it, bottom first.

  • If the branch hasn't moved, the commits fast-forward onto it, unchanged.
  • If it has, the commits are replayed onto the branch's latest commit.
  • It's all or nothing: if any change in the stack can't be merged (it conflicts, or isn't approved), none of them is, and you're told which and why.

After a submit, the changes show as Merged, and anyone following them is notified.

Merge when ready

Merge when ready puts a change in the repository's merge queue before it's approved. Queued changes merge by themselves, in order, as soon as their approvals and discussions allow, with the same checks as Submit.

A change leaves the queue if it no longer applies to the branch, gets a new revision, or is abandoned. Whoever queued it is told why. The queue is on the Changes tab, where each change is marked Queued, or Taken out if it left.

Testing before merging

On a branch whose rules require checks, the queue tests each change merged with the branch before merging it: it puts that commit at refs/fettlecode/queue/..., announces it with a push webhook, and your CI runs it. Only the exact commit that passed is merged. That way two changes that each pass on their own can't break the branch together.

Pushing straight to a branch

On a branch that doesn't need review, people with the write role (or the role the branch's rules set) can push directly, as with any Git host. Fettlecode records direct pushes and force pushes in the audit log.