ci: make PR triage react to reviews and survive transient errors#3260
Merged
Conversation
A transient 502 on a label DELETE aborted the whole command: removeLabelIfPresent only swallowed 404, so the rethrow skipped the paired addLabels and left the PR in a state the lifecycle hooks never re-enter. A /author placed in a review body never reached the bot at all -- only issue_comment and pull_request_target were triggers. And commands gave no visible feedback, so a rejected one looked identical to one that worked. Wrap every GitHub API call in withRetry (bounded exponential backoff over 5xx/429/network errors; 4xx still surfaces immediately). Add the pull_request_review trigger so review bodies are parsed like comments, and treat a changes_requested review by a committer as an implicit /author. React on the comment (+1 applied, confused denied) and post a one-line reply when /request-review is rejected. setLabels rollback now only re-adds the removed label when the remove actually deleted one -- re-adding unconditionally would fabricate a label on a PR that had neither S-* label.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3260 +/- ##
============================================
- Coverage 73.86% 73.84% -0.03%
Complexity 943 943
============================================
Files 1193 1193
Lines 108970 108970
Branches 85987 86004 +17
============================================
- Hits 80496 80467 -29
- Misses 25739 25743 +4
- Partials 2735 2760 +25
🚀 New features to boost your workflow:
|
numinnex
approved these changes
May 14, 2026
mmodzelewski
approved these changes
May 14, 2026
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.
A transient 502 on a label DELETE aborted the whole command:
removeLabelIfPresent only swallowed 404, so the rethrow skipped
the paired addLabels and left the PR in a state the lifecycle
hooks never re-enter. A /author placed in a review body never
reached the bot at all -- only issue_comment and
pull_request_target were triggers. And commands gave no visible
feedback, so a rejected one looked identical to one that worked.
Wrap every GitHub API call in withRetry (bounded exponential
backoff over 5xx/429/network errors; 4xx still surfaces
immediately). Add the pull_request_review trigger so review
bodies are parsed like comments, and treat a changes_requested
review by a committer as an implicit /author. React on the
comment (+1 applied, confused denied) and post a one-line reply
when /request-review is rejected.
setLabels rollback now only re-adds the removed label when the
remove actually deleted one -- re-adding unconditionally would
fabricate a label on a PR that had neither S-* label.