Repository navigation
π github: don't let prow's WIP mirror label shield hive drafts from the stale-draft rule - #16248
Conversation
β¦he stale-draft rule fetchPRsWithDetails checked exempt labels before the draft branch, and PermanentExemptLabels prefix-matches do-not-merge, so the do-not-merge/work-in-progress label prow adds to every draft filtered every hive-authored draft as "Exempt label". The 48h stale-draft rule never ran, the scanner never saw the PR in "YOUR STALE DRAFT PRs", and the linked issue stayed suppressed as covered_by_open_pr β a deadlock (#15890/#15540). A draft whose only exempt label is the WIP mirror now falls through to the draft branch; any other do-not-merge/* or configured exempt label still filters it. Closes #16246 Signed-off-by: Andrew 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 No conflicting open PRs or same-file overlaps were found. |
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
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. Review findings from Read
One side effect worth knowing, not a defect: human-authored drafts whose only exempt label is the WIP mirror now count as
|
There was a problem hiding this comment.
Read the change against the tree at 96f4d93; this looks correct to me.
- The bug is real:
HasExemptLabelmatchesPermanentExemptLabelsby prefix (src/pkg/github/client.go:3890), so prow'sdo-not-merge/work-in-progressmirror label satisfiedisExemptand every hive draft was sidelined as "Exempt label" atclient.go:2245before reaching the draft branch. - With the guard, a draft whose only exempt label is the mirror falls through to
client.go:2251-2259, where the existingappBotLogin+staleDraftAftercheck populatesstaleDrafts. Drafts carrying any other exempt/hold label still filter, becauseisDraftExemptOnlyByWIPMirrorre-runsisExempton the remaining labels (client.go:3883). Held drafts are already handled earlier by theHoldLabelsbranch, so ordering is unaffected. - The
scale-envelope.mdcitation update toclient.go:5040-5050matchesRankActionableIssuesat this head (func at 5040, comparator at 5048).
One edge worth knowing, not a defect: if an operator lists do-not-merge/work-in-progress itself in exemptLabels, the guard strips it before the isExempt(rest) check, so that configured exemption would no longer shield drafts. Given the label is prow-applied rather than operator intent, that seems acceptable.
Comment only; I have not approved or changed anything.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Problem
fetchPRsWithDetailsruns the exempt-label check before the draft branch, andPermanentExemptLabelsprefix-matchesdo-not-merge. Prow'swipplugin addsdo-not-merge/work-in-progressto every draft, so every hive-authored draft was filtered as "Exempt label" and the 48h stale-draft rule never ran. The scanner never saw such PRs in "YOUR STALE DRAFT PRs", while the linked issue stayed suppressed ascovered_by_open_prβ a deadlock, observed on #15890 / #15540 (2 days parked after the PR it was stacked on merged).Fix
A draft whose only exempt label is the WIP mirror now falls through to the draft branch (counted as Draft, eligible for
StaleDrafts). Any otherdo-not-merge/*or configured exempt label still filters it;do-not-merge/holdkeeps its earlier "Held draft" path.Tests:
TestFetchPRs_StaleAppDraftWithWIPMirrorLabelIsSurfaced,TestFetchPRs_StaleAppDraftWithOtherExemptLabelStaysExempt.Closes #16246