fix(actions): retain the latest pending coalescer event - #1770
fix(actions): retain the latest pending coalescer event#1770seonghobae wants to merge 4 commits into
Conversation
|
Warning Review limit reachedNext included review available in 18 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| # the latest head instead of accumulating up to 100 stale-head invocations. | ||
| # The script still verifies the event-bound expected head against the live PR | ||
| # before any mutation and fails closed if the head moved again. | ||
| queue: single |
There was a problem hiding this comment.
🔴 Cleanup runs starve during push bursts
During runner starvation, queue: single replaces each waiting cleanup whenever another push arrives. Sustained pushes can prevent cleanup from running, leaving redundant jobs consuming the shared ceiling.
Prompt for agents
Restore the multi-pending concurrency policy for .github/workflows/current-head-run-coalescer.yml and update its adjacent explanation and regression contract together. The workflow needs to retain pending cleanup invocations during runner starvation rather than replacing the sole pending invocation on every synchronize event. Preserve cancel-in-progress: false because active cleanup workers must finish, and keep the script's existing live-head fail-closed validation for older triggers.
Was this helpful? React with 👍 or 👎 to provide feedback.
| # Keep exactly one pending successor. GitHub replaces that pending run when a | ||
| # newer event enters the group, so the retained successor always represents | ||
| # the latest head instead of accumulating up to 100 stale-head invocations. | ||
| # The script still verifies the event-bound expected head against the live PR | ||
| # before any mutation and fails closed if the head moved again. | ||
| queue: single |
Closing — full succession by .github#1775Reviewed the full diff. This PR proposes adding Verified
Both test files this PR touches ( No unlanded delta remains -- |
Problem
Merged PR #1769 correctly stopped an active
Current Head Run Coalescerworker from cancelling itself by settingcancel-in-progress: false. The remaining contract was implicit: GitHub's defaultqueue: singlekeeps at most one pending successor and replaces it with each newer event.The first revision of this successor tried
queue: max. Devin's exact-head review correctly found that this would preserve up to 100 stale event-bound invocations and then reject later events, potentially leaving no cleanup opportunity for the final head. The coalescer cannot treat an old invocation as current becausecurrent_head_run_coalescer.pycompares the event'sEXPECTED_HEADwith the live PR before classification and refuses mutation after a head change.Repaired design
cancel-in-progress: falseso an active cleanup worker completes;queue: singleexplicitly so each latersynchronizeevent replaces the older pending invocation and the sole successor tracks the latest head;queue: maxin the focused contract to prevent stale-head FIFO buildup and the 100-pending rejection boundary;This is a bounded clarification/hardening successor to #1769. It also supersedes only the now-proven-harmful
queue: maxfragment previously present in broad/non-mergeable #1661; no unrelated delta is copied or discarded.TDD and review evidence
Initial hypothesis, now superseded by review:
f02486dbc159f5949305d4888656d0ca5120b37d— RED requiringqueue: max;ed2acac49df68da1262bb9ee6e5b325c9f21cd8c— initial GREEN adding it.Reviewer-driven correction:
05517598240c8c524657f3c7647b66ef6e38257d— RED requiring latest-pendingqueue: singleand rejectingqueue: maxwhile production still usedmax;d6bf882a8b35ed5d16ca3c8301a07a9da10297be— GREEN production repair.Exact branch comparison at this head: 4 commits ahead, 0 behind protected
main@bf28b5ddca7d4d63f3e6f63a43d084a0056563e2; effective delta remains limited to the coalescer workflow and its focused regression contract.GitHub's current concurrency specification states that
singleis the default latest-pending behavior, whilemaxretains up to 100 pending runs and cancels later arrivals when full. This control-plane worker needs the former, not FIFO accumulation.Merge policy
This is a central queue-admission/control-plane repair for #712. Re-fetch exact head, reviews, unresolved threads, and checks before merge. The user's Chicken-and-Eggs bypass applies only if this unchanged head is blocked because its own required workflows cannot obtain runner admission under the exact ceiling it reduces. No required security/review context is removed or synthesized.
Successor lineage: #1769, #1661, #712.