Repository navigation
π contributor nudge: per-PR CI-failure cooldown and failing-set dedupe - #17331
Conversation
CI-failure nudges are keyed on the failing-check set rather than the lane's reason prefix. The same set on a new head, or a check joining the set on the same head, edits the PR's one nudge comment (marker gains checks=<digest> attempt=<n>; no relay re-dispatch for the same head). A changed set on a new head within governor.labels.stage.contributor_nudge.ci_failure_cooldown (default 6h) is folded into the comment instead of counting as a fresh nudge. The ledger persists in the stage-label store across restarts. Fixes #17328 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
/lgtm |
|
/approve |
|
@clubanderson: you cannot LGTM your own PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clubanderson The full list of commands accepted by this bot can be found here. The pull request process is described 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. |
|
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. |
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
There was a problem hiding this comment.
Read the change against the tree at 2fd05e6 (merge-base with v5), including the callers in automerge_contributor_nudge.go and the store in stagelabels/store.go. The failing-set keying and the same-head fold look correct to me; one low-severity edge worth a look.
Verified
rec.NudgeReasonis stored as the slug (store.go:1462), sociNudgeDue's comparison againstNudgeReasonCIFailure(automerge_contributor_nudge.go,ciNudgeDue) is valid;MentionCauseClassalready stripsrequired-(store.go:1380) andNudgeReasonSlugnow foldsoptional-check-failing, so the three prefixes collapse into one class as the body says.- Same head:
checksis unioned withrec.NudgeCIChecksbeforeciNudgeDue, so a shrunken set compares equal and falls through tonudgeRepeatDue(no write), and a grown set returns ordinal 0 withsameHeadFoldtrue β no relay dispatch,rec.NudgeModereused. Matches the body. - Pre-ledger records (
NudgeCIChecksnil) on the same head take the fold path once and then carry the ledger; harmless one-time rewrite. TestContributorNudgeCIFailureSetCooldown/TestCINudgeDuecover grow-on-same-head, same-set-new-head, changed-set-inside-cooldown and changed-set-after-cooldown.
Low: "fresh nudge after cooldown" does not restart the class count
ciNudgeDue returns ordinal 1 for a changed set on a new head once the cooldown has elapsed, and the body says this "counts as a fresh nudge". But MarkNudgedReason (store.go:1463-1470) only resets the count when the class changes and only raises it when n > NudgeReasonCount. So if the PR has already had its stall repeat (NudgeReasonCount == 2), the later ordinal-1 nudge:
- renders
n=1in the marker and non-stalled prose while the ledger stays at 2 (the "nudge N" reading goes backwards), and - leaves
nudgeRepeatDuecapped (NudgeReasonCount >= contributorNudgeCap), so the genuinely new failing set never gets its own stall reminder.
The new test only exercises this path from NudgeReasonCount == 1 (automerge_contributor_nudge_ci_cooldown_test.go:162-171), so it does not see the difference. If the intent is that a new set after cooldown really restarts the class, MarkNudgedCIFailure(counted=true) (or MarkNudgedReason) should reset NudgeReasonCount to 1; if the intent is that the cap stays global per PR, the body's "fresh nudge" wording and the n=1 marker are the thing to adjust. Either is a small follow-up; not blocking.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Fixes #17328
What
On hive's own spoke, CI-failure contributor nudges churned on the same PRs (#17303/#17305/#17308): the lane reason flapped between
check-failing:/optional-check-failing:/required-check-failing:on one head, so each flip looked like a new reason class β count restart, comment rewrite, relay re-dispatch β and each re-failed push repeated it.This keys CI-failure nudges on the failing-check set and adds a per-PR cooldown:
optional-check-failingnow folds into thecheck-failingclass (NudgeReasonSlug).hive:contributor-nudgecomment (π± contributor-nudge once per PR+reason; fold origin notes into status; marker ratchetΒ #17073 upsert) gainschecks=<digest> attempt=<n>in its marker.attempt+1("The same checks have failed on N heads so far"), relay told, no new nudge counted.governor.labels.stage.contributor_nudge.ci_failure_cooldown(default6h) β folded into the comment, class count unchanged; after the cooldown it counts as a fresh nudge.nudge_ci_checks/head/at/attempts,nudge_mode) lives in the stage-label store, so a restart does not re-nudge.PUT stage_nudge_ci_failure_cooldown/GET stageNudgeCICooldown.Tests
TestContributorNudgeCIFailureSetCooldownβ set grows on same head (edit, no relay), subset flap (nothing), same set new head (attempt=2), restart on the same store file, changed set inside cooldown (fold), changed set after cooldown (fresh nudge); never a second comment.TestCINudgeDue,TestStoreMarkNudgedCIFailure, slug fold case,TestHandleGovernorLabels_CIFailureCooldownRoundTrip.