authorgravatar for ethorelli@gmail.comErik Thorelli <ethorelli@gmail.com> 2026-10-06 14:32:03-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-06 14:32:03-07:00
logc9b21b28e2cebc4c9cbd80726e757df36309dea8
tree208b4c48464c6bd230fe8ff3f9307a1238fa0329
parent7bee189dfb5cd6807457e98af0c2f95f5ed50edd
signature Signed by PGP key B5690EEEBB952194

chore(review): CodeRabbit gates outside contributors' pull requests (#16332)


1 files changed, 32 insertions(+), 3 deletions(-)

.coderabbit.config.ts+32-3
......@@ -1,14 +1,43 @@
1import { defineConfig } from "@coderabbitai/config";
1import { defineConfig, type CodeRabbitContext } from "@coderabbitai/config";
22
3export default defineConfig({
3const approvability = `Fail when a maintainer should read this pull request before CodeRabbit approves it, and name the rule and file. Fail if it:
4
5- Changes a product default: a setting's default value, or what users get without opting in. Making a feature do what it already promises is a bug fix, not a default change.
6- Adds or broadens a directive that disables or suppresses a lint, type-checker, LSP, or other static-analysis diagnostic, including file-level, line-level, and configuration-level overrides.
7- Adds a subsystem or user workflow, or is a large refactor across apps or packages.
8- Changes packages/contracts or persisted data in a way that existing clients or stored data might not accept.
9- Changes authentication, pairing, credentials, secrets, or remote connection trust.
10- Adds or changes an external side effect, such as acting on GitHub, publishing a release, or calling a webhook.
11- Adds, upgrades, or patches a dependency.
12- Changes CI or release configuration, agent or contributor instructions, or any review tool's configuration, including .github/, AGENTS.md, CONTRIBUTING.md, .agents/, and .coderabbit.config.ts.
13
14Otherwise pass. A focused bug fix, copy or layout fix, revert, or docs-only or test-only change passes unless a rule above applies. If you cannot decide, fail rather than report inconclusive. When failing, say that the pull request needs a maintainer's review.
15`;
16
17// Org members and collaborators merge their own pull requests. On anyone else's, CodeRabbit
18// requests changes until its comments are resolved and its checks pass, then approves.
19const UNGATED_AUTHORS = new Set(["OWNER", "MEMBER", "COLLABORATOR"]);
20const isGated = ({ pr }: CodeRabbitContext) => !UNGATED_AUTHORS.has(pr?.authorAssociation ?? "");
21
22export default defineConfig((ctx) => ({
423 reviews: {
524 high_level_summary: false,
625 review_status: false,
26 request_changes_workflow: isGated(ctx),
27 allow_author_approval: !isGated(ctx),
728 auto_review: {
829 enabled: true,
930 },
1031 pre_merge_checks: {
1132 docstrings: { mode: "off" },
33 override_requested_reviewers_only: isGated(ctx),
34 custom_checks: [
35 {
36 name: "Approvability",
37 mode: isGated(ctx) ? "error" : "off",
38 instructions: approvability,
39 },
40 ],
1241 },
1342 path_filters: [
1443 // Vendored read-only reference checkouts of upstream Effect and Alchemy
......@@ -34,4 +63,4 @@ export default defineConfig({
3463 ],
3564 },
3665 },
37});
66}));