Skip to main content
| Failing CI checks stall a pull request and often send you digging through job logs to find what broke. When CI fails on a PR, you can ask CodeRabbit to investigate the failing checks and fix them for you. It reads the failing checks and their output, works through the fix in a sandbox, and opens a stacked pull request by default. You can instead request a direct commit to the current branch.

Platform support

Fix CI failures is available on GitHub, GitLab Cloud, and Azure DevOps.

GitHub

GitHub Cloud and GitHub Enterprise Server (self-hosted).

GitLab Cloud

Use merge request comment commands to create a stacked merge request or commit fixes directly.

Azure DevOps

Use pull request comment commands to create a stacked pull request or commit fixes directly.

Usage

On GitHub, GitLab Cloud, or Azure DevOps, start Fix CI by commenting on a pull request or merge request that has failing CI checks. Choose where the fixes land:
  • Stacked pull request: @coderabbitai fix-ci opens a pull request containing the generated fixes, targeting the current pull request branch.
  • Direct commit: @coderabbitai fix-ci commit commits the generated fixes directly to the pull request branch.
See the Command reference for the exact syntax. Both delivery modes run the same investigation and generation flow. Only the destination for the generated fixes changes. You can also ask CodeRabbit to fix CI in natural language. CodeRabbit opens a stacked pull request by default; if you explicitly ask it to commit directly, commit to the current branch, or avoid a stacked pull request, it uses the direct-commit path instead.

How it works

1

Trigger

Comment @coderabbitai fix-ci for a stacked pull request or @coderabbitai fix-ci commit for a direct commit. CodeRabbit collects the checks reported as failing on the PR’s head commit. On GitLab Cloud, these are the failed jobs in the merge request’s latest pipeline for that commit.
2

Investigate

CodeRabbit clones the repository into a sandbox and gathers context for the failing checks: the available failure output and the relevant CI configuration for the jobs that ran. This tells the agent what failed and how each job is invoked, rather than guessing from the check name alone.
3

Fix

A coding agent works directly in the repository, reading files and editing code to address the failures. It focuses on the code under test: infrastructure and configuration files (CI and build config, lock files, and other dependency manifests) are left out of the change and surfaced separately so you can apply them yourself if they are genuinely needed.
4

Deliver

CodeRabbit either opens a stacked pull request targeting the current branch or commits the fix directly to that branch, based on the command. The status comment lists the failing checks it addressed and the files it changed.
Your project’s real CI runs against the resulting commit or stacked pull request. That run is the source of truth for whether the failures are actually resolved.

Re-running the fix

Re-running Fix CI behaves like a retry, and where the changes land depends on which pull request you trigger it from:
  • Stacked pull request: Use @coderabbitai fix-ci on the original pull request to open a separate pull request for the current failures.
  • Direct commit: Use @coderabbitai fix-ci commit to add the next fix to the current pull request branch.
  • Retry on a CodeRabbit-created stacked pull request: CodeRabbit commits the next fix directly to that pull request instead of creating an endlessly growing stack.

Scope and limitations

  • Delivery options depend on repository access. Direct commit requires permission to write to the pull request branch. Stacked delivery requires permission to create a branch and pull request.
  • Target-branch CI filters can affect stacked pull requests. If your CI only runs on pull requests targeting specific branches (for example main), it may not run on the stacked pull request itself. Merge the stacked pull request into your branch so CI validates on the original pull request.
  • Infrastructure and dependency files are not committed. Changes the agent makes to CI/build config, lock files, or other dependency manifests are excluded from the delivered changes and listed in the status comment so you can apply them manually.
  • GitHub workflow files are excluded. CodeRabbit cannot commit changes under .github/workflows/. If a fix requires editing a workflow file, it is surfaced in the status comment for you to apply.

Command reference

Investigates failing CI checks and delivers the fixes as a stacked pull request or a commit.
suffix
Commits the fixes to the current branch instead of opening a stacked pull request.
Commit the fixes to the current branch
  • commit works with every spelling, for example @coderabbitai fix ci commit.

Configuration

To turn off Fix CI failures, set the following in your .coderabbit.yaml:

Troubleshooting

Check the plan, platform, and setting requirements in the Command reference. On GitLab, Fix CI works on GitLab Cloud only; self-managed GitLab isn’t supported. If the command is turned off for the repository, see Configuration.
Infrastructure, CI/build config, and dependency files are intentionally left out of direct commits and stacked pull requests. If the only changes the agent produced were out of scope, no fix commit or pull request is created; the status comment lists the files it touched so you can apply them manually.
The stacked pull request runs your real CI, which may surface remaining or new failures. Trigger Fix CI on the stacked pull request to have CodeRabbit commit another fix directly to it, or use @coderabbitai fix-ci on your original pull request to open a fresh stacked pull request. You can also resolve the remaining failures manually.

What’s next

Finishing Touches overview

See all available finishing touches and how to trigger them from any PR

Fix comments

Automatically implement fixes for unresolved CodeRabbit review findings

Resolve merge conflicts

Let CodeRabbit analyze the intent behind conflicting changes and commit a clean resolution to your branch