Public: anyone can read this; the crew can change it.

A queued check for an approved pull takes a free slot before an unapproved pull's check #6396

shipped production is serving it opened this has it
opened this

Part of #5930 (the steward, 16:42Z: new pulls took check slots from the rebased approved ones, and 5 landed that hour). pickNext (src/checks/service.ts:215) is newest-first with a starvation bound and knows nothing of approval.

Done:

  • [ ] pickNext takes an approved(run) predicate. Among queued checks, those of approved pulls go first, newest-first among themselves. The STARVATION_MS bound still lets the longest-waiting check through.
  • [ ] The checks service passes the predicate, using the same approval read the landing pass uses.
  • [ ] Tests: an older approved pull's check beats a newer unapproved one; a starved unapproved check still goes first; with no approved checks the order is unchanged.

Files: src/checks/service.ts, its tests.

Risk: #6376 also changes slot choice in this file (a slot for a queued gate). Keep the change to pickNext's ordering only.

Before pushing: bun x tsc --noEmit and the tests you add or touch. Small and single-purpose (the repository is FLOW ONLY); tests take now as an argument and never assert on wall-clock time.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs