Skip to content

ci(coderabbit-config): refresh the vendored CodeRabbit schema - #438

Open
cloud-code-bot[bot] wants to merge 2 commits into
mainfrom
ci/refresh-coderabbit-schema
Open

cloud-code-bot[bot] wants to merge 2 commits into
mainfrom
ci/refresh-coderabbit-schema

Conversation

@cloud-code-bot

@cloud-code-bot cloud-code-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

This updates our copy of CodeRabbit's settings rulebook to the latest version, which adds new auto-approval settings. The new rules opened a loophole: a config stuffed with many repeated entries could hide a real, file-breaking mistake, so the check would pass a config CodeRabbit refuses to load. This PR also closes that loophole.

Upstream's CodeRabbit config schema has drifted from the copy vendored here, which is what coderabbit-config-validate.yml grades every enrolled repo against.

Added properties (12):

  • reviews.auto_approvals
  • reviews.auto_approvals.allow_author_approval
  • reviews.auto_approvals.enabled
  • reviews.auto_approvals.max_merge_risk
  • reviews.auto_approvals.max_security_risk
  • reviews.auto_approvals.overrides
  • reviews.auto_approvals.overrides[].enabled
  • reviews.auto_approvals.overrides[].max_merge_risk
  • reviews.auto_approvals.overrides[].max_security_risk
  • reviews.auto_approvals.overrides[].paths
  • reviews.auto_approvals.overrides[].teams
  • reviews.review_info

Before merging, check the tightened-cap section above if there is one: a lowered maxLength retroactively invalidates configs nobody has touched, and merging this makes their next PR red. Landing the cleanup alongside is usually the right order.

Note

The invariant unit suite failed against this schema, and the checker has been adapted in this PR. The new reviews.auto_approvals.overrides is an array of closed objects with no maxItems. That broke the premise the suite pinned: the checker's pre-rank islice over iter_errors is FIFO in schema order, so ~150 overrides each carrying an unknown key could push a file-rejecting maxLength error out of the slice. The result was 100 warnings and exit 0 on a config CodeRabbit rejects whole. This was reproduced against the refreshed schema. Now, when the cap is hit, the checker re-collects rejecting errors from a second, equally bounded pass over a copy of the schema that has the strip-only additionalProperties: false removed (outside combinators). The census moved on purpose: explicit went 5 → 7, and both new objects are closed with additionalProperties: false, which is now asserted per member, so no new opener keyword was added. overrides is named as the one array exempt from the maxItems-before-items fact, and every other array still has to satisfy it. The README and checker comments now give the schema's current object counts (seven explicitly closed, 105 by omission).

Merging this touches .github/coderabbit-config/**, which triggers bump-coderabbit-config-callers.yml and rolls the SHA-pinned caller fleet forward.

Opened by the refresh-coderabbit-schema workflow.

Provenance

Verified:

  • unittest suite for .github/coderabbit-config (pinned requirements, --require-hashes): 101 tests pass at the current head.
  • New regression test fails with the second pass disabled and passes with it enabled.
  • CLI end-to-end: 150 overrides with unknown keys plus an over-long path_instructions entry now exit 1; before the fix this exited 0.
  • check_workflow_pins.py, check_agents_md.py --root . and check-org-repo-literals.sh all exit 0.

Deviations:

  • Beyond the automated schema refresh, this PR now also changes check_coderabbit_config.py (the rejecting-only second pass), its tests, and README counts.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 1a49b98f-6dfe-45bf-9d57-67293a708d20

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@cloud-code-bot
cloud-code-bot Bot force-pushed the ci/refresh-coderabbit-schema branch from b3aa428 to 4ea2b54 Compare October 26, 2026 15:30
…uld drop

The refreshed schema adds `reviews.auto_approvals.overrides`, an array of
closed objects with no `maxItems`. That breaks the premise the invariant
suite pinned: `islice(iter_errors(...), MAX_FINDINGS + 1)` is FIFO in schema
order, so 150 overrides each carrying one unknown key fill the slice with
stripped errors before a `maxLength` violation in a later property is ever
emitted -- 100 warnings and exit 0 on a config CodeRabbit rejects whole.
Reproduced against the vendored schema before this change.

When the cap is hit, the rejecting errors are now re-collected from a second,
equally bounded pass over a copy of the schema with the strip-only
`additionalProperties: false` / `unevaluatedProperties: false` removed
(outside combinators, where opening a branch would change what it accepts),
and replace whatever subset of them the first pass kept. `_apply_cap` then
ranks them ahead of the warnings as before.

Tests: a regression case that fails without the second pass, a unit case for
the schema rewrite, and the census updated deliberately -- `explicit` 5 -> 7
(both new objects closed with `additionalProperties: false`, now asserted per
member, so no new opener keyword), and the maxItems-before-items fact keeps
holding for every other array, with `overrides` named as the one exception
rather than dropped. The five/103 counts in the checker, tests and README
follow the schema (seven/105).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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