Repository navigation
π Coalesce base preparation refreshes and keep a ready owner in front - #19275
clubanderson wants to merge 1 commit into
Conversation
The preparation owner is not refreshed again while required CI on its last bot refresh is still in flight, unless the base delta touches the PR's files or that CI failed. A successor no longer merges ahead of an owner that is green and reviewed on its completed refresh. Both waits are bounded by preparationRefreshCoalesceMaxWait; unreadable evidence keeps the previous behavior. Fixes #19274 Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
Mutation testinggremlins found 4 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.
2 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the
Verdict: |
| if err != nil || !requirementsKnown || st.Green { | ||
| return false | ||
| } | ||
| return stageengine.ClassifyCIReason(st.Reason) == stageengine.CIReasonPending || strings.HasPrefix(st.Reason, "required-check-missing:") |
There was a problem hiding this comment.
Advisory: cistatus.ReasonIsPending (src/pkg/cistatus/cistatus.go) already covers the required-check-missing: prefix and pending reasons. Consider reusing it, or add a comment on why this narrower set is intended (it excludes ci-reporting-stalled:/ci-reporting-unverified:).
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Docs-currency review at 0c0aef7. The new section in One stale statement (in-scope, low). The new bullet then needs its cross-reference changed from Review findings from One in-scope correctness concern on the truncation guard (inline). I read the diff, the base-preparation file at head 0c0aef7, and the issue #19274; the gate ordering, the Findings not on a changed line
@clubanderson this PR is held at Why:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
Fixes #19274
What
Two bounded waits in base preparation, both capped by
preparationRefreshCoalesceMaxWait(30 minutes after the owner's last bot refresh):claimBasePreparationUpdatenow askspreparationRefreshCoalescesfirst. When the PR is the owner, its live head is the result of the recorded refresh (preparationCompleted), required CI on that head is pending or not yet reported, and the base commits since the refresh provably miss every file the PR changes, the refresh waits withbase-refresh:coalescing(abase-refresh:reason, so ownership is kept). It refreshes as before when that CI finished green or red, when the base delta touches the PR's files, when the delta compare errors, is notahead, is empty or may be truncated, for a repair owner, or after the max wait.currentBaseGatenow callspreparationOwnerHoldsSuccessorbefore comparing. If another PR owns the destination and is CI-green and approved on its completed refresh (preparationReadinessready and known), the caller holds withbase-refresh:queued-behind#<owner>. A pending or unreviewed owner holds nothing, so the readiness-first yield is unchanged. Any failed read, a repair owner, an invalid or unrefreshed owner, or the max wait holds nothing.Why
#19228 was refreshed 5 times today, two of them 7 minutes apart; on its fourth refresh required CI finished at 16:27 and the next refresh came at 16:28, after a successor merged ahead of it. Each refresh costs about 16 workflow runs and 38 runner-minutes.
Tests
TestPreparationRefreshCoalescesWhileCIPending: pending and not-yet-reported CI defer the refresh and keep the owner and attempt; green CI, red CI, an overlapping base delta, an unreadable delta and the max wait all refresh.TestPreparationGreenReviewedOwnerNotOvertaken: a green reviewed owner holds a current successor; pending, unreviewed and unrefreshed owners and the max wait do not.preparationAPIfixture gainsfailingandbaseDeltaknobs; existing behavior of the fixture is unchanged when they are unset.Docs:
src/docs/hive-merge.mdpreparation section. Changelog fragment included.