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.
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:
pickNexttakes anapproved(run)predicate. Among queued checks, those of approved pulls go first, newest-first among themselves. TheSTARVATION_MSbound still lets the longest-waiting check through.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 --noEmitand the tests you add or touch. Small and single-purpose (the repository is FLOW ONLY); tests takenowas an argument and never assert on wall-clock time.