Skip to content

chore: dismiss Dependabot review requests#266

Merged
Pigbibi merged 1 commit into
mainfrom
agent/dismiss-dependabot-review-requests
Jul 20, 2026
Merged

chore: dismiss Dependabot review requests#266
Pigbibi merged 1 commit into
mainfrom
agent/dismiss-dependabot-review-requests

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What changed

  • dismiss Pigbibi review requests automatically generated for Dependabot PRs
  • recognize both dependabot[bot] and app/dependabot identities
  • require the review-request event actor to be Dependabot
  • re-check the latest Pigbibi review-request actor from the PR timeline immediately before deletion
  • preserve later or concurrent review requests made by maintainers
  • keep concurrent review-request runs instead of cancelling the matching cleanup
  • use pull_request_target with metadata-only GitHub API access and no checkout

Why

These repositories already auto-merge eligible non-major Dependabot updates after CI, but CODEOWNERS creates redundant review notifications. Event-actor and timeline checks let the workflow remove only bot-generated requests without touching human review requests, including race conditions while a run is queued.

Validation

  • verified automatic CODEOWNERS timeline actor on a historical Dependabot PR
  • verified both supported Dependabot identities
  • verified requested reviewer, event actor, and latest timeline actor conditions
  • verified API errors fail instead of being treated as no match
  • verified no checkout or execution of PR code
  • bash syntax check
  • git diff --check

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

🤖 Codex PR Review

Merge allowed: 2 finding(s) reported but none are blocking

ℹ️ Other Findings

1. 🟡 [MEDIUM] Reliability in .github/workflows/dependabot_review_request_cleanup.yml

The workflow checks the latest review_requested timeline actor and then unconditionally deletes the reviewer in a separate API call. If a maintainer manually re-requests Pigbibi after the timeline query but before the DELETE executes, this job will still remove that fresh manual request because GitHub only stores the current requested reviewer state, not distinct request instances. This is reachable on pull_request_target because the job runs asynchronously from the original Dependabot-triggered event and there is no atomic compare-and-delete step. (line 46)

Suggestion: Re-read the timeline or requested-reviewer state immediately before deletion and abort if the latest matching review_requested event is no longer from Dependabot, or use a narrower API flow that validates the current request origin as close as possible to the DELETE.

2. 🟡 [MEDIUM] Logic in .github/workflows/dependabot_review_request_cleanup.yml

The timeline query is hard-limited to per_page=100 and does not follow pagination, but the code assumes [-1] is the latest matching request. On a Dependabot PR with more than 100 timeline events, the API will only return the first page, so this can inspect an older review_requested event and make the wrong decision: it may delete a maintainer's later manual request or fail to remove the current automatic one. (line 41)

Suggestion: Paginate through the timeline until the newest page is examined, or request pages in descending order if supported and explicitly select the true latest matching review_requested event before deciding to delete.


Review by Codex PR Review bot • PR

@Pigbibi
Pigbibi force-pushed the agent/dismiss-dependabot-review-requests branch from 27f9c44 to 0b08242 Compare July 20, 2026 05:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b0824267e

ℹ️ 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".

Comment thread .github/workflows/dependabot_review_request_cleanup.yml Outdated
Comment thread .github/workflows/dependabot_review_request_cleanup.yml Outdated
@Pigbibi
Pigbibi force-pushed the agent/dismiss-dependabot-review-requests branch 2 times, most recently from c94db90 to 52b99ad Compare July 20, 2026 06:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52b99adde7

ℹ️ 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".

Comment thread .github/workflows/dependabot_review_request_cleanup.yml Outdated
Comment thread .github/workflows/dependabot_review_request_cleanup.yml
@Pigbibi
Pigbibi force-pushed the agent/dismiss-dependabot-review-requests branch from 52b99ad to 78d65d5 Compare July 20, 2026 06:04
@Pigbibi
Pigbibi enabled auto-merge (squash) July 20, 2026 06:08
@Pigbibi
Pigbibi force-pushed the agent/dismiss-dependabot-review-requests branch from 78d65d5 to dbfb10d Compare July 20, 2026 06:12
Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi
Pigbibi force-pushed the agent/dismiss-dependabot-review-requests branch from dbfb10d to 3de4825 Compare July 20, 2026 06:14
@Pigbibi
Pigbibi merged commit 4c928c0 into main Jul 20, 2026
3 checks passed
@Pigbibi
Pigbibi deleted the agent/dismiss-dependabot-review-requests branch July 20, 2026 06:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3de4825807

ℹ️ 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".

Comment on lines +42 to +44
latest_request_actor="$(gh api \
"repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/timeline?per_page=100" \
--jq '[.[] | select(.event == "review_requested" and .requested_reviewer.login == "Pigbibi")][-1].actor.login // ""')"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Paginate timeline events before choosing the latest request

For a Dependabot PR with more than 100 timeline events, this only inspects the first API page, so [-1] need not be the latest Pigbibi request. If Dependabot made the original request in that page and a maintainer re-requested review later, the job identifies the old Dependabot actor and deletes the currently pending manual request, defeating the preservation check. Fetch all pages (or otherwise query the newest matching event) before deciding to remove it.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant