From b0e0536f6fec7168b0e967f1ad2e4ed67f5bc95d Mon Sep 17 00:00:00 2001 From: Hasit Mistry Date: Wed, 17 Jul 2024 08:47:27 -0700 Subject: [PATCH 1/4] Update introduction and CodeRabbit documentation --- docs/faq/faq.md | 40 +++++++++++++------------ docs/integrations/saas-gitlab.md | 6 +++- docs/integrations/self-hosted-gitlab.md | 6 +++- docs/introduction.md | 8 ++--- 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/docs/faq/faq.md b/docs/faq/faq.md index 53096396..79d88d72 100644 --- a/docs/faq/faq.md +++ b/docs/faq/faq.md @@ -4,7 +4,9 @@ sidebar_label: FAQs description: Frequently asked questions about CodeRabbit. --- -#### How accurate is CodeRabbit's review? +## General + +### How accurate is CodeRabbit's review? Early adoption results for CodeRabbit have been highly promising, demonstrating significant accuracy in code reviews. However, it's crucial to understand that @@ -12,25 +14,25 @@ AI is an evolving field, and absolute 100% accuracy can't be guaranteed. Our technology is continuously improving, aiming for the highest possible accuracy in reviews. -#### Which programming languages does CodeRabbit support? +### Which programming languages does CodeRabbit support? CodeRabbit is designed to work with all programming languages. However, the proficiency of our AI models might vary between languages based on their popularity and the public availability of training data. -#### Does CodeRabbit store my code? +### Does CodeRabbit store my code? We do not store your code. The code collected at the time of the review is disposed of as soon as the review is complete. During the review, there is complete data isolation of the code being reviewed, and no one from CodeRabbit or outside has access to the code. -#### Does CodeRabbit use my proprietary code for training language models? +### Does CodeRabbit use my proprietary code for training language models? We train our system only using publicly available datasets. CodeRabbit never uses proprietary code from private repositories for training purposes. -#### Can I switch between different organizations on CodeRabbit? +### Can I switch between different organizations on CodeRabbit? Yes, you can switch between different organizations on CodeRabbit. To do so, click on the organization name in the top-left corner of the CodeRabbit UI. @@ -38,43 +40,43 @@ click on the organization name in the top-left corner of the CodeRabbit UI. ![Switch Organizations](./images/cr_support_orgs_light.png#gh-light-mode-only) ![Switch Organizations](./images/cr_support_orgs_dark.png#gh-dark-mode-only) -#### Can a CodeRabbit subscription be used across multiple organizations? +### Can a CodeRabbit subscription be used across multiple organizations? Subscription seats are tied to the specific GitHub/GitLab organization under which they are purchased and cannot be used under another organization. -#### Can CodeRabbit review my existing PRs after integrating it? +### Can CodeRabbit review my existing PRs after integrating it? CodeRabbit will by default only review new PRs or existing PRs which have a new commit after the app is installed. You can, however, use the `@coderabbitai review` command on the PR to trigger a review for existing PRs. -#### Who can install CodeRabbit on the repositories? +### Who can install CodeRabbit on the repositories? You need to be a GitHub/GitLab admin to add the repositories. -#### Do I need my own OpenAI key with CodeRabbit Pro? +### Do I need my own OpenAI key with CodeRabbit Pro? OpenAI cost is included as part of the subscription. You don't need to have your own OpenAI key. -#### What Large Language Models does CodeRabbit use? +### What Large Language Models does CodeRabbit use? CodeRabbit currently utilizes OpenAI's `gpt-4-turbo` and `gpt-3.5-turbo`. We're researching and testing upcoming LLMs to ensure we're offering the most precise reviews possible. -#### Can I customize CodeRabbit? +### Can I customize CodeRabbit? Reviews are customizable. For information, check out our [Customization](../guides/review-instructions.md) guide. -#### Can I choose a language other than English for the reviews? +### Can I choose a language other than English for the reviews? CodeRabbit supports most widely used languages. You can configure this in the repository settings. -#### What access does CodeRabbit need to my repositories? +### What access does CodeRabbit need to my repositories? CodeRabbit requests minimal access to perform code reviews and post comments on Pull Requests. On GitHub, it requires read access to metadata, code, @@ -82,12 +84,12 @@ discussions, and issues, as well as read/write access to pull requests. On GitLab, it requires read access to the repository, and the CodeRabbit Bot user requires a developer role. -#### How can I add or remove users for my subscription? +### How can I add or remove users for my subscription? To manage users, log in to CodeRabbit and navigate to subscriptions. You can add or remove users as needed. -#### How can I interact with the CodeRabbit bot? +### How can I interact with the CodeRabbit bot? To interact with CodeRabbit's bot, reply to the CodeRabbit Comment. If there are team members collaborating on pull requests, the bot stays silent by default but @@ -95,18 +97,18 @@ can be engaged by tagging **@coderabbitai**. This feature allows you to provide context, generate test cases, or ask for specific code suggestions, all within the context of your code lines or entire files. -#### Can individual developers use CodeRabbit? +### Can individual developers use CodeRabbit? Absolutely! Whether you're an individual developer or part of an organization, CodeRabbit can be your coding assistant, providing you with invaluable suggestions. -#### Which branches are the pull requests reviewed on? +### Which branches are the pull requests reviewed on? CodeRabbit reviews pull requests on the default branch by default. You can change this in the repository settings. -#### CodeRabbit Usage Limits +### CodeRabbit Usage Limits There are hourly rate limits for each developer per repository: @@ -117,7 +119,7 @@ There are hourly rate limits for each developer per repository: In-trial and open-source plans have lower rate limits than the paid plan. In all cases, we re-allow further reviews/conversations after a brief timeout. -#### I can't add CodeRabbit to my GitLab Repositories. What should I do? +### I can't add CodeRabbit to my GitLab Repositories. What should I do? If there are any access restrictions by domain, then you will need to add `coderabbit.ai` as an allowed domain. diff --git a/docs/integrations/saas-gitlab.md b/docs/integrations/saas-gitlab.md index 06a87df5..5ec4614a 100644 --- a/docs/integrations/saas-gitlab.md +++ b/docs/integrations/saas-gitlab.md @@ -7,6 +7,7 @@ sidebar_label: SaaS GitLab This guide will assist you in effectively integrating CodeRabbit with SaaS GitLab. ## How it works + For the CodeRabbit app to post reviews on merge requests, it needs to interact with the GitLab API, which requires a Personal Access Token. This token can be generated either by using our default CodeRabbit user or by creating a Personal Access Token from one of your existing users. The CodeRabbit default user is already set up in GitLab SaaS and will be added to your project when you install the CodeRabbit app. During installation, the necessary webhook for the project will also be created. @@ -21,6 +22,7 @@ Afterward, you will need to reinstall the CodeRabbit app for each project. ::: ## GitLab Access Tokens + To interact with the GitLab API, a **Personal Access Token** is required. This token can either be generated by using our default CodeRabbit user or by creating a **Personal Access Token** from one of your existing users. Upon first login to the application (immediately after the onboarding screen), you will need to choose based on your organization's requirements. @@ -30,11 +32,13 @@ Upon first login to the application (immediately after the onboarding screen), y **We recommend using the default CodeRabbit user** for most organizations as it is pre-configured. However, we understand that some organizations may prefer more control over the user or have restrictions regarding user inclusion within their organization. ### Personal Access Tokens + If your organization opts to use another user within the organization, you can do so by [generating a personal access token](#generating-a-personal-access-token). ![gitlab organization user modal choice](./images/gitlab_organization_user.png) #### Recommendations + * **Create a dedicated user for CodeRabbit** - This ensures the user is exclusively for CodeRabbit, allowing better access control. * **Use "CodeRabbit" as the username** - This makes the user easily recognizable for future reference. * **Use a dedicated email address** - This helps in easy identification and management. @@ -45,7 +49,7 @@ If your organization opts to use another user within the organization, you can d * Personal access tokens have expiration dates. Ensure the expiration date covers the duration of your intended use of the CodeRabbit app. * Code reviews will be attributed to the owner of the personal access token. * If the personal access token expires, you can add a new one via the CodeRabbit UI: - * Navigate to the "GitLab User" page in the sidebar. + * Navigate to the "GitLab User" page in the sidebar. * Click the "Update" button on the displayed card to see the same modal as the initial login. ### Generating a Personal Access Token diff --git a/docs/integrations/self-hosted-gitlab.md b/docs/integrations/self-hosted-gitlab.md index a6a5f552..f5b09aab 100644 --- a/docs/integrations/self-hosted-gitlab.md +++ b/docs/integrations/self-hosted-gitlab.md @@ -31,6 +31,7 @@ If the self-managed GitLab instance is not found, we initiate the onboarding pro ### **Step 3: Onboarding Manual or Automated** #### 1. Automated onboarding + ![Untitled](./images/automated-onboarding.png) #### **Why do we need the Admin Access Token?** @@ -38,7 +39,7 @@ If the self-managed GitLab instance is not found, we initiate the onboarding pro Admin access token is required to set up a new CodeRabbit bot user within your self-managed instance. The token is needed only once during the initial setup process. Once the token is generated, you can set its minimum expiration period. -This is the standard approach used by other products in this category. +This is the standard approach used by other products in this category. This is not automatically installing the CodeRabbit app across all projects. You will add CodeRabbit manually on the projects you wish, as the next step. @@ -49,6 +50,7 @@ For the manual onboarding process we need to create the [CodeRabbit user](#creat ![Untitled](./images/manual-onboarding.png) #### **Creating CodeRabbit user** + This feature will work with any user from your organization, but we strongly suggest creating a dedicated user called **CodeRabbitAI**. This ensures clarify about which user is used for our application and allows for better fine-grained access control. @@ -58,11 +60,13 @@ After the user is created, you can retrieve the **User ID** from that user's pro The access token is used to post reviews on merge requests. #### **Creating OAuth2 application** + For self-managed GitLab, we recommend creating an instance-wide application unless you want the reviews to be limited to a single group or user. Please follow the steps outlined in the [GitLab documentation](https://docs.gitlab.com/ee/integration/oauth_provider.html#create-an-instance-wide-application) for creating the application. Requirements: + 1. Scopes: `api read_user email` 2. Callback URL: `https://app.coderabbit.ai/login` diff --git a/docs/introduction.md b/docs/introduction.md index 6b257519..e30edd07 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -25,8 +25,6 @@ committed. -### How does CodeRabbit work? - **CodeRabbit** integrates into code repositories using GitHub or GitLab webhooks and monitors events related to Pull Request (PR) and Merge Request (MR) changes. A comprehensive review is performed when a PR or MR is created, and for @@ -35,7 +33,7 @@ directly back to the PR or MR. ![CodeRabbit Flow](about/images/CodeRabbitFlow.png) -### Data, Privacy, and Security +## Data, Privacy, and Security **CodeRabbit** does not use data collected during code reviews to train or influence the models. Queries to the Large Language Models (LLMs) are ephemeral @@ -56,7 +54,7 @@ complies with SOC2 Type II and GDPR standards. Opting Out: You can choose to opt out of data storage at any time. Opting out won't affect your access but will limit the personalization of the reviews. -### Do you need CodeRabbit with the AI code generators like GitHub Copilot? +## CodeRabbit with other AI code generators like GitHub Copilot? Code reviews remain essential, whether the code is written by a human or a bot. This is mainly because the perspective of the reviewer differs from that of the @@ -66,7 +64,7 @@ code-generation tools hold immense potential, it's important to recognize that these generators are still in their early stages and may not be equipped to auto-generate meaningful code for moderately complex applications. -### How is CodeRabbit different from existing code review tools? +## CodeRabbit is different from existing code review tools Traditional code review tools excel in linting and static analysis, but they fall short in providing context-aware, conversational feedback with actionable From 9e7d829171fbbf14d91d41c7aae31e22a82a71fe Mon Sep 17 00:00:00 2001 From: Hasit Mistry Date: Wed, 17 Jul 2024 08:59:57 -0700 Subject: [PATCH 2/4] Update FAQ documentation --- docs/faq/faq.md | 78 ++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/docs/faq/faq.md b/docs/faq/faq.md index 79d88d72..3bfae21c 100644 --- a/docs/faq/faq.md +++ b/docs/faq/faq.md @@ -4,9 +4,9 @@ sidebar_label: FAQs description: Frequently asked questions about CodeRabbit. --- -## General +### General -### How accurate is CodeRabbit's review? +#### How accurate is CodeRabbit's review? Early adoption results for CodeRabbit have been highly promising, demonstrating significant accuracy in code reviews. However, it's crucial to understand that @@ -14,25 +14,25 @@ AI is an evolving field, and absolute 100% accuracy can't be guaranteed. Our technology is continuously improving, aiming for the highest possible accuracy in reviews. -### Which programming languages does CodeRabbit support? +#### Which programming languages does CodeRabbit support? -CodeRabbit is designed to work with all programming languages. However, the +CodeRabbit is designed to work with all programming languages. The proficiency of our AI models might vary between languages based on their popularity and the public availability of training data. -### Does CodeRabbit store my code? +#### Does CodeRabbit store my code? -We do not store your code. The code collected at the time of the review is +We do not store your code. The code repository that is cloned at the time of the review is disposed of as soon as the review is complete. During the review, there is complete data isolation of the code being reviewed, and no one from CodeRabbit or outside has access to the code. -### Does CodeRabbit use my proprietary code for training language models? +#### Does CodeRabbit use my proprietary code for training language models? We train our system only using publicly available datasets. CodeRabbit never uses proprietary code from private repositories for training purposes. -### Can I switch between different organizations on CodeRabbit? +#### Can I switch between different organizations on CodeRabbit? Yes, you can switch between different organizations on CodeRabbit. To do so, click on the organization name in the top-left corner of the CodeRabbit UI. @@ -40,43 +40,48 @@ click on the organization name in the top-left corner of the CodeRabbit UI. ![Switch Organizations](./images/cr_support_orgs_light.png#gh-light-mode-only) ![Switch Organizations](./images/cr_support_orgs_dark.png#gh-dark-mode-only) -### Can a CodeRabbit subscription be used across multiple organizations? +#### What Large Language Models does CodeRabbit use? -Subscription seats are tied to the specific GitHub/GitLab organization under -which they are purchased and cannot be used under another organization. +CodeRabbit currently utilizes OpenAI's `gpt-4-turbo` and `gpt-3.5-turbo`. We're +researching and testing upcoming LLMs to ensure we're offering the most precise +reviews possible. -### Can CodeRabbit review my existing PRs after integrating it? +### Subscription -CodeRabbit will by default only review new PRs or existing PRs which have a new -commit after the app is installed. You can, however, use the -`@coderabbitai review` command on the PR to trigger a review for existing PRs. +#### Can a CodeRabbit subscription be used across multiple organizations? -### Who can install CodeRabbit on the repositories? - -You need to be a GitHub/GitLab admin to add the repositories. +Subscription seats are tied to the specific GitHub/GitLab organization under +which they are purchased and cannot be used under another organization. -### Do I need my own OpenAI key with CodeRabbit Pro? +#### Do I need my own OpenAI key with CodeRabbit Pro? OpenAI cost is included as part of the subscription. You don't need to have your own OpenAI key. -### What Large Language Models does CodeRabbit use? +#### How can I add or remove users for my subscription? -CodeRabbit currently utilizes OpenAI's `gpt-4-turbo` and `gpt-3.5-turbo`. We're -researching and testing upcoming LLMs to ensure we're offering the most precise -reviews possible. +To manage users, log in to CodeRabbit and navigate to subscriptions. You can add +or remove users as needed. + +### Usage and Configuration + +#### Can CodeRabbit review my existing PRs after integrating it? + +CodeRabbit will by default only review new PRs or existing PRs which have a new +commit after the app is installed. You can, however, use the +`@coderabbitai review` command on the PR to trigger a review for existing PRs. -### Can I customize CodeRabbit? +#### Can I customize CodeRabbit? Reviews are customizable. For information, check out our [Customization](../guides/review-instructions.md) guide. -### Can I choose a language other than English for the reviews? +#### Can I choose a language other than English for the reviews? CodeRabbit supports most widely used languages. You can configure this in the repository settings. -### What access does CodeRabbit need to my repositories? +#### What access does CodeRabbit need to my repositories? CodeRabbit requests minimal access to perform code reviews and post comments on Pull Requests. On GitHub, it requires read access to metadata, code, @@ -84,12 +89,7 @@ discussions, and issues, as well as read/write access to pull requests. On GitLab, it requires read access to the repository, and the CodeRabbit Bot user requires a developer role. -### How can I add or remove users for my subscription? - -To manage users, log in to CodeRabbit and navigate to subscriptions. You can add -or remove users as needed. - -### How can I interact with the CodeRabbit bot? +#### How can I interact with the CodeRabbit bot? To interact with CodeRabbit's bot, reply to the CodeRabbit Comment. If there are team members collaborating on pull requests, the bot stays silent by default but @@ -97,18 +97,18 @@ can be engaged by tagging **@coderabbitai**. This feature allows you to provide context, generate test cases, or ask for specific code suggestions, all within the context of your code lines or entire files. -### Can individual developers use CodeRabbit? +#### Can individual developers use CodeRabbit? Absolutely! Whether you're an individual developer or part of an organization, CodeRabbit can be your coding assistant, providing you with invaluable suggestions. -### Which branches are the pull requests reviewed on? +#### Which branches are the pull requests reviewed on? CodeRabbit reviews pull requests on the default branch by default. You can change this in the repository settings. -### CodeRabbit Usage Limits +#### CodeRabbit Usage Limits There are hourly rate limits for each developer per repository: @@ -119,7 +119,13 @@ There are hourly rate limits for each developer per repository: In-trial and open-source plans have lower rate limits than the paid plan. In all cases, we re-allow further reviews/conversations after a brief timeout. -### I can't add CodeRabbit to my GitLab Repositories. What should I do? +### Integration + +#### Who can install CodeRabbit on the repositories? + +You need to be an admin of the orgnizaation to add the repositories. + +#### I can't add CodeRabbit to my GitLab Repositories. What should I do? If there are any access restrictions by domain, then you will need to add `coderabbit.ai` as an allowed domain. From a18c559707b56d27811d79e3efe9dc1095c32fb6 Mon Sep 17 00:00:00 2001 From: Hasit Mistry Date: Wed, 17 Jul 2024 09:02:24 -0700 Subject: [PATCH 3/4] Update CodeRabbit documentation and remove reference to GitHub Copilot --- docs/introduction.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/introduction.md b/docs/introduction.md index e30edd07..b2b3064f 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -54,17 +54,17 @@ complies with SOC2 Type II and GDPR standards. Opting Out: You can choose to opt out of data storage at any time. Opting out won't affect your access but will limit the personalization of the reviews. -## CodeRabbit with other AI code generators like GitHub Copilot? +## CodeRabbit with other AI code generators Code reviews remain essential, whether the code is written by a human or a bot. This is mainly because the perspective of the reviewer differs from that of the code generator, whether human or machine. This distinction is precisely why human peer reviews have been effective for so long. While AI-powered -code-generation tools hold immense potential, it's important to recognize that +code-generation like GitHub Copilot hold immense potential, it's important to recognize that these generators are still in their early stages and may not be equipped to auto-generate meaningful code for moderately complex applications. -## CodeRabbit is different from existing code review tools +## CodeRabbit is different Traditional code review tools excel in linting and static analysis, but they fall short in providing context-aware, conversational feedback with actionable From a1684d8322fdf1e924907243df2da6e9892cafe1 Mon Sep 17 00:00:00 2001 From: Hasit Mistry Date: Wed, 17 Jul 2024 09:15:03 -0700 Subject: [PATCH 4/4] Update CodeRabbit documentation and remove reference to GitHub Copilot --- docs/integrations/saas-gitlab.md | 3 +-- docs/introduction.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/integrations/saas-gitlab.md b/docs/integrations/saas-gitlab.md index 5ec4614a..57754da8 100644 --- a/docs/integrations/saas-gitlab.md +++ b/docs/integrations/saas-gitlab.md @@ -16,8 +16,7 @@ If your organization prefers to use an organization user, you can create a new u :::note -Keep in mind that if you want to change the review user, you can either disable the organization user or add a new user via the CodeRabbit UI. However, this will require manually removing the previous user from the projects and associated webhooks. -Afterward, you will need to reinstall the CodeRabbit app for each project. +Keep in mind that if you want to change the review user, you can either disable the organization user or add a new user via the CodeRabbit UI. However, this will require manually removing the previous user from the projects and associated webhooks. Afterward, you will need to reinstall the CodeRabbit app for each project. ::: diff --git a/docs/introduction.md b/docs/introduction.md index b2b3064f..faddaae5 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -60,7 +60,7 @@ Code reviews remain essential, whether the code is written by a human or a bot. This is mainly because the perspective of the reviewer differs from that of the code generator, whether human or machine. This distinction is precisely why human peer reviews have been effective for so long. While AI-powered -code-generation like GitHub Copilot hold immense potential, it's important to recognize that +code-generation tools like GitHub Copilot hold immense potential, it's important to recognize that these generators are still in their early stages and may not be equipped to auto-generate meaningful code for moderately complex applications.