ci: base stale-assignment clock on human activity, not updated_at#823
Open
andreahlert wants to merge 1 commit into
Open
ci: base stale-assignment clock on human activity, not updated_at#823andreahlert wants to merge 1 commit into
andreahlert wants to merge 1 commit into
Conversation
The stale-assignment workflow measured inactivity from issue.updated_at. That field is bumped by *any* change to the issue, including the bot's own warning comment and label edits. Each weekly warn therefore reset the clock, capping daysSinceUpdate at the warn interval so the 21-day unassign branch was never reached: the bot warned forever and never removed an assignee. Observed on apache#400: warnings at 17 then exactly 14 days later 14, again 16 then 20 days, while the assignee was never unassigned. Compute inactivity from the most recent of: last non-bot comment, the assignment event for a current assignee (so a freshly assigned issue is not instantly stale), and issue creation time. Bot comments no longer pollute the signal, so the clock accumulates and the unassign threshold is reachable. Reuse the paginated comments for the recent-warn spam guard. Signed-off-by: André Ahlert <andre@aex.partners>
Collaborator
Author
|
Superseding this. Rather than chase a correct activity signal, removing the stale-assignment bot entirely (it posted misleading inactivity numbers and never actually unassigned anyone). New PR removes the workflow. |
Collaborator
Author
|
Reopened. Disregard the previous close note about removing the workflow, that was a misread. The bot stays; this PR is the intended fix: the bot's own warning comment no longer resets the inactivity clock. Excluding |
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.
Problem
The
Stale Assignmentsworkflow (.github/workflows/stale-assignments.yml) is supposed to warn at 14 days of inactivity and unassign at 21. It never unassigns.It measures inactivity from
issue.updated_at:updated_atis bumped by any change to the issue, including the bot's own warning comment and label edits. So each weekly warn resets the clock, cappingdaysSinceUpdateat the warn interval. The 21-day unassign branch is effectively dead code: the bot warns forever and never removes an assignee.Evidence (#400)
Bot warning timestamps on #400:
Apr 15 to Apr 29 is exactly 14 days. An honest counter would have read 31, not 14, the warning comment reset
updated_at. The assignee was never removed despite four warnings.Fix
Measure inactivity from the last human activity, taking the most recent of:
github-actions[bot]excluded),assignedtimeline event for a current assignee (so a freshly assigned issue is not instantly stale),Bot comments no longer pollute the signal, so the clock accumulates past 14 and the 21-day unassign threshold becomes reachable. The paginated comments are reused for the existing recent-warn spam guard.
Notes
lifecycle/frozenexemption.node --check.