Skip to content

docs: add and improve GitHub integration guide #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions docs/Future Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@ These are additional capabilities that can also be reviewed in the same PR to ac

### Finishing Touches

Finishing touches are about experience that often take developers time away from what they like doing best - coding. But adding finishing touches is crucial and should follow the ontology and taxonomy. We will start by looking into Docstring and expand to various areas to solve pain points for coders and reviewers.

#### 1. DocString Review

- Automated checks for docstring presence and quality
- AI-powered suggestions for improving documentation
- Resolving Doc-string conflicts in a following PR
Finishing touches are about experience that often take developers time away from what they like doing best - coding. But adding finishing touches is crucial and should follow the ontology and taxonomy. We will start by looking into specefic areas such as documentation of code as an example .

> Disclaimer: any product roadmap features mentioned below are only meant to outline
> our general product direction. This documentation is for informational purposes
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/delete-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ upon selecting **Delete Account**. You can open the dropdowns for more
information.

<div align="center">
![Delete Account](/img/guides/delete_account_light.png#gh-light-mode-only)
![Delete Account](/img/guides/delete_account_dark.png#gh-dark-mode-only)
![How-to-Delete-CodeRabbit-Account](/img/guides/delete_account_light.png#gh-light-mode-only)
![How-to-Delete-CodeRabbit-Account](/img/guides/delete_account_dark.png#gh-dark-mode-only)
</div>

Deletion will only occur once the admin specifically types in "delete" in the
Expand Down
2 changes: 1 addition & 1 deletion docs/platforms/azure-devops.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Integrating CodeRabbit with Azure DevOps
description: Integrate CodeRabbit with Azure DevOps.
description: Learn how to integrate CodeRabbit with Azure DevOps.
sidebar_label: Azure DevOps
sidebar_position: 5
---
Expand Down
114 changes: 114 additions & 0 deletions docs/platforms/github-com.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: Integrating CodeRabbit with GitHub.com
description: Learn how to integrate CodeRabbit and add to your GitHub workflow.
sidebar_label: GitHub.com
sidebar_position: 1
---

This is a step-by-step guide to integrate CodeRabbit with your GitHub repositories.

> **CodeRabbit** is an AI code reviewer designed to ease the challenges of code review, supporting repository maintainers and teams. It not only reviews your PRs but also provides concise summaries, identifies potential issues, and offers insights that might be missed during manual reviews.

## How CodeRabbit Works?

> CodeRabbit integrates with GitHub, automating the code review process from the moment a pull request is created.

It preprocesses the PR content, builds context, leverages Large Language Models for analysis, and then post-processes the AI response before posting the review back to GitHub. This streamlined workflow ensures thorough AI-powered code reviews without manual intervention.

![How CodeRabbit Works](/img/integrations/how-codeRabbit-works.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Image path needs to be updated to match repository structure

The image exists at static/img/integrations/how-codeRabbit-works.png but is referenced as /img/integrations/how-codeRabbit-works.png. The path should be updated to include the static prefix.

  • Update in docs/platforms/github-com.md:
- ![How CodeRabbit Works](/img/integrations/how-codeRabbit-works.png)
+ ![How CodeRabbit Works](/static/img/integrations/how-codeRabbit-works.png)
🔗 Analysis chain

Verify image path structure.

Let's verify if the image path is correct and accessible.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the image exists and verify the correct path structure
fd -t f "how-codeRabbit-works.png" -E "node_modules" && \
echo "Checking references to this image:" && \
rg -l "how-codeRabbit-works.png"

Length of output: 240


## Let's Integrate CodeRabbit with GitHub

### 1. Accessing CodeRabbit

Visit the [Code Rabbit login](https://app.coderabbit.ai/login?free-trial) page. You'll see all the authentication options, select "**Login with GitHub**" to proceed.

![CodeRabbit Login](/img/integrations/login-self-hosted-github.png)

### 2. Authorization

When you choose **Login with GitHub** in step1 , you'll be prompted to authorize CodeRabbit.

> This step grants the necessary permissions for CodeRabbit to interact with your repositories and pull requests.

![Authorization Login](/img/integrations/authorization-codeRabbit.png)

### 3. Selecting Your Organization

Upon Authorization, If you're part of multiple organizations, you'll have the opportunity to choose which one you want to associate with CodeRabbit. This ensures that you're setting up the tool for the correct team or project.

![How to Select Organization in CodeRabbit](/img/integrations/select-organization.png)

### 4. Exploring the CodeRabbit Dashboard

Upon successful authorization, you'll be logged into the CodeRabbit user interface.

Here, you can add repositories and configure CodeRabbit config settings for each repository.

![CodeRabbit Dashboard](/img/integrations/codeRabbit-dashboard.png)

:::tip
If you opt to authorize all repositories during setup, CodeRabbit will automatically include any new repositories you create on GitHub in the future. This saves you the hassle of manual additions down the line.
:::

### 5. CodeRabbit Configuration

You can configure CodeRabbit through a YAML file or using the [App's UI](https://app.coderabbit.ai/login).

You can tailor CodeRabbit's functionality using the coderabbit.yaml file, which you place directly in your GitHub repository. This file mirrors the options available in the CodeRabbit user interface, with each setting in the YAML corresponding to a specific toggle in the UI. Configure CodeRabbit either through the coderabbit.yaml file or the interface, depending on your preference.

:::note
If a coderabbit.yaml file exists in your GitHub repository, it takes precedence over any UI settings. Choose either the YAML file or UI configuration - you don't need to use both. **Refer Coderabbit.yaml schema [here](https://storage.googleapis.com/coderabbit_public_assets/schema.v2.json)**
:::

Once your coderabbit.yaml file is prepared according to your needs, simply place it in your GitHub repository, and you're all set—CodeRabbit is now integrated.

> When a pull request is created targeting the master branch, CodeRabbit automatically initiates its review process. It analyzes the changes and generates a summary and walkthrough of the modifications. The specific feedback and analysis provided by CodeRabbit are determined by the options you've configured in your YAML file.

Let's see a few examples of CodeRabbit's review comments from a specific pull request in one of the projects.

This particular PR involved in changing the language model from LLaMA 2 to LLaMA 3, for testing purposes. These examples will showcase how CodeRabbit analyzed and commented on this significant model switch.

## Sample PR Review Workflow using CodeRabbit

CodeRabbit automatically generates a PR summary highlighting key changes.

![CodeRabbit Summary](/img/integrations/summary-by-codeRabbit.png)

This image shows CodeRabbit's review status for another pull request. It highlights that **12 actionable comments** were generated, and the review also includes additional comments on specific files, demonstrating CodeRabbit's comprehensive analysis of the code changes.

![Actionable Comments By CodeRabbit](/img/integrations/actionable-comments-by-coderabbit.png)

You can also use [CodeRabbit commands](https://docs.coderabbit.ai/guides/commands/) to chat with the AI code Reviewer.

![CodeRabbit Commands](/img/integrations/full-review.png)

CodeRabbit could generate a **code sequence diagram** when you request a full review.

The sequence diagram illustrates the precise flow of interactions between the objects in the system.

![CodeRabbit Sequence Diagram](/img/integrations/coderabbit-sequence-diagram.png)

Also check out the response when i asked for what improvements can be done on the code level

![Code Improvements Suggested by CodeRabbit](/img/integrations/improvements.png)

In addition to providing reviews and summaries, **CodeRabbit** can also detect configuration issues.

> For example, I accidentally set up both CodeRabbit Pro (The process we've been discussing) and the open-source version (Refer to [different config process](https://github.com/coderabbitai/ai-pr-reviewer?tab=readme-ov-file#install-instructions)) in my repository at the same time.

Interestingly, CodeRabbit automatically detects and alerts you about configuration conflicts.

![Configuration Issues by CodeRabbit](/img/integrations/configuration.png)

CodeRabbit generates detailed statistics and test plans for each pull request.

![Statistics by CodeRabbit](/img/integrations/statistics.png)

![Test Plan by CodeRabbit](/img/integrations/test-plan.png)

> CodeRabbit also allows you to configure **custom review instructions** based on your organization's needs, in case you want it to follow specific guidelines beyond the standard review, to learn more on [adding custom review instructions](https://docs.coderabbit.ai/guides/review-instructions/)

Whether you manage a popular repository or are working on a smaller project, whether it's hosted on **GitLab, GitHub, or self-hosted GitHub or GitLab**, CodeRabbit can help streamline your development process. This AI Code Review assistant is designed to save you time by automating code reviews and offering insightful feedback.

> Explore, Experiment, Discover how [CodeRabbit](https://docs.coderabbit.ai/) can streamline your code review process using AI.
4 changes: 2 additions & 2 deletions docs/platforms/github-enterprise-server.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: CodeRabbit for GitHub Enterprise Server
description: Integrate CodeRabbit with your GitHub Enterprise Server.
title: Integrating CodeRabbit with GitHub Enterprise Server
description: Learn how to integrate CodeRabbit with your GitHub Enterprise Server.
sidebar_label: GitHub Enterprise Server
sidebar_position: 3
---
Expand Down
2 changes: 1 addition & 1 deletion docs/platforms/gitlab-com.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Integrating CodeRabbit with GitLab.com
description: Integrate CodeRabbit with GitLab.com
description: Learn how to integrate CodeRabbit and add to your GitLab workflow.
sidebar_label: GitLab.com
sidebar_position: 2
---
Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/self-hosted-gitlab.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: CodeRabbit for Self-Managed GitLab
description: Integrate CodeRabbit with your Self-Managed GitLab instance.
title: Integrating CodeRabbit with Self-Managed GitLab
description: Learn how to integrate CodeRabbit with your Self-Managed GitLab instance.
sidebar_label: Self-Managed GitLab
sidebar_position: 4
---
Expand Down
Binary file added static/img/integrations/abandoned-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/integrations/codeRabbit-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/integrations/configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/integrations/full-review.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/integrations/how-codeRabbit-works.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/integrations/improvements.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/integrations/select-organization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/integrations/statistics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/integrations/test-plan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.