[ML] Sweep stale backport-pending labels (auto-merged backports) - #3127
Closed
edsavage wants to merge 1 commit into
Closed
[ML] Sweep stale backport-pending labels (auto-merged backports)#3127edsavage wants to merge 1 commit into
edsavage wants to merge 1 commit into
Conversation
The event-driven remove-backport-pending job never fires for auto-merged backport PRs: auto-merge armed with GITHUB_TOKEN attributes the merge to github-actions[bot], and GitHub suppresses the workflow runs it would otherwise trigger (the same recursion guard that stops GITHUB_TOKEN-authored PRs from starting CI). As a result the source PR keeps backport-pending forever and it has to be cleared by hand. Add an hourly (and on-demand) sweep-backport-pending job as a backstop: it clears backport-pending from any source PR whose backport PRs have all merged/closed, regardless of how they merged, and also covers manually created backports. A 1h post-merge guard avoids stripping the label before the backport PRs have been opened. Co-authored-by: Cursor <[email protected]>
|
Pinging @elastic/ml-core (Team:ML) |
5 tasks
Contributor
Author
|
Superseded by #3128, which fixes the root cause directly: arm auto-merge with the ephemeral App token so the deferred merge is attributed to a non- |
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
The
remove-backport-pendingjob inbackport.ymlclears thebackport-pendinglabel from a source PR once all of its backports have merged. It's driven by the backport PR'sclosed(merged) event.That event-driven path never fires when a backport PR is auto-merged: auto-merge is armed with
GITHUB_TOKEN, so GitHub attributes the eventual merge togithub-actions[bot]and suppresses the workflow runs it would otherwise trigger — the same recursion guard that stopsGITHUB_TOKEN-authored PRs from starting CI (already documented in the backport job). The upshot is the source PR keepsbackport-pendingindefinitely and it has to be removed by hand (as happened on #3078 and #3115).Fix
Add an hourly (and
workflow_dispatch)sweep-backport-pendingbackstop job that clearsbackport-pendingfrom any source PR whose backport PRs have all merged/closed. It:[9.5] Original title (#<source>)) as the event-driven job;The event-driven job is retained (immediate in the human-merge case); the sweep is purely additive.
Notes
schedule+workflow_dispatchare added. The existingpull_request_targetjobs are guarded ongithub.event.pull_request.*, so they're skipped for schedule/dispatch events (and the sweep job is gated to only those events).(#<source>)— same assumption as today'sremove-backport-pending. Manually opened backports should follow that convention to be tracked.Test plan
main.workflow_dispatch) and confirm thesweep-backport-pendingjob runs, correctly keeps the label on a source PR that still has open backports (respecting the 1h guard), and removes it once all backports are merged/closed.backport-pendingis cleared within the hour without manual intervention.Follows up the auto-backport-and-merge work (#3094, #3103, #3122); addresses the known
GITHUB_TOKEN-suppression cleanup gap noted there.