Skip to main content
By default, the highest layer that exists supplies the whole configuration, and anything it leaves out falls to schema defaults. Inheritance lets a layer take the values it doesn’t set from the layers below it. Several other mechanisms also combine configuration, and each one merges values differently.

Turn on inheritance

Open the repository’s settings, go to the General section, and turn on Inheritance. Repository settings take part only while the repository’s Use organization settings toggle is off.
inheritance is a top-level key in both configuration schema V2 and V3. A .coderabbit.config.ts file uses the same key.

When inheritance applies

The inheritance walk runs when any of these is true:
  • The starting layer sets inheritance: true.
  • The starting layer leaves inheritance blank and Use workspace settings as defaults is on.
  • An organization or workspace global override sets inheritance: true. This beats every layer’s own flag. A workspace override’s inheritance value wins over the organization’s. When an organization has Use workspace settings on, its organization overrides are ignored. See Enforce settings.

How the inheritance walk works

The walk follows a fixed order below the starting layer: central configuration, then Repository settings, Organization defaults and workspace settings, then schema defaults. On self-hosted CodeRabbit, YAML_CONFIG takes the place of the web interface layers. CodeRabbit merges each parent it finds. It stops after a parent whose inheritance is false, or blank while Use workspace settings as defaults is off. When a global override sets inheritance: true, the walk doesn’t stop and merges every layer. Missing layers are skipped. In this example the review gets values from the repository file, the central file and Organization defaults. Workspace settings aren’t merged because Organization defaults has inheritance off.

Parents for each starting layer

A parent takes part only when it exists for the repository:
  • Repository settings, while the repository’s Use organization settings toggle is off.
  • Organization defaults, when the organization has saved settings and Use workspace settings is off.
  • Workspace settings, when the organization belongs to a workspace.
On self-hosted CodeRabbit, a repository file can merge central configuration and then YAML_CONFIG, and a central file can merge YAML_CONFIG. Schema defaults fill whatever is still unset after the walk.

Why saved Repository settings can hide organization values

A form save in the web interface stores every value, including defaults you didn’t change and the Inheritance toggle itself. When the walk reaches Repository settings saved this way, every value is already set, so Organization defaults and workspace settings can’t change any single value below them. Only lists still combine. If Inheritance was off when you saved, the walk also stops there. To let organization values through, save Repository settings from the YAML editor view mode, which stores only the values you wrote, or turn on the repository’s Use organization settings toggle. See Settings in the web app.

How values merge

Arrays of objects are matched by the first of these fields they have: path, label, name, id, key, repository. Entries without any of them are matched by their whole content. For path_instructions, every inherited rule whose path the child doesn’t redefine is kept. Directory documents combine as whole documents. For each changed file, documents from the repository root and every enclosing .coderabbit/ directory apply, and the closest document with the same kind and ID replaces the one above it.

Example: merge a repository file with central configuration

The repository file turns on inheritance. The central file leaves inheritance blank, so the walk merges central configuration and stops there.
.coderabbit.yaml in the coderabbit repository

What’s next

Global overrides

Enforce settings on top of every repository and force inheritance everywhere.

Workspace settings

Share a baseline across organizations and fill unset values.

Apply settings to every repository

Combine central configuration and inheritance for an organization-wide baseline.