fix Dependabot review request races#110
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review✅ Merge allowed: 1 finding(s) reported but none are blocking ℹ️ Other Findings1. 🟡 [MEDIUM] Logic in
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d5c95b206
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| gh api --paginate \ | ||
| "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/timeline?per_page=100" | | ||
| jq -sr --arg reviewer "${REVIEWER}" \ | ||
| '[.[][] | select(.event == "review_requested" and .requested_reviewer.login == $reviewer)][-1].actor.login // ""' |
There was a problem hiding this comment.
Honor review-request removals before restoring
If a maintainer requests Pigbibi after the DELETE and then removes that request before the second timeline read, this filter still reports the maintainer as the latest actor because it ignores the later review_request_removed event. The subsequent POST then re-adds a review request the maintainer intentionally cancelled. Check that Pigbibi is currently requested (or account for removal events) before performing the restore.
Useful? React with 👍 / 👎.
What changed
Why
This closes the remaining race between validating a bot-generated review request and deleting it. Human requests are preserved whether they happen before, during, or after the cleanup operation.
Validation