fix(review): stop the re-gate sweep from reordering PRs by repair status - #4411
Merged
Conversation
selectRegateCandidates sorted a repair-flagged PR (surfaceRepairPriorityPullNumbers -- missing public surface or current Gate check) ahead of every other candidate, regardless of staleness or creation order. With a mixed backlog of repaired and ordinary PRs, this let a newer PR needing repair cut ahead of older PRs that had merely gone stale -- observed live as PRs dispatching out of their creation/ staleness order. Repair status now only affects eligibility (bypassing the freshness guard, staying in the oldest-first pool despite already having a regate stamp) -- never final order. Every eligible PR, repaired or not, is ordered by the same staleness/ creation-order key plus PR-number tiebreak, so a sweep processes its queue in one deterministic order every time.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4411 +/- ##
==========================================
- Coverage 93.96% 93.96% -0.01%
==========================================
Files 401 401
Lines 36902 36900 -2
Branches 13494 13492 -2
==========================================
- Hits 34676 34674 -2
Misses 1570 1570
Partials 656 656
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
selectRegateCandidates(the scheduled re-gate sweep's candidate picker) sorted a repair-flagged PR (surfaceRepairPriorityPullNumbers-- a PR missing its published public surface or a completed current-head Gate check) ahead of every other candidate, in bothstalenessandoldest-firstorder modes, regardless of how stale or how old the ordinary candidates were.priorityBypassesFreshness) and still keeps a repair candidate in theoldest-firstpool even once it already carries alastRegatedAtstamp (hasRepairPriority). It no longer affects order -- every eligible candidate, repaired or not, is sorted by the same staleness/creation-order key plus the PR-number tiebreak, so a sweep processes its queue in one deterministic order every time, regardless of how many candidates happen to need repair.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
npm run typechecknpx vitest run test/unit/agent-sweep.test.ts test/unit/queue.test.ts— 783/783 pass, including 3 updated REGRESSION tests (whose expectations flip to reflect the new no-reorder behavior) and one new dedicated regression test (#selfhost-fifo-ordering) added at both the pure-function and full-webhook-integration levels.npm run actionlint/npm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm run ui:openapi:check/npm run ui:lint/npm run ui:typecheck/npm run ui:build/npm audit— not run locally for this focused change; relying on CI (validate) for the full gate.processJobintegration test) was re-verified against the new behavior, not just patched to pass.If any required check was skipped, explain why:
npm run test:cigate is left to CI per the repo's own established practice for this size of change.Safety
UI Evidencesection. — N/A, no UI changes.Notes