feat(code-reviewer) config to skip or permit bots - #4765
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryReviewed the bot-PR skip guardrail (config schema, personal/org routers, UI toggle, and webhook handler ordering) and found no correctness, security, or logic issues in the changed lines. Files Reviewed (7 files)
Reviewed by claude-sonnet-5 · Input: 42 · Output: 7.1K · Cached: 1.3M Review guidance: REVIEW.md from base branch |
jeanduplessis
approved these changes
Jul 27, 2026
iscekic
added a commit
that referenced
this pull request
Jul 27, 2026
…ile-audit-w1-pr-safety Both sides appended describe blocks at the end of organization-code-reviews-router.test.ts; kept both (patchReviewConfig + skip bot pull requests). Semantic integration fix: #4765 added skip_bot_pull_requests to the code-reviewer config. The field-merge PATCH handlers (org + personal) neither read nor wrote it, and the jsonb preserve-list covers only the two feature flags — so any mobile PATCH save would silently reset a user's permit-bots setting to the default. Pass the stored value through in both handlers and pin preservation with skip_bot_pull_requests:false seeds in both patch test suites.
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.
Summary
Adds a per-org setting that skips automated (webhook) code reviews for
bot-authored pull requests (Dependabot, Renovate, etc.), on by default. These
high-volume, low-value dependency PRs otherwise consume review compute and post
review comments on every bump. Bots are detected with GitHub's authoritative
user.type === 'Bot', and the skip runs before any review is created, so itapplies to both standard and council reviews. Manual reviews are unaffected.
Changes
packages/db/src/schema-types.ts: addskip_bot_pull_requeststo the codereview config. Absent is treated as
true(skip), so existing orgs startskipping bot PRs on rollout. Enforced on GitHub only; the comment notes GitLab
and Bitbucket webhooks do not expose a bot flag.
apps/web/.../github/webhook-handlers/pull-request-handler.ts: compute thebot-skip decision once (
skip_bot_pull_requests ?? trueANDuser.type === 'Bot'). Gate the merge-commit path (step 4) on it so a bot PR whose head is amerge commit is not re-pointed to a new SHA with a fresh check run. Enforce the
skip after the supersession/cancellation step, so a bot push still cancels any
stale in-flight review and resolves its check run instead of leaving it stuck.
apps/web/src/routers/organizations/organization-code-reviews-router.tsandcode-reviews-router.ts: threadskipBotPullRequeststhrough save and load(default
true) for org and personal configs.apps/web/src/components/code-reviews/ReviewConfigForm.tsx: add a "Skip pullrequests from bots" toggle to Global Settings, shown for GitHub only (hidden on
GitLab, where it would have no effect).
reviewed when the setting is false; non-bot reviewed; a skipped bot PR still
cancels a superseded review and resolves its stale check run; a bot PR with a
merge-commit head takes the skip path, not merge-commit migration) and a router
round-trip (default true, persists false).
Verification
field and toggle, covered by handler integration tests and a router round-trip,
all passing. The automated webhook review flow it gates was validated end to end
in earlier work.
Visual Changes
Adds one toggle to the code review config screen (Global Settings), shown for
GitHub only. Screenshots to be added.
Reviewer Notes
Renovate reviews unless they turn the toggle off. Worth a changelog note.
a bot PR cannot leave a stale/queued check run that blocks the PR. Both are
covered by tests.
flag, so the setting has no effect there and the toggle is hidden on GitLab.