How gating works
A gate is the checkpoint in front of a merge. A change that does not pass is not merged.
It verifies the future state
Changes in the gate’s queue are assembled, in order, into the “future state” in which they have all been merged, and that state is what gets verified.
- With one change in the queue, the state with that change merged is verified
- With several queued, the state includes the changes ahead of yours as well
- When everything passes, the changes are actually merged, in that order
When one change fails
The failed change is removed from the queue. The rest are reassembled as if that change had never been there, and verified again. Changes that depended on the failed one are removed with it.
- The branch you merge into never sits in an unverified state
- The reason for the failure stays in the results, so you can fix the change and submit it again
How this differs from ordinary CI
Ordinary CI verifies “the code as it is now, plus this change”. If another change lands first, that combination was never verified. A gate verifies the post-merge state itself, so there is no such gap.