Repository navigation
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
501 lines (470 loc) · 22.2 KB
/
Copy path.coderabbit.yaml
File metadata and controls
501 lines (470 loc) · 22.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# CodeRabbit configuration — see https://docs.coderabbit.ai/reference/configuration
#
# Until this file existed, every review footer read "Configuration used: Repository UI" —
# the whole review configuration lived in the CodeRabbit dashboard, unversioned and
# unreviewable. The baseline here is the resolved configuration CodeRabbit itself emitted
# via `@coderabbitai generate configuration`, so it is what was already running rather
# than a hand-written guess. Three things are then deliberately different from that
# baseline: the docstring-coverage pre-merge check is off, `path_instructions` encode the
# repo rules a generic reviewer keeps getting wrong, and `path_filters` no longer hide
# `en-US.json`. See the comments at each of those keys.
#
# `inheritance: false` means every value is defined here; nothing is inherited from
# organisation-level settings. Keep it that way so the repo stays the source of truth.
language: en-US
# Max 250 characters — the schema enforces it.
tone_instructions: |
Oxfmt and Oxlint own formatting, import order and quote style; never comment on them.
No docstring or JSDoc requests. One well-evidenced comment beats three speculative
ones: if you cannot point at the line that breaks, say so or stay quiet.
early_access: true
enable_free_tier: true
inheritance: false
reviews:
profile: assertive
request_changes_workflow: false
high_level_summary: false
high_level_summary_instructions: ""
high_level_summary_placeholder: "@coderabbitai summary"
high_level_summary_in_walkthrough: false
auto_title_placeholder: "@coderabbitai"
auto_title_instructions: ""
# On: this is the "review skipped" notice. With incremental review enabled,
# `auto_pause_after_reviewed_commits` actually fires, and with this off a paused
# review looks exactly like a clean one — silence must never stand in for a pass.
review_status: true
review_details: false
review_progress: true
commit_status: true
fail_commit_status: false
collapse_walkthrough: false
changed_files_summary: false
sequence_diagrams: false
estimate_code_review_effort: false
assess_linked_issues: false
related_issues: false
related_prs: false
suggested_labels: false
labeling_instructions: []
mutually_exclusive_groups: {}
auto_apply_labels: false
suggested_reviewers: false
auto_assign_reviewers: false
suggested_reviewers_instructions: []
in_progress_fortune: true
poem: false
enable_prompt_for_ai_agents: true
path_filters:
# Every entry here must stay an exclusion (`!`). One positive pattern turns the whole list into an allowlist: CodeRabbit reviews only what a positive pattern matches and reports everything else as "excluded by none and included by none". That is what the two `en-US.json` re-inclusions did between #8778 and this change — every review on `main` silently shrank to those two files (see #8850, "Review skipped due to path filters", 67 files dropped). `coderabbit config validate` does **not** catch this: the config was schema-valid throughout. The path-filter guard in `.github/workflows/coderabbit-config-validation.yml` is what fails the build now; it also fails when an exclusion no longer matches any tracked file, so a filter left behind by a move cannot go stale silently.
#
# The survey runtime's locale files are machine-generated by Lingo.dev; en-US.json is hand-written and IS reviewed. Because re-inclusion is what broke this, the exclusions are written so they never match en-US.json in the first place, rather than relying on a precedence rule between an exclusion and a later re-inclusion — the previous comment here asserted "later patterns win", and that assertion is unverified. apps/web/locales/ is deliberately not excluded: its ja-JP and zh catalogues are written by hand in the commits that add their keys, not generated, so they get reviewed like any other copy.
#
# `!(en-US)` is standard glob negation (minimatch/picomatch both honour it). If a
# future CodeRabbit matcher does not, these patterns match nothing and the generated
# locale files come back into reviews as noise — visible and harmless, unlike an
# allowlist. The fix then is to enumerate the generated locales explicitly.
- "!packages/surveys/locales/!(en-US).json"
- "!**/i18n.lock"
# Generated artefacts. The mailer's locales are a copy of the `emails` namespace of apps/web/locales/, rewritten by `go test ./internal/platform/mailer -run TestCatalogueMatchesWebLocales -update` and checked against it by the same test, so the change is reviewed in apps/web/locales/.
- "!apps/server/internal/platform/mailer/locales/**"
- "!apps/server/internal/jsonschema/schemas/**"
- "!apps/web/src/routeTree.gen.ts"
path_instructions:
- path: "**/*.tsx"
instructions: |
- Server data goes through TanStack Query (`queryOptions` factories, prefetched by route
loaders). Flag it being mirrored into `useState` or another store.
- Component props must be `Readonly<>` (e.g. `({ children }: Readonly<Props>)`).
- All user-facing strings must go through `t()` from `react-i18next` with lowercase
dot-nested keys, never hardcoded text.
- Dates and times must use the shared formatting helpers, never ad-hoc `date-fns`, `Intl`,
or `toLocale*` calls, and never an implicit/`undefined` locale.
- Don't ask for `useMemo`/`useCallback` unless there is a measured re-render problem.
- Do scrutinise effects and closures. The root `vite.config.ts` keeps Oxlint's React Compiler
rules (`purity`, `set-state-in-effect`, `immutability`) and `exhaustive-deps` at `warn`, so
none of them can fail CI. Flag state set from an effect without a guard, missing or lying
dependency arrays, stale closures over props or state, and effects that need cleanup and
don't have it.
- path: "**/*.test.ts"
instructions: |
Judge tests by confidence, not coverage (AGENTS.md "Testing"):
- Assert on inputs and outputs. Flag tests that lock implementation details, markup, or
snapshots, and tests that cannot fail (no meaningful assertion, everything mocked).
- Do not request extra tests purely to raise coverage.
- Network and storage boundaries should be mocked via helpers from `@forma/*` and
mocks placed in a `__mocks__` directory.
- path: "apps/server/**/*.go"
instructions: |
Go server (AGENTS.md "Go conventions" and "API contracts").
- Multi-tenant product: every query is scoped by the caller's organization or workspace. An
unscoped `WHERE`, or a row fetched by id alone, is a cross-tenant data leak, not style.
- Authorization is checked once, in the service layer, through the SpiceDB-backed `authz`
package. A handler or repository that decides access itself is a finding.
- The client API (`/api/v1/client/*`, `/api/v2/client/*`), `/js/*`, v3, MCP and webhook or
OAuth callback paths are frozen external contracts: flag any change to a path, status code,
field or default that is not mirrored in a contract test and the PR's breaking-change table.
- v3 handlers return RFC 9457 problems. Return 403, not 404, for a resource the caller may not see.
- Errors are wrapped with context and logged once, where handled. Never log secrets, tokens,
request bodies, or raw URL paths that can carry a token.
- Flag defensive error handling around internal calls; validation belongs at the boundary.
- path: "apps/server/migrations/*.sql"
instructions: |
Goose migrations, applied in order against a live multi-tenant PostgreSQL 18.
- A shipped migration is never edited; changes come as a new numbered file with `Up` and `Down`.
- Tenant-owned tables carry a workspace or organization column, and foreign keys between
tenant-owned tables include it, so the database enforces that both rows share a tenant.
- A table that carries authorization data needs an `authz_projection_outbox` trigger.
- `CREATE INDEX` on an existing large table uses `CONCURRENTLY` (outside a transaction); a
plain one takes a write lock for its duration. Flag indexes whose leading columns are
already served by another index or unique constraint.
- A new `NOT NULL` column has a default or a backfill first; drops and renames are breaking.
- Closed value sets are `text` with a `CHECK`, not PostgreSQL enums.
- path: ".github/{workflows,actions}/**"
instructions: |
- `GITHUB_TOKEN` needs an explicit minimal `permissions:` block.
- On `ubuntu-latest`, `step-security/harden-runner` must be the first step.
- Third-party actions should be pinned to a commit SHA, not a tag.
- Flag anything that interpolates untrusted input (PR title, body, branch name) directly
into a `run:` block, and any workflow that exposes secrets to `pull_request_target`.
- path: "packages/{surveys,js-core,survey-ui}/**"
instructions: |
Ships to end users' websites as an embedded bundle. Be strict about added dependencies and
bundle size, browser compatibility, and anything that leaks respondent data. No Node-only
APIs. Public SDK signatures are a compatibility contract — changes are breaking.
abort_on_close: true
disable_cache: false
slop_detection:
enabled: true
auto_review:
enabled: true
description_keyword: ""
# On, so the commits that fix a review round get reviewed too — with it off,
# `auto_pause_after_reviewed_commits` below was dead config and someone had to
# remember to type `@coderabbitai review`. The pause caps the volume at five
# reviewed commits since the last pause.
auto_incremental_review: true
auto_pause_after_reviewed_commits: 5
ignore_title_keywords: []
labels: []
drafts: false
# Regex, not globs. The dashboard held `epic/*`, which as a regex is "epic"
# followed by zero or more slashes, unanchored — it also matched branches
# merely containing "epic", such as `feat/epicenter-cleanup`. The default
# branch is always reviewed regardless of this list.
base_branches:
- "^epic/"
ignore_usernames: []
finishing_touches:
docstrings:
enabled: false
unit_tests:
enabled: false
simplify:
enabled: false
# Off: both let the reviewer author commits on the branch — autofix through the
# one-click checkboxes under each review comment, not just the chat command. With
# incremental review on it would then review its own work, so that commit gets no
# independent reviewer. Reviewers here are read-only on the code; the human who
# merges owns the diff. Same reasoning as `chat.allow_non_org_members: false`.
autofix:
enabled: false
fix_ci:
enabled: false
# Kept: mechanical, and the resolution is visible in the diff like any other change.
resolve_merge_conflict:
enabled: true
custom: []
pre_merge_checks:
override_requested_reviewers_only: false
# Off, not lowered. The detector is unreliable here — it reports "No functions found in the
# changed files" on PRs that plainly add functions — and the repo does not require docstrings,
# so every result was ignored. Quoted because unquoted `off` is a boolean in YAML 1.1.
docstrings:
mode: "off"
threshold: 80
title:
mode: warning
requirements: |
Conventional Commits: `type(optional-scope): summary`, where type is one of feat, fix,
chore, docs, refactor, perf, test, build, ci, style, or revert. The summary must describe
what the change does, in lower case, without a trailing period. A Linear ticket reference
such as `(ENG-<id>)` or `[ENG-<id>]` may be appended.
description:
mode: warning
issue_assessment:
mode: warning
# `pr-label-sync.yml` reads the checkbox in the Breaking changes section; these check whether
# what the author ticked is true of the diff, and whether the PR's own QA covers every behaviour
# it changes. Both are advisory — nothing here blocks a merge.
custom_checks:
- name: Breaking changes match the diff
mode: warning
instructions: |
Compare the checkbox in the PR description's "## Breaking changes" section against the
actual diff. A ticked box (`- [x] This PR contains breaking changes`) is the author's
declaration that the PR has one; an unticked box declares that it has none. The prose or
table under the checkbox is the explanation and does not change the declaration.
Treat a change as breaking if the diff does any of the following:
- Renames, removes, or retypes a field in an API request or response shape, requires a
field that was optional, or changes an emitted value (for example `EN` becoming
`en-US`).
- Removes or renames an endpoint or route, changes a webhook payload, or changes the
HTTP status code returned for an existing request/response case.
- Changes a default value, or removes or renames an environment variable or config key —
including the variables in `.env.example` read by `apps/server/internal/platform/config`. Adding one counts
only when it is required, or has no default that keeps existing installs working.
- Adds a database migration that needs manual action, drops or renames a column or
table, or adds a NOT NULL column with no default and no backfill.
- Changes an exported signature of the public SDK surface in `packages/js-core`,
`packages/survey-ui`, or `packages/surveys`.
Nothing else is breaking. In particular, a purely additive change — a new optional request
or response field, a new endpoint or route, an env var whose default keeps existing installs
working — is not, and neither is any change to code no external consumer reaches: internal
functions, modules, types, and workspace-package exports other than the SDK surface above,
however they change. "Internal API" means internal to this repo, and it is outside this
check. A change that matches one of the bullets above is breaking regardless of how
confident the author is; genuine uncertainty about which bullet applies is what the
inconclusive case below is for.
FAIL if the diff contains at least one of the above and the checkbox is unticked, or the
section is empty or still holds the unedited template comment. Name the specific file and
line that is breaking, and ask the author to tick the box.
FAIL if the checkbox is ticked but no change in the diff matches the list above.
PASS if the checkbox is ticked and the section documents each breaking change present in
the diff, in a table or in prose, or if the checkbox is unticked and the diff contains
none of the above — however the author words the explanation underneath.
Return inconclusive rather than failing when the diff alone does not let you determine
an API response shape — for example when the shape comes from a serializer or type that
this PR does not touch.
- name: Only the ticket line carries a magic word
mode: warning
instructions: |
Linear and GitHub scan the whole PR description for a closing keyword next to an issue
id, so a second one in prose silently links — and on merge closes — an unrelated ticket.
FAIL if a magic word (`Fixes`, `Closes`, `Resolves`, `Ref`) sits next to a ticket id
(`ENG-<number>`) or a GitHub issue reference (`#<number>`) anywhere in the description
other than the ticket line at the top. Inline code and code fences do not exempt it —
the scanners read the raw body. Quote the offending text and suggest rewriting the id as
`ENG-…` or dropping the magic word.
PASS if the only such pair is the ticket line at the top of the description.
- name: Coverage accounts for the whole diff
mode: warning
instructions: |
Check the PR description's "## How this was tested" section. It holds all QA for the
change — there is no separate release QA pass — so it must account for every behaviour
the diff changes.
FAIL if any of the following is true:
- The "Coverage" table is empty, or holds only the unedited template placeholder row.
- A behaviour the diff changes has neither a row in "Coverage" nor an entry under
"Open gaps".
- A row names a behaviour with no verification method, or a method with no observed
outcome.
- A `unit` or `e2e` row names no test or spec. The name may sit in the row or in the
`Rerun:` line above the table, which carries it once for every row — but a bare suite
command such as `pnpm test` names nothing, so those rows name their own. A `manual` row
has no test to name and passes without one.
- A row claims `red on main` and gives nothing to rerun: neither the `Rerun:` line nor a
command of its own where that differs.
- A row claims `mutation` and does not name the mutated `file:line` a reviewer would edit
to turn it red.
- The diff changes rendered UI and the description attaches no screenshot or screencast.
- The "Open gaps" subsection is absent. An explicit "none" passes.
Content inside a `<details>` fold counts as present. The template caps the description at
350 words outside folds and folds the overflow rather than dropping it — long media,
command logs, and Coverage rows past the sixth — while the Coverage table, Open gaps and
Breaking changes stay visible themselves. A collapsed fold is evidence, not a gap: do not
ask for a longer description, ask for the missing behaviour.
PASS if every behaviour the diff changes is either covered by a row stating how it was
verified and what was observed, or listed under "Open gaps" with a reason.
PASS also when the PR changes no product behaviour — for example it only touches CI
configuration, repository tooling, tests, or documentation — and the section says so
explicitly rather than being left empty.
post_merge_actions: []
tools:
ast-grep:
rule_dirs: []
util_dirs: []
essential_rules: true
packages: []
shellcheck:
enabled: true
ruff:
enabled: true
markdownlint:
enabled: true
github-checks:
enabled: true
timeout_ms: 90000
languagetool:
enabled: true
enabled_rules: []
disabled_rules: []
enabled_categories: []
disabled_categories: []
enabled_only: false
level: default
biome:
enabled: true
hadolint:
enabled: true
swiftlint:
enabled: true
phpstan:
enabled: true
level: default
phpmd:
enabled: true
phpcs:
enabled: true
golangci-lint:
enabled: true
yamllint:
enabled: true
gitleaks:
enabled: true
trufflehog:
enabled: true
checkov:
enabled: true
tflint:
enabled: true
detekt:
enabled: true
eslint:
enabled: false
e18e:
enabled: true
flake8:
enabled: true
fbinfer:
enabled: true
enable_java: false
fortitudeLint:
enabled: true
rubocop:
enabled: true
buf:
enabled: true
regal:
enabled: true
actionlint:
enabled: true
zizmor:
enabled: true
pmd:
enabled: true
clang:
enabled: true
cppcheck:
enabled: true
opengrep:
enabled: true
semgrep:
enabled: true
circleci:
enabled: true
clippy:
enabled: true
sqlfluff:
enabled: true
squawk:
enabled: true
trivy:
enabled: true
prismaLint:
enabled: false
pylint:
enabled: true
oxc:
enabled: true
shopifyThemeCheck:
enabled: true
luacheck:
enabled: true
brakeman:
enabled: true
dotenvLint:
enabled: true
htmlhint:
enabled: true
stylelint:
enabled: true
checkmake:
enabled: true
osvScanner:
enabled: true
oasdiff:
enabled: true
reactDoctor:
enabled: true
presidio:
enabled: true
blinter:
enabled: true
smartyLint:
enabled: true
emberTemplateLint:
enabled: true
skillspector:
enabled: true
psscriptanalyzer:
enabled: true
chat:
art: true
# Public repo: only org members may drive the bot with commands. Outside PRs are
# still reviewed automatically — this only stops non-members invoking
# `@coderabbitai` at all. The autofix and fix_ci write recipes are off above, so
# this is defence in depth rather than the thing keeping them out of reach.
allow_non_org_members: false
auto_reply: true
integrations:
jira:
usage: auto
linear:
usage: auto
knowledge_base:
opt_out: false
web_search:
enabled: true
code_guidelines:
enabled: true
filePatterns: []
learnings:
scope: auto
# Not 0. A learning is a durable review rule, and at 0 it applies immediately —
# unversioned, unreviewed, and settable by anyone who replies to the bot. That is
# the same failure this file exists to end. Seven days give an admin time to reject
# one. `scope: auto` resolves to local on a public repo, so it stays in this repo.
approval_delay: 7
issues:
scope: auto
jira:
usage: auto
project_keys: []
excluded_project_keys: []
linear:
usage: auto
team_keys: []
pull_requests:
scope: auto
mcp:
usage: auto
disabled_servers: []
automatic_repository_linking: false
linked_repositories: []
code_generation:
docstrings:
language: en-US
path_instructions: []
unit_tests:
path_instructions: []
issue_enrichment:
auto_enrich:
enabled: false
planning:
enabled: true
auto_planning:
enabled: true
labels: []
labeling:
labeling_instructions: []
auto_apply_labels: false