> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Jenkins integration

> Connect CodeRabbit to Jenkins to include matching build failures and test results in pull request reviews.

Connect Jenkins once so PR Review and CodeRabbit Agent can read existing build results from your controller.

## Prerequisites

The Jenkins controller must be reachable from CodeRabbit over public HTTPS. The controller URL must not contain embedded credentials and may include a reverse-proxy context path such as `/jenkins`. Local, private, link-local, and metadata-service addresses are rejected.

**Required permissions:** CodeRabbit needs a Jenkins username and API token with read access to jobs, builds, console output, and test reports. CodeRabbit reads existing Jenkins results and does not trigger builds.

## Connect Jenkins

<Steps>
  <Step title="Open Connections">
    Open **Integrations** in the [CodeRabbit app](https://app.coderabbit.ai/integrations?tab=ci-cd), and select **Jenkins**.
  </Step>

  <Step title="Enter the controller details">
    Enter the public HTTPS controller URL and, if needed, an optional job or folder path that narrows the build search.
  </Step>

  <Step title="Add read-only credentials">
    Enter the Jenkins username and API token with the required read access.
  </Step>

  <Step title="Test and save">
    Test the authenticated connection. After the test succeeds, save the connection.
  </Step>
</Steps>

## How it works

1. During PR Review, CodeRabbit checks every active Jenkins connection for builds marked `FAILURE` or `UNSTABLE` whose recorded Git revision exactly equals the pull-request head SHA.
2. CodeRabbit matches the Git plugin's last-built revision or commit IDs in the build change set. It does not infer a match from a branch, pull-request number, or job name.
3. Jenkins enrichment supports pull requests on GitHub, GitLab, and Azure DevOps. Bitbucket is not supported by this integration.
4. Discovery is bounded to 50 jobs, four folder levels, the latest 10 builds per job, and five concurrent requests. An optional job path narrows the search; older, deeper, or broader results may not be discovered.
5. Output is bounded to at most 120,000 bytes of console output and up to 100 failed or regressed JUnit test cases per match.
6. Console text, test error details, and stack traces pass through the secret redactor. Truncated console output carries an explicit limit marker.

## What's next

<CardGroup cols={1}>
  <Card title="CI/CD pipeline analysis" href="/pr-reviews/cicd-pipeline-analysis" icon="workflow" horizontal>
    Learn how CodeRabbit uses pipeline failure output during pull request reviews.
  </Card>

  <Card title="Agent connections" href="/slack-agent/connections" icon="plug" horizontal>
    Learn how workspace connections provide external context to CodeRabbit Agent.
  </Card>
</CardGroup>
