-
Notifications
You must be signed in to change notification settings - Fork 30
Add self-hosted section and update category positions #110
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
Merged
+396
−7
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
de84614
add self-hosted section and update category positions
hasit cde464d
Refactor Docker image pull command to use a placeholder for the Docke…
hasit 3c65700
Merge branch 'main' into hasit/self-host
hasit b01f776
Merge branch 'main' into hasit/self-host
hasit c7dae70
Refactor webhook URLs in self-hosted documentation
hasit f284368
Refactor webhook URLs in self-hosted documentation
hasit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
label: Guides | ||
position: 6 | ||
position: 7 | ||
collapsible: true | ||
collapsed: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
label: Integrations | ||
position: 7 | ||
position: 8 | ||
collapsible: true | ||
collapsed: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
label: Supported Git Platforms | ||
position: 5 | ||
position: 6 | ||
collapsible: true | ||
collapsed: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
label: Self-Hosted CodeRabbit | ||
position: 3 | ||
collapsible: true | ||
collapsed: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
--- | ||
title: Use Self-Hosted CodeRabbit With Azure DevOps | ||
sidebar_label: Azure DevOps | ||
description: Instructions to self-host CodeRabbit and integrate it with Azure DevOps. | ||
sidebar_position: 3 | ||
--- | ||
|
||
## Create a Azure DevOps User | ||
|
||
* **Username**: Set the username to "CodeRabbit" for easier identification (optional). | ||
* **Profile Image**: Use the CodeRabbitAI logo for the user image (optional). | ||
|
||
## Add User to Projects | ||
|
||
Add the CodeRabbit user to each project where you want CodeRabbit to post reviews, with rights to post reviews & open PRs. | ||
|
||
## Create a Personal Access Token for CodeRabbit user | ||
|
||
Generate a personal access token for the CodeRabbit user to be added in the `.env` file as `AZURE_DEVOPS_BOT_TOKEN`. | ||
|
||
**Necessary Scopes**: | ||
|
||
* `Code` - Full | ||
* `Work Items` - Read, write, and manage | ||
|
||
Consult official CodeRabbitAI documentation for a detailed [guide](https://docs.coderabbit.ai/platforms/azure-devops#generating-a-personal-access-token) on creating personal access tokens. | ||
|
||
## Add the necessary webhooks to each project | ||
|
||
1. **Navigate to projects Service Hooks Page**: Go to the service hooks configuration page in the desired Azure DevOps project. | ||
|
||
2. **Add the following webhooks:** | ||
1. Pull request created | ||
2. Pull request updated | ||
3. Pull request commented on | ||
|
||
3. **Add Webhook URL**: Enter the URL pointing to the CodeRabbit service, followed by `/azure_webhooks` (e.g., `http://127.0.0.1:8080/azure_webhooks`) for each webhook. | ||
|
||
## Prepare an `.env` file | ||
|
||
Create an `.env` file with the following content: | ||
|
||
```bash | ||
# if using OpenAI | ||
LLM_PROVIDER=openai | ||
LLM_TIMEOUT=360000 | ||
OPENAI_API_KEYS=<openai-key> | ||
OPENAI_BASE_URL=[<openai-base-url>] | ||
OPENAI_ORG_ID=[<openai-org-id>] | ||
OPENAI_PROJECT_ID=[<openai-project-id>] | ||
|
||
# if using Azure OpenAI | ||
LLM_PROVIDER=azure-openai | ||
LLM_TIMEOUT=360000 | ||
AZURE_OPENAI_ENDPOINT=<azure-openai-endpoint> | ||
AZURE_OPENAI_API_KEY=<key> | ||
AZURE_GPT4OMINI_DEPLOYMENT_NAME=<gpt-4o-mini-deployment-name> | ||
AZURE_GPT4O_DEPLOYMENT_NAME=<gpt-4o-deployment-name, modelVersion: 2024-08-06> | ||
## o1-mini is optional | ||
AZURE_O1_MINI_DEPLOYMENT_NAME=[<o1-mini-deployment-name>] | ||
## o1-preview is optional: it’s very expensive but provides best reviews | ||
AZURE_O1_DEPLOYMENT_NAME=[<o1-preview-deployment-name>] | ||
## gpt-4-turbo is optional: it’s expensive but provides better reviews than gpt-4o | ||
AZURE_GPT4TURBO_DEPLOYMENT_NAME=[<gpt-4-turbo-deployment-name, modelVersion: turbo-2024-04-09>] | ||
|
||
TEMP_PATH=/cache | ||
|
||
AST_GREP_RULES_PATH=/home/jailuser/ast-grep-rules | ||
AST_GREP_ESSENTIALS=ast-grep-essentials | ||
|
||
SELF_HOSTED=azure-devops | ||
|
||
AZURE_DEVOPS_BOT_TOKEN=<personal-access-token> | ||
AZURE_DEVOPS_BOT_USERNAME=<bot-user-username> | ||
CODERABBIT_LICENSE_KEY=<license-key> | ||
|
||
CODERABBIT_API_KEY=[<coderabbitai-api-key>] | ||
ENABLE_LEARNINGS=[true] | ||
ENABLE_METRICS=[true] | ||
|
||
JIRA_HOST=[<jira-host-url>] | ||
JIRA_PAT=[<jira-personal-access-token>] | ||
|
||
LINEAR_PAT=[<linear-personal-access-token>] | ||
``` | ||
|
||
:::note | ||
|
||
* Verify that 3 LLM models 4o-mini, 4o, and 4-turbo are available. If you are using Azure OpenAI, also verify their deployment names in the .env file. | ||
* Values marked with [] are not optional to provide. | ||
* You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys. | ||
|
||
::: | ||
|
||
hasit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Pull the CodeRabbit Docker image | ||
|
||
Authenticate and pull the Docker image using the provided credentials file: | ||
|
||
```bash | ||
cat coderabbit.json | docker login -u _json_key --password-stdin us-docker.pkg.dev | ||
docker pull <docker-registry>/coderabbit-agent:latest | ||
``` | ||
|
||
### Verify the image is up | ||
|
||
You can query `/health` endpoint to verify that the coderabbit-agent service is up and running. | ||
|
||
```bash | ||
curl 127.0.0.1:8080/health | ||
``` | ||
|
||
## Host the image | ||
|
||
You can host the image on a server, serverless function, or container environment and expose port `8080`. Run the Docker image with the equivalent command on your chosen platform, ensuring you replace the `.env` file path with the path to your actual `.env` file: | ||
|
||
```bash | ||
docker run --env-file .env --publish 127.0.0.1:8080:8080 <docker-registry>/coderabbit-agent:latest | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
--- | ||
title: Use Self-Hosted CodeRabbit With GitHub | ||
sidebar_label: GitHub | ||
description: Instructions to self-host CodeRabbit and integrate it with GitHub. | ||
sidebar_position: 1 | ||
--- | ||
|
||
## Create a GitHub App | ||
|
||
Set the following Repository permissions: | ||
|
||
* Checks: Read-only | ||
* Contents: Read and write | ||
* Commit statuses: Read and write | ||
* Discussions: Read-only | ||
* Issues: Read & write | ||
* Metadata: Read-only | ||
* Pull requests: Read & write | ||
|
||
Set the following Organization permissions: | ||
|
||
* Members: Read-only | ||
|
||
Set the following events: | ||
|
||
* Meta | ||
* Issue comment | ||
* Issues | ||
* Label | ||
* Public | ||
* Pull request | ||
* Pull request review | ||
hasit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Pull request review comment | ||
* Pull request review thread | ||
* Push | ||
* Release | ||
|
||
## Gather information from the GitHub App | ||
|
||
* App ID | ||
* Client ID | ||
* Client Secret | ||
* Webhook Secret | ||
|
||
## Prepare an `.env` file | ||
|
||
```bash | ||
# if using OpenAI | ||
LLM_PROVIDER=openai | ||
LLM_TIMEOUT=360000 | ||
OPENAI_API_KEYS=<openai-key> | ||
OPENAI_BASE_URL=[<openai-base-url>] | ||
OPENAI_ORG_ID=[<openai-org-id>] | ||
OPENAI_PROJECT_ID=[<openai-project-id>] | ||
|
||
# if using Azure OpenAI | ||
LLM_PROVIDER=azure-openai | ||
LLM_TIMEOUT=360000 | ||
AZURE_OPENAI_ENDPOINT=<azure-openai-endpoint> | ||
AZURE_OPENAI_API_KEY=<key> | ||
AZURE_GPT4OMINI_DEPLOYMENT_NAME=<gpt-4o-mini-deployment-name> | ||
AZURE_GPT4O_DEPLOYMENT_NAME=<gpt-4o-deployment-name, modelVersion: 2024-08-06> | ||
## o1-mini is optional | ||
AZURE_O1_MINI_DEPLOYMENT_NAME=[<o1-mini-deployment-name>] | ||
## o1-preview is optional: it’s very expensive but provides best reviews | ||
AZURE_O1_DEPLOYMENT_NAME=[<o1-preview-deployment-name>] | ||
## gpt-4-turbo is optional: it’s expensive but provides better reviews than gpt-4o | ||
AZURE_GPT4TURBO_DEPLOYMENT_NAME=[<gpt-4-turbo-deployment-name, modelVersion: turbo-2024-04-09>] | ||
|
||
# if using Anthropic | ||
LLM_PROVIDER=anthropic | ||
LLM_TIMEOUT=360000 | ||
ANTHROPIC_API_KEYS=<anthropic-key> | ||
ANTHROPIC_BASE_URL=[<anthropic-base-url>] | ||
|
||
TEMP_PATH=/cache | ||
|
||
AST_GREP_RULES_PATH=/home/jailuser/ast-grep-rules | ||
AST_GREP_ESSENTIALS=ast-grep-essentials | ||
|
||
SELF_HOSTED=github | ||
|
||
GH_WEBHOOK_SECRET=<webhook-secret> | ||
GITHUB_HOSTNAME=[<github-hostname>] | ||
GITHUB_APP_CLIENT_ID=<github-app-client-id> | ||
GITHUB_APP_CLIENT_SECRET=<github-app-client-secret> | ||
GITHUB_APP_ID=<github-app-id> | ||
GITHUB_APP_PEM_FILE=<flattened-pem-file> | ||
|
||
CODERABBIT_LICENSE_KEY=<license-key> | ||
|
||
CODERABBIT_API_KEY=[<coderabbitai-api-key>] | ||
ENABLE_LEARNINGS=[true] | ||
ENABLE_METRICS=[true] | ||
|
||
JIRA_HOST=[<jira-host-url>] | ||
JIRA_PAT=[<jira-personal-access-token>] | ||
|
||
LINEAR_PAT=[<linear-personal-access-token>] | ||
|
||
OAUTH2_ENDPOINT=[<endpoint>] | ||
OAUTH2_CLIENT_ID=[<client-id>] | ||
OAUTH2_CLIENT_SECRET=[<client-secret>] | ||
``` | ||
|
||
:::note | ||
|
||
* Verify that 3 LLM models 4o-mini, 4o, and 4-turbo are available. If you are using Azure OpenAI, also verify their deployment names in the .env file. | ||
* Values marked with [] are optional to provide. | ||
* For `GITHUB_APP_PEM_FILE`, flatten the PEM file by replacing newlines with `\n`. | ||
* For `GITHUB_HOSTNAME`, use GitHub Enterprise server's hostname, for example, “github.acme-inc.com” | ||
* You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys. | ||
|
||
::: | ||
|
||
hasit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Pull the CodeRabbit Docker image | ||
|
||
Using the credentials file shared with you, first authenticate and then pull the image. | ||
|
||
```bash | ||
cat coderabbit.json | docker login -u _json_key --password-stdin us-docker.pkg.dev | ||
docker pull <docker-registry>/coderabbit-agent:latest | ||
``` | ||
|
||
## Host the image | ||
|
||
You can choose to host it on a server, serverless function, or a container environment and expose the port “8080”. Run the Docker image with the equivalent of the following command on the platform of your choice, replacing the “.env” file with the path to your “.env” file: | ||
|
||
```bash | ||
docker run --env-file .env --publish 127.0.0.1:8080:8080 <docker-registry>/coderabbit-agent:latest | ||
``` | ||
|
||
### Verify the image is up | ||
|
||
You can query `/health` endpoint to verify that the coderabbit-agent service is up and running. | ||
|
||
```bash | ||
curl 127.0.0.1:8080/health | ||
``` | ||
|
||
## Install the GitHub App | ||
|
||
You can install the GitHub App on your GitHub organization or user account and point the Webhook URL to the hosted CodeRabbit instance, for example, `http://127.0.0.1:8080/github_webhooks`. GitHub will send events to the CodeRabbit instance. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.