diff --git a/docs/faq.md b/docs/faq.md index 6755fffa..84abdd52 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -33,16 +33,16 @@ View step by step instructions depending on your platform: - See our [GitHub App installation guide](./platforms/github-com.md) for step-by-step instructions. + See our [GitHub App installation guide](./platforms/github-com.mdx) for step-by-step instructions. Follow our [GitLab integration guide](/platforms/gitlab-com.mdx) to get started. - Check out the [Bitbucket installation steps](/platforms/bitbucket-cloud.md) for detailed setup. + Check out the [Bitbucket installation steps](/platforms/bitbucket-cloud.mdx) for detailed setup. - View our [Azure DevOps setup guide](/platforms/azure-devops.md) for complete installation instructions. + View our [Azure DevOps setup guide](/platforms/azure-devops.mdx) for complete installation instructions. diff --git a/docs/getting-started/adding-organizations.md b/docs/getting-started/adding-organizations.md deleted file mode 100644 index 66741daa..00000000 --- a/docs/getting-started/adding-organizations.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Add organizations -description: Learn how to add new organizations to CodeRabbit ---- - -To add new organizations to CodeRabbit, follow these steps: - -1. Navigate to [coderabbit.ai](https://coderabbit.ai) -2. Click the "Refresh" button next to your organizations list to check for new organizations -3. Find the organization you want to add in the list -4. Click the "Grant" button next to the organization name - -![Checking for new organizations](../../static/img/getting-started/check-for-new-orgs.png) - -![Granting permission to organization](../../static/img/getting-started/grant-permission.png) - -This will grant CodeRabbit access to the selected organization, allowing it to: - -- Read organization and team membership -- Read organization projects -- Access user email addresses (read-only) - -> Note: Organizations control which applications are allowed to access their private data. You may need organization admin approval to complete this process. - -## What's next {#whats-next} - -- [Manage your subscription](/getting-started/subscription-management) diff --git a/docs/getting-started/adding-organizations.mdx b/docs/getting-started/adding-organizations.mdx new file mode 100644 index 00000000..334c1a4e --- /dev/null +++ b/docs/getting-started/adding-organizations.mdx @@ -0,0 +1,42 @@ +--- +title: Add organizations +description: Learn how to add new organizations to CodeRabbit +--- + +import InfoBox from "../../src/components/InfoBox" +import ListItems from "../../src/components/ListItems" +import Note from "../../src/components/Note" + +To add new organizations to CodeRabbit, follow these steps: + +Navigate to coderabbit.ai, + <>Click the "Refresh" button next to your organizations list to check for new organizations, + <>Find the organization you want to add in the list, + <>Click the "Grant" button next to the organization name + ]} +/> + +![Checking for new organizations](../../static/img/getting-started/check-for-new-orgs.png) + +![Granting permission to organization](../../static/img/getting-started/grant-permission.png) + +This will grant CodeRabbit access to the selected organization, allowing it to: + + + + +Organizations control which applications are allowed to access their private data. You may need organization admin approval to complete this process. + + +## What's next {#whats-next} + +- [Manage your subscription](/getting-started/subscription-management) \ No newline at end of file diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md deleted file mode 100644 index c6f1d3b8..00000000 --- a/docs/getting-started/quickstart.md +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: Quickstart -sidebar_label: Quickstart -description: See CodeRabbit in action, using a live GitHub repository. -sidebar_position: 1 ---- - -# Quickstart - -This tutorial gives you a hands-on demonstration of CodeRabbit, using a real, GitHub-based repository. It guides you through the following tasks: - -1. Integrate CodeRabbit into a GitHub-based repository that you own. -1. Observe CodeRabbit perform a code review of a pull request that you initiate. -1. Converse with CodeRabbit about the code review. -1. Prompt CodeRabbit to generate its own improvements to the pull request. - -When you complete this tutorial, you'll have seen CodeRabbit's code-review feature in action, and glimpsed a few of its other AI-driven abilities as well. - -For a more general overview of CodeRabbit, see [Introduction](/). - -:::note -While this tutorial focuses on GitHub, CodeRabbit also works with GitLab, Azure DevOps, and Bitbucket. For more information, see [Integrate with Git platforms](/platforms/). -::: - -## Before you begin - -Create a new, private repository on GitHub. Name the new repository `coderabbit-test`, and let it have otherwise default GitHub settings. - -## Integrate CodeRabbit with your GitHub account - -To integrate CodeRabbit with your GitHub account, follow these steps: - -1. Visit [the CodeRabbit login page](https://app.coderabbit.ai/login?free-trial). -1. Click **Login with GitHub**. -1. Click **Authorize coderabbitai**. - -CodeRabbit takes a moment to set up the integration. After it finishes, the CodeRabbit dashboard appears. - -## Add CodeRabbit to your repository - -To add CodeRabbit to your test repository, follow these steps: - -1. On the CodeRabbit dashboard, click **Add Repositories**. A GitHub repository-access dialog appears. -1. Select the **Only select repositories** radio button. -1. From the **Select repositories** menu, select the `coderabbit-test` repository that you created earlier in this Quickstart. -1. Click **Install & Authorize**. - :::note - CodeRabbit requests read and write access to your repository in order for its code review, issue management, and pull request generation features to work. CodeRabbit never stores your code. For more information, see [the CodeRabbit Trust Center](https://trust.coderabbit.ai). - ::: -1. If a CodeRabbit **Complete your signup** dialog appears, then fill it out with the requested information before continuing. - -CodeRabbit is now ready to use with your test repository. The next steps demonstrate its core code-review features. - -## Let CodeRabbit perform a code review - -The following steps initiate a pull request to add a tiny and somewhat flawed Python library to your repository, triggering analysis and review from CodeRabbit. - -Use your usual Git workflow to perform the following steps in the `coderabbit-test` repository: - -1. Create a branch named `add-utils`. - -1. In that new `add-utils` branch, create a new file called `simple_utils.py`, with the following content: - - ```python - # simple_utils.py - A tiny utility library - - def reverse_string(text): - """Reverses the characters in a string.""" - return text[::-1] - - def count_words(sentence): - return len(sentence.split()) - - def celsius_to_fahrenheit(celsius): - return (celsius * 9/5) + 32 - ``` - -1. Commit the added file to the `add-utils` branch. Use any text you want for the commit message. - -1. Create a pull request that proposes to merge the `add-utils` branch into the `main` branch. Use any text you want for the pull request message. - -After a few moments, CodeRabbit responds to the pull request using the `@coderabbitai` GitHub account. It performs the following actions, all of which are visible on the pull request's page on GitHub: - -- If you didn't write a pull request summary, then CodeRabbit adds a new summary to the pull request. -- CodeRabbit posts a comment titled **Walkthrough** containing analysis and commentary about the content of the pull request. -- CodeRabbit attaches a detailed code review to the pull request as another comment. - -Part of the review resembles the following screenshot: - -![An example code review comment](/img/getting-started/quickstart-comment.png) - -This shows that CodeRabbit has noticed some flaws with this Python library, including a lack of docstrings and input validation. The review comment identifies these flaws, and suggests how you might improve them. - -## Ask CodeRabbit for more information - -After CodeRabbit reviews a pull request, you can converse with it about its review. You can also give CodeRabbit special commands to request it to perform specific functions, such as generating appropriate code changes for you. - -1. Post the following as a new GitHub comment attached to the pull request: - - ```text - @coderabbitai Why do all of these functions need docstrings? Isn't it obvious enough what they do? - ``` - - After a few moments, CodeRabbit posts its reply, explaining its motivations for its recommendation. The reply might resemble the following: - - > You're right that these functions are quite self-explanatory from their names alone. Docstrings aren't strictly necessary for every function, especially in smaller projects with clear function names. - > - > While docstrings do provide benefits (IDE tooltips, documentation generation, help for future developers), they can sometimes feel redundant for very straightforward functions. It's ultimately a matter of coding style and project requirements. - > - > If you prefer to skip docstrings for obvious utility functions in this project, that's perfectly reasonable. Would you like me to adjust my review approach regarding documentation for this repository? - - In this case, CodeRabbit is offering to adjust its future behavior when reviewing changes to this repository. Instead, follow the next step to ask CodeRabbit to implement part of its suggestions. - -1. Post the following as another new comment: - - ```text - @coderabbitai generate docstrings - ``` - - After a few moments, CodeRabbit does the following: - - - CodeRabbit creates a new branch, based on `add-utils`. - - CodeRabbit commits changes to the branch that adds suggested docstrings to `add-utils`. - - CodeRabbit opens a new pull request between the new branch and `add-utils`. - -## Clean up - -Continue experimenting with CodeRabbit in your test repository for as long as you like. When you're finished, you can delete the repository. - -You are now ready to add CodeRabbit to other repositories that you own, and let it review some real pull requests. - -## What's next - -- [Integrate CodeRabbit](/platforms/) with your repositories on GitHub, GitLab, Azure DevOps, or Bitbucket. -- [Configure CodeRabbit](/getting-started/configure-coderabbit) beyond its default settings. -- [Add custom review instructions](/guides/review-instructions). -- [Get support for CodeRabbit](/getting-started/support). -- [Learn more about how CodeRabbit works](/overview/why-coderabbit). diff --git a/docs/getting-started/quickstart.mdx b/docs/getting-started/quickstart.mdx new file mode 100644 index 00000000..043efdb5 --- /dev/null +++ b/docs/getting-started/quickstart.mdx @@ -0,0 +1,185 @@ +--- +title: Quickstart +sidebar_label: Quickstart +description: See CodeRabbit in action, using a live GitHub repository. +sidebar_position: 1 +--- + +import CodeBlock from "@theme/CodeBlock" +import ChatBubble from "../../src/components/ChatBubble" +import DarkCodeBlock from "../../src/components/DarkCodeBlock" +import InfoBox from "../../src/components/InfoBox" +import ListItems from "../../src/components/ListItems" +import Note from "../../src/components/Note" +import BlockQuote from "../../src/components/BlockQuote" + +# Quickstart + +This tutorial gives you a hands-on demonstration of CodeRabbit, using a real, GitHub-based repository. It guides you through the following tasks: + + + +When you complete this tutorial, you'll have seen CodeRabbit's code-review feature in action, and glimpsed a few of its other AI-driven abilities as well. + + + For a more general overview of CodeRabbit, see Introduction. + + + + While this tutorial focuses on GitHub, CodeRabbit also works with GitLab, + Azure DevOps, and Bitbucket. For more information, see{" "} + Integrate with Git platforms. + + +## Before you begin + +Create a new, private repository on GitHub. Name the new repository `coderabbit-test`, and let it have otherwise default GitHub settings. + +## Integrate CodeRabbit with your GitHub account + +To integrate CodeRabbit with your GitHub account, follow these steps: + + + Visit{" "} + + the CodeRabbit login page + + . + , + <> + Click Login with GitHub. + , + <> + Click Authorize coderabbitai. + , + ]} +/> + +CodeRabbit takes a moment to set up the integration. After it finishes, the CodeRabbit dashboard appears. + +## Add CodeRabbit to your repository + +To add CodeRabbit to your test repository, follow these steps: + +On the CodeRabbit dashboard, click Add Repositories., + <>Select the Only select repositories radio button., + <>From the Select repositories menu, select the coderabbit-test repository that you created earlier in this Quickstart., + <> + Click Install & Authorize. + + CodeRabbit requests read and write access to your repository in order for its code review, issue management, and pull request generation features to work. CodeRabbit never stores your code. For more information, see the CodeRabbit Trust Center. + + , + <>If a CodeRabbit Complete your signup dialog appears, then fill it out with the requested information before continuing., + ]} +/> + +CodeRabbit is now ready to use with your test repository. The next steps demonstrate its core code-review features. + +## Let CodeRabbit perform a code review + +The following steps initiate a pull request to add a tiny and somewhat flawed Python library to your repository, triggering analysis and review from CodeRabbit. + +Use your usual Git workflow to perform the following steps in the `coderabbit-test` repository: + + + In that new add-utils branch, create a new file called simple_utils.py, with the following content: + {`# simple_utils.py - A tiny utility library + +def reverse_string(text): + """Reverses the characters in a string.""" + return text[::-1] + +def count_words(sentence): + return len(sentence.split()) + +def celsius_to_fahrenheit(celsius): + return (celsius * 9/5) + 32 +`} + , + "Commit the added file to the `add-utils`branch. Use any text you want for the commit message.", + "Create a pull request that proposes to merge the`add-utils`branch into the`main` branch. Use any text you want for the pull request message.", +]} +/> + +After a few moments, CodeRabbit responds to the pull request using the `@coderabbitai` GitHub account. It performs the following actions, all of which are visible on the pull request's page on GitHub: + +If you didn't write a pull request summary, then CodeRabbit adds a new summary to the pull request., + <>CodeRabbit posts a comment titled Walkthrough containing analysis and commentary about the content of the pull request., + <>CodeRabbit attaches a detailed code review to the pull request as another comment., + ]} +/> + +Part of the review resembles the following screenshot: + +![An example code review comment](/img/getting-started/quickstart-comment.png) + +This shows that CodeRabbit has noticed some flaws with this Python library, including a lack of docstrings and input validation. The review comment identifies these flaws, and suggests how you might improve them. + +## Ask CodeRabbit for more information + +After CodeRabbit reviews a pull request, you can converse with it about its review. You can also give CodeRabbit special commands to request it to perform specific functions, such as generating appropriate code changes for you. + +1. Post the following as a new GitHub comment attached to the pull request: + +@coderabbitai Why do all of these functions need docstrings? Isn't it obvious enough what they do? + +After a few moments, CodeRabbit posts its reply, explaining its motivations for its recommendation. The reply might resemble the following: + +
+You're right that these functions are quite self-explanatory from their names alone. Docstrings aren't strictly necessary for every function, especially in smaller projects with clear function names. + +While docstrings do provide benefits (IDE tooltips, documentation generation, help for future developers), they can sometimes feel redundant for very straightforward functions. It's ultimately a matter of coding style and project requirements. + +If you prefer to skip docstrings for obvious utility functions in this project, that's perfectly reasonable. Would you like me to adjust my review approach regarding documentation for this repository? +
+ +In this case, CodeRabbit is offering to adjust its future behavior when reviewing changes to this repository. Instead, follow the next step to ask CodeRabbit to implement part of its suggestions. + +2. Post the following as another new comment: + +@coderabbitai generate docstrings + +After a few moments, CodeRabbit does the following: + +CodeRabbit creates a new branch, based on `add-utils`., + <>CodeRabbit commits changes to the branch that adds suggested docstrings to `add-utils`., + <>CodeRabbit opens a new pull request between the new branch and `add-utils`., +]} /> + +## Clean up + +Continue experimenting with CodeRabbit in your test repository for as long as you like. When you're finished, you can delete the repository. + +You are now ready to add CodeRabbit to other repositories that you own, and let it review some real pull requests. + +## What's next + +Integrate CodeRabbit with your repositories on GitHub, GitLab, Azure DevOps, or Bitbucket., + <>Configure CodeRabbit beyond its default settings., + <>Add custom review instructions., + <>Get support for CodeRabbit., + <>Learn more about how CodeRabbit works., +]} /> diff --git a/docs/getting-started/upgrading-permissions.md b/docs/getting-started/upgrading-permissions.mdx similarity index 53% rename from docs/getting-started/upgrading-permissions.md rename to docs/getting-started/upgrading-permissions.mdx index c5553abe..768dab88 100644 --- a/docs/getting-started/upgrading-permissions.md +++ b/docs/getting-started/upgrading-permissions.mdx @@ -3,13 +3,21 @@ title: Set permissions description: Learn how to upgrade CodeRabbit's GitHub App permissions when new features are added --- +import ListItems from "../../src/components/ListItems" +import Note from "../../src/components/Note" + Sometimes when we add new features to CodeRabbit, we need to request additional GitHub permissions. If you see a warning about permissions or resources not being accessible, you'll need to approve the new permissions. Here's how to do it: -1. Navigate to your organization or repository settings in GitHub -2. Go to the "GitHub Apps" or "Installed GitHub Apps" section -3. Find CodeRabbit in the list of installed apps -4. Click "Configure" -5. Review and accept the new permissions +Navigate to your organization or repository settings in GitHub, + <>Go to the "GitHub Apps" or "Installed GitHub Apps" section, + <>Find CodeRabbit in the list of installed apps, + <>Click "Configure", + <>Review and accept the new permissions + ]} +/> ![Permission warning example](../../static/img/getting-started/permission-warning.png) @@ -19,11 +27,17 @@ Sometimes when we add new features to CodeRabbit, we need to request additional Common reasons for permission updates include: -- Access to new GitHub features -- Enhanced repository scanning capabilities -- Additional workflow automation features -- Improved security features + -> Note: If you're not an organization admin, you may need to request approval from your organization administrators to update the permissions. + +If you're not an organization admin, you may need to request approval from your organization administrators to update the permissions. + -After accepting the new permissions, CodeRabbit will have the access it needs to function properly. If you continue to experience issues, try refreshing your browser or reaching out to our support team. +After accepting the new permissions, CodeRabbit will have the access it needs to function properly. If you continue to experience issues, try refreshing your browser or reaching out to our support team. \ No newline at end of file diff --git a/docs/overview/introduction.md b/docs/overview/introduction.mdx similarity index 56% rename from docs/overview/introduction.md rename to docs/overview/introduction.mdx index f937ac67..45c6b796 100644 --- a/docs/overview/introduction.md +++ b/docs/overview/introduction.mdx @@ -9,6 +9,11 @@ description: slug: "/" --- +import ListItems from "../../src/components/ListItems" +import InfoBox from "../../src/components/InfoBox" +import PlatformGrid from "../../src/components/PlatformGrid" +import PlatformCard from "../../src/components/PlatformCard" + # Introduction This page provides a conceptual introduction to CodeRabbit. For a hands-on tutorial, see [Quickstart](/getting-started/quickstart/). @@ -18,21 +23,32 @@ This page provides a conceptual introduction to CodeRabbit. For a hands-on tutor Developers can interact directly with the CodeRabbit bot within their existing Git platform's pull request interface to add context, ask questions, or even have the bot generate code. Over time, CodeRabbit learns from user input and improves its suggestions.
- +
## Core features Core CodeRabbit features include the following: -- Integrates rapidly with popular Git platforms and workflows. -- Applies dozens of open-source, industry-standard code analyzers to every commit. -- Implements code reviews as familiar pull-request comments. -- Works with contributors through natural-language conversation in comments. -- Learns and adapts to your team's code style and review preferences. -- Provides an observability dashboard of code-contribution activity. -- Practices strong privacy and security, with no retention of analyzed code. -- Offers free use for public repositories, and flexible pricing for private codebases. + ## Seamless workflow integration @@ -58,52 +74,93 @@ No matter how you tune and customize CodeRabbit, its default settings make it us CodeRabbit integrates in just a few clicks with many popular Git platforms: -- GitHub, GitHub Enterprise Cloud, GitHub Enterprise Server, -- GitLab, GitLab Self-Managed -- Azure DevOps -- Bitbucket Cloud - -For more information, see [Supported Git Platforms](/platforms/). + + + + + + + + For more information, see Supported Git Platforms. + ### Issue-management integration You can integrate CodeRabbit with issue-management platforms. This lets you ask CodeRabbit to create tickets during code reviews, or chat with CodeRabbit about your code from within issue comments. Compatible platforms include the following: -- GitHub Issues -- GitLab Issues -- Jira -- Linear + + + + + + -For more information, see [Issue Creation](/guides/issue-creation) and [Issue Chat](/guides/issue-chat). + + For more information, see Issue Creation{" "} + and Issue Chat. + ## Data privacy and security CodeRabbit collects only the minimum amount of information needed to provide you with our code review services. Our privacy and security posture centers around protecting your data through ephemerality: -- All queries to large language models (LLMs) exist in-memory only, with zero retention after each query completes. -- We don't use your code, code reviews, or other collected data to train LLMs. -- CodeRabbit doesn't share any collected customer data with third parties. -- We keep all customer data confidential, and isolated by organization. -- Our data collection and storage practices comply with SOC 2 and GDPR standards. - -For more information about how we protect your data, see [the CodeRabbit Trust Center](https://trust.coderabbit.ai). + + + + For more information about how we protect your data, see{" "} + the CodeRabbit Trust Center. + ## Flexible pricing, free for public repositories Public repositories can use the Pro tier of CodeRabbit at no charge, including all of the code-review features described on this page. Rate limits might apply. -For private repositories, a number of pricing tiers are available. These range from a Free tier that offers unlimited code-change summaries, to an Enterprise tier with access to advanced features and SLA support. For more information, see [Pricing](https://www.coderabbit.ai/pricing). +For private repositories, a number of pricing tiers are available. These range from a Free tier that offers unlimited code-change summaries, to an Enterprise tier with access to advanced features and SLA support. + + + For more information, see{" "} + Pricing. + ## Review local changes from within VSCode As a separate, free product, CodeRabbit offers a VSCode extension that brings a subset of core CodeRabbit features to VSCode. This lets you use the power of CodeRabbit to tune and tidy your code changes locally before pushing your changes into a formal pull request for more thorough reviews. -For more information, see [Review local changes](/code-editors). + + For more information, see Review local changes. + ## What's next -- [Quickstart](/getting-started/quickstart/) lets you experience your first CodeRabbit code review first-hand. - -- [Review local changes](/code-editors) guides you through installing and using a subset of CodeRabbit features directly from your code editor. - -- [Why CodeRabbit?](/overview/why-coderabbit) dives further into the philosophies and technologies that drive CodeRabbit. + + Quickstart lets you experience + your first CodeRabbit code review first-hand. + , + <> + Review local changes guides you through + installing and using a subset of CodeRabbit features directly from your + code editor. + , + <> + Why CodeRabbit? dives further into + the philosophies and technologies that drive CodeRabbit. + , + ]} +/> diff --git a/docs/overview/why-coderabbit.md b/docs/overview/why-coderabbit.md index f04e347d..e3ce5c9b 100644 --- a/docs/overview/why-coderabbit.md +++ b/docs/overview/why-coderabbit.md @@ -348,7 +348,7 @@ CodeRabbit is built for production environments with: ### Three Steps to Better Code Reviews -1. **Sign in** with [GitHub](../platforms/github-com.md), [GitLab](../platforms/gitlab-com.mdx), or [Azure DevOps](../platforms/azure-devops.md) +1. **Sign in** with [GitHub](../platforms/github-com.mdx), [GitLab](../platforms/gitlab-com.mdx), or [Azure DevOps](../platforms/azure-devops.mdx) 2. Select and add repositories in CodeRabbit dashboard 3. That's it. You're good to go. diff --git a/docs/platforms/azure-devops.md b/docs/platforms/azure-devops.md deleted file mode 100644 index 12b70765..00000000 --- a/docs/platforms/azure-devops.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: Integrating CodeRabbit with Azure DevOps -description: Learn how to integrate CodeRabbit with Azure DevOps. -sidebar_label: Azure DevOps -sidebar_position: 5 ---- - -This guide will assist you in effectively integrating CodeRabbit with Azure -DevOps. - -## Prerequisites - -- An active Azure DevOps account. -- Use of organizational email addresses is required; personal email addresses - are not supported for this integration. - -## Integration Instructions - -1. Log in to the CodeRabbitAI application. -2. After logging in, you will be redirected to a page displaying Microsoft Apps - consent requests. Please forward these requests to your administrator for - approval. - - :::warning - - If you are an administrator, you may approve the applications directly. If not, - please contact your administrator to request approval for the applications. - - ::: - - ![CodeRabbit admin consent page for Azure DevOps integration](/img/integrations/azure_apps_consent_page.png) - -3. Once your administrator has approved the applications, click "Continue." -4. You will be redirected to the "Onboarding" page, where you can select the - organization you wish to integrate with. -5. On the "Azure DevOps User" page, enter your Personal Access Token for Azure - DevOps. - ![CodeRabbit azure devOps integration settings page](/img/integrations/azure_devops_user_page.png) -6. To install CodeRabbit on a repository, toggle the switch on the - "Repositories" page. - -## How it works - -For the CodeRabbit app to post reviews on merge requests, it needs to interact -with the Azure DevOps API, which requires a Personal Access Token. This token -can be generated by creating a Personal Access Token from one of your existing -users. - -You can create a new user in Azure DevOps and generate a Personal Access Token -for that user, following [our recommendations](#recommendations). - -## Azure DevOps Personal Access Tokens - -To interact with the Azure DevOps API, a **Personal Access Token** is required. -This token can be generated 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 add the Personal Access Token. - -![CodeRabbit azure devOps integration modal](/img/integrations/azure_personal_access_token_add.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. -- **Use the CodeRabbit logo as the profile picture** - This further ensures easy - recognition. You can download our logo from - [here](/img/integrations/logo.png "download"). - -### Key Points to Remember - -- 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 "AzureDevOps User" page in the sidebar. - - Add the new token and click save. - -### Generating a Personal Access Token - -Azure DevOps provides an option to generate a personal access token for a user. -Follow these steps to generate the token: - -1. Log in as the user intended for CodeRabbit reviews. -2. Next to your avatar on the headers right side is a settings icon, click it. -3. Choose "Personal Access Tokens" -4. Click "New Token" -5. Select the organization you want to use the token with or select "All - accessible organizations." -6. Enter a name and an expiry date for the token. -7. We need to have read & write access to "Work Items" & "Code" to post reviews - on pull requests. If you are on the Pro tier also add "Build" access for pipeline - failure remediation. -8. Click "Create" - -![CodeRabbit azure devOps personal access token creation form](/img/integrations/azure-access-token.png) diff --git a/docs/platforms/azure-devops.mdx b/docs/platforms/azure-devops.mdx new file mode 100644 index 00000000..baf2fc20 --- /dev/null +++ b/docs/platforms/azure-devops.mdx @@ -0,0 +1,105 @@ +--- +title: Integrating CodeRabbit with Azure DevOps +description: Learn how to integrate CodeRabbit with Azure DevOps. +sidebar_label: Azure DevOps +sidebar_position: 5 +--- + +import InfoBox from "../../src/components/InfoBox" +import ListItems from "../../src/components/ListItems" +import { Warning } from "../../src/components/Warning" + +This guide will assist you in effectively integrating CodeRabbit with Azure DevOps. + +## Prerequisites + + + +## Integration Instructions + +Log in to the CodeRabbitAI application, + <>After logging in, you will be redirected to a page displaying Microsoft Apps consent requests. Please forward these requests to your administrator for approval. + + + If you are an administrator, you may approve the applications directly. If not, please contact your administrator to request approval for the applications. + + + CodeRabbit admin consent page for Azure DevOps integration, + <>Once your administrator has approved the applications, click "Continue", + <>You will be redirected to the "Onboarding" page, where you can select the organization you wish to integrate with, + <>On the "Azure DevOps User" page, enter your Personal Access Token for Azure DevOps. + + CodeRabbit azure devOps integration settings page, + <>To install CodeRabbit on a repository, toggle the switch on the "Repositories" page + ]} +/> + +## How it works + +For the CodeRabbit app to post reviews on merge requests, it needs to interact with the Azure DevOps API, which requires a Personal Access Token. This token can be generated by creating a Personal Access Token from one of your existing users. + +You can create a new user in Azure DevOps and generate a Personal Access Token for that user, following [our recommendations](#recommendations). + +## Azure DevOps Personal Access Tokens + +To interact with the Azure DevOps API, a **Personal Access Token** is required. This token can be generated 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 add the Personal Access Token. + +![CodeRabbit azure devOps integration modal](/img/integrations/azure_personal_access_token_add.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, + <>Use the CodeRabbit logo as the profile picture - This further ensures easy recognition. You can download our logo from here + ]} +/> + +### Key Points to Remember + +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 "AzureDevOps User" page in the sidebar, + <>Add the new token and click save + ]} + /> + ]} +/> + +### Generating a Personal Access Token + +Azure DevOps provides an option to generate a personal access token for a user. Follow these steps to generate the token: + +Log in as the user intended for CodeRabbit reviews, + <>Next to your avatar on the headers right side is a settings icon, click it, + <>Choose "Personal Access Tokens", + <>Click "New Token", + <>Select the organization you want to use the token with or select "All accessible organizations", + <>Enter a name and an expiry date for the token, + <>We need to have read & write access to "Work Items" & "Code" to post reviews on pull requests. If you are on the Pro tier also add "Build" access for pipeline failure remediation, + <>Click "Create" + ]} +/> + +![CodeRabbit azure devOps personal access token creation form](/img/integrations/azure-access-token.png) \ No newline at end of file diff --git a/docs/platforms/bitbucket-cloud.md b/docs/platforms/bitbucket-cloud.md deleted file mode 100644 index 385d46ed..00000000 --- a/docs/platforms/bitbucket-cloud.md +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: "Bitbucket Cloud" -description: "Learn how to integrate CodeRabbit with Bitbucket Cloud." -sidebar_label: "Bitbucket Cloud" -sidebar_position: 6 ---- - -CodeRabbit integrates with Bitbucket Cloud to enhance code review and collaboration by: - -- Automatically initiating code reviews for newly created merge requests. -- Displaying review comments and suggestions directly on merge requests. -- Enabling seamless interaction with the CodeRabbit bot for real-time feedback and assistance. - -This guide will assist you in effectively integrating CodeRabbit with Bitbucket Cloud. - -## Configure API Token - -To enable CodeRabbit to interact with your Bitbucket repositories, an API token is required. This token grants the -necessary permissions for interacting with the Bitbucket merge request and discussion APIs. - -1. Create a new Bitbucket account specifically for CodeRabbit and treat it as a service account. -2. Name the account "CodeRabbit". -3. If your Bitbucket workspace requires two-step verification, then you must also enable two-step verification on this - new account. -4. Generate an API Token to enable seamless integration between CodeRabbit and your Bitbucket repositories. - -We recommend creating a new user as a service account, associating this user to the workspace you'd like to install -CodeRabbit on, and providing CodeRabbit with the API token to allow access. During the installation process, CodeRabbit -will automatically configure the required webhook for seamless integration. - -:::note - -If you wish to change the review user, you must provide the API token for the new user who will post reviews and -comments. However, this requires manually removing the previous user from the projects and associated webhooks. Once -this is done, you will need to reinstall the CodeRabbit app for each project. - -::: - -### 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. -- **Use the CodeRabbit logo as the profile picture** - This further ensures easy recognition. You can download our logo - from [here](/img/integrations/logo.svg "download"). -- **Developer Access** Ensure the service account user has developer access to the projects that you wish to install - CodeRabbit on. - -#### Key Points to Remember - -- Code reviews will be attributed to the owner of the API token. - -#### Generating an API token - -Bitbucket provides an option to generate an API token for a new user. Follow these steps to generate the token: - -1. Log in using the user designated for CodeRabbit reviews. This user serves as a service account for managing reviews - and related activities. -2. Go to [API Tokens](https://id.atlassian.com/manage-profile/security/api-tokens). -3. Click **Create API token with scopes**. -4. Enter a name easily recognizable for this API token usage and an expiration date based on your plan of using the - product. -5. On next step select **Bitbucket** -6. Ensure the following scopes are selected: - - read:account - - read:user:bitbucket - - write:issue:bitbucket - - read:issue:bitbucket - - read:workspace:bitbucket - - admin:project:bitbucket - - write:webhook:bitbucket - - read:webhook:bitbucket - - read:pipeline:bitbucket - - read:runner:bitbucket - - read:repository:bitbucket - - write:repository:bitbucket - - read:pullrequest:bitbucket - - write:pullrequest:bitbucket -7. Click **Create** -8. Note down the API token as it will only be displayed once. - -### Where to Provide CodeRabbit the API Token - -By default, if no API token is provided, CodeRabbit will prompt you to provide one during the installation process. -However, if you wish to provide the token beforehand, you can do so by navigating to the **Organization Settings** tab, -and selecting the **Bitbucket User** tab on the sidebar. Once entering the API token, the token will be validated and -saved for future use. - -You can confirm the correct user is being selected by verifying the user ID shown on the UI with the user ID of the -service account user you created. - ---- - -### Installing CodeRabbit into your Bitbucket Repositories - -1. Go to the [Repositories page](https://app.coderabbit.ai/settings/repositories) in the CodeRabbit app. -2. Select the checkbox next to the repositories where you want to install CodeRabbit. To install it on all repositories - at once, select the checkbox at the top. -3. Select **Install Repositories**. - -
- Bitbucket Repo Install Modal -
- -The webhook `https://coderabbit.ai/bitbucketHandler` will now be installed for the projects selected. - -
- Bitbucket Webhook Example -
- -### Troubleshooting - -:::note - -If you are experiencing issues with the webhook, such as CodeRabbit not being able to access the repository, or not -reviewing pull requests, you can manually delete the webhook to the repository. - -Then refresh the repository page in the CodeRabbit app and you can reinstall the webhook. - -If you cannot install the webhook please check that your Bitbucket user has the necessary permissions to install the -webhook and the API Token is properly configured. - -::: diff --git a/docs/platforms/bitbucket-cloud.mdx b/docs/platforms/bitbucket-cloud.mdx new file mode 100644 index 00000000..92d69500 --- /dev/null +++ b/docs/platforms/bitbucket-cloud.mdx @@ -0,0 +1,148 @@ +--- +title: "Bitbucket Cloud" +description: "Learn how to integrate CodeRabbit with Bitbucket Cloud." +sidebar_label: "Bitbucket Cloud" +sidebar_position: 6 +--- + +import InfoBox from "../../src/components/InfoBox" +import ListItems from "../../src/components/ListItems" +import Note from "../../src/components/Note" + +CodeRabbit integrates with Bitbucket Cloud to enhance code review and collaboration by: + + + +This guide will assist you in effectively integrating CodeRabbit with Bitbucket Cloud. + +## Configure API Token + +To enable CodeRabbit to interact with your Bitbucket repositories, an API token is required. This token grants the necessary permissions for interacting with the Bitbucket merge request and discussion APIs. + +Create a new Bitbucket account specifically for CodeRabbit and treat it as a service account, + <>Name the account "CodeRabbit", + <>If your Bitbucket workspace requires two-step verification, then you must also enable two-step verification on this new account, + <>Generate an API Token to enable seamless integration between CodeRabbit and your Bitbucket repositories + ]} +/> + +We recommend creating a new user as a service account, associating this user to the workspace you'd like to install CodeRabbit on, and providing CodeRabbit with the API token to allow access. During the installation process, CodeRabbit will automatically configure the required webhook for seamless integration. + + +If you wish to change the review user, you must provide the API token for the new user who will post reviews and comments. However, this requires manually removing the previous user from the projects and associated webhooks. Once this is done, you will need to reinstall the CodeRabbit app for each project. + + +### 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, + <>Use the CodeRabbit logo as the profile picture - This further ensures easy recognition. You can download our logo from here, + <>Developer Access Ensure the service account user has developer access to the projects that you wish to install CodeRabbit on + ]} +/> + +### Key Points to Remember + + + +### Generating an API token + +Bitbucket provides an option to generate an API token for a new user. Follow these steps to generate the token: + +Log in using the user designated for CodeRabbit reviews. This user serves as a service account for managing reviews and related activities, + <>Go to API Tokens, + <>Click Create API token with scopes, + <>Enter a name easily recognizable for this API token usage and an expiration date based on your plan of using the product, + <>On next step select Bitbucket, + <>Ensure the following scopes are selected: + , + <>Click Create, + <>Note down the API token as it will only be displayed once + ]} +/> + +### Where to Provide CodeRabbit the API Token + +By default, if no API token is provided, CodeRabbit will prompt you to provide one during the installation process. However, if you wish to provide the token beforehand, you can do so by navigating to the **Organization Settings** tab, and selecting the **Bitbucket User** tab on the sidebar. Once entering the API token, the token will be validated and saved for future use. + +You can confirm the correct user is being selected by verifying the user ID shown on the UI with the user ID of the service account user you created. + +--- + +### Installing CodeRabbit into your Bitbucket Repositories + +Go to the Repositories page in the CodeRabbit app, + <>Select the checkbox next to the repositories where you want to install CodeRabbit. To install it on all repositories at once, select the checkbox at the top, + <>Select Install Repositories + ]} +/> + +
+ Bitbucket Repo Install Modal +
+ +The webhook `https://coderabbit.ai/bitbucketHandler` will now be installed for the projects selected. + +
+ Bitbucket Webhook Example +
+ +### Troubleshooting + + +If you are experiencing issues with the webhook, such as CodeRabbit not being able to access the repository, or not reviewing pull requests, you can manually delete the webhook to the repository. + +Then refresh the repository page in the CodeRabbit app and you can reinstall the webhook. + +If you cannot install the webhook please check that your Bitbucket user has the necessary permissions to install the webhook and the API Token is properly configured. + \ No newline at end of file diff --git a/docs/platforms/github-com.md b/docs/platforms/github-com.mdx similarity index 73% rename from docs/platforms/github-com.md rename to docs/platforms/github-com.mdx index 60d919d7..7ceddec7 100644 --- a/docs/platforms/github-com.md +++ b/docs/platforms/github-com.mdx @@ -5,13 +5,22 @@ sidebar_label: GitHub.com sidebar_position: 1 --- +import InfoBox from "../../src/components/InfoBox" +import BlockQuote from "../../src/components/BlockQuote" +import Tip from "../../src/components/Tip" +import Note from "../../src/components/Note" + 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 reviews your PRs and provides concise summaries, identifies potential issues, and offers insights that might be missed during manual reviews. +
+**CodeRabbit** is an AI code reviewer designed to ease the challenges of code review, supporting repository maintainers and teams. It reviews your PRs and 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. +
+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. @@ -19,6 +28,7 @@ It preprocesses the PR content, builds context, leverages Large Language Models ## Let's Integrate CodeRabbit with GitHub + ### 1. Accessing CodeRabbit Visit the [CodeRabbit login](https://app.coderabbit.ai/login?free-trial) page. You'll see all the authentication options, select "**Login with GitHub**" to proceed. @@ -29,7 +39,9 @@ Visit the [CodeRabbit login](https://app.coderabbit.ai/login?free-trial) page. Y 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. +
+This step grants the necessary permissions for CodeRabbit to interact with your repositories and pull requests. +
![Authorization Login](/img/integrations/authorization-codeRabbit.png) @@ -47,9 +59,9 @@ Here, you can add repositories and configure CodeRabbit config settings for each ![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 @@ -57,15 +69,15 @@ You can configure CodeRabbit through a YAML file or using the [App's UI](https:/ 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. +
+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. @@ -97,7 +109,9 @@ Also, check out the response when asked for what improvements can be done on the 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. +
+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. +
CodeRabbit automatically detects and alerts you about configuration conflicts. @@ -109,8 +123,12 @@ CodeRabbit generates detailed statistics and test plans for each pull request. ![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](/guides/review-instructions) +
+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](/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. +
+Explore, Experiment, Discover how [CodeRabbit](https://docs.coderabbit.ai/) can streamline your code review process using AI. +
\ No newline at end of file diff --git a/docs/platforms/github-enterprise-server.md b/docs/platforms/github-enterprise-server.md deleted file mode 100644 index 733607cb..00000000 --- a/docs/platforms/github-enterprise-server.md +++ /dev/null @@ -1,189 +0,0 @@ ---- -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 ---- - -:::info - -This page is for GitHub Enterprise Server (Self-Hosted) users only. -If you're using `github.com`, [log in to CodeRabbit](https://app.coderabbit.ai) -and add your repositories from there - -::: - -This page guides you through the process of integrating your Self-Managed GitHub -with CodeRabbit. - -To initiate the integration, we require specific information. This is essential -for the initial setup of CodeRabbit within your domain. Once this setup is -complete, you can log in directly. - -### **Step 1: Getting Started** - -**Visit CodeRabbit:** Visit our [Login](https://app.coderabbit.ai/login?free-trial) page and -select Self-Hosted GitHub - -![CodeRabbit login page](/img/integrations/login-self-hosted-github.png) - -On this page, enter the URL of your self-managed GitHub instance and click -submit. Once, you submit, we check our database for a record of your -organization and if we find an existing one, we will start the login process. - -![Self-hosted gitHub enterprise connection page for CodeRabbit](/img/integrations/self-hosted-github-host-url.png) - -If the self-managed GitHub instance is not found, you will be required to enter -more details for the onboarding. - -### **Step 2: GitHub OAuth App** - -Navigate to your GitHub Enterprise Server (Self-Hosted) Instance and follow the -steps below to -[create an OAuth App](https://docs.github.com/en/enterprise-server@latest/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app): - -1. Sign in to your GitHub Enterprise account. -2. In the upper-right corner of any page, click your profile photo, then click - **Settings**. -3. In the left sidebar, click **Developer settings** > **OAuth Apps**. -4. Click **New OAuth App**. -5. Set the following fields: - - **Application name**: `CodeRabbit OAuth` - - **Homepage URL**: `https://coderabbit.ai` - - **Application description**: - `OAuth application for signing into CodeRabbit` - - **Authorization callback URL**: `https://app.coderabbit.ai/login` -6. Click **Register application**. - -![GitHub Create OAuth App](/img/integrations/github-create-oauth-app.png) - -Once the OAuth App has been created, click on **Generate a new client secret** -under the 'Client secrets' section and copy the secret as it will be visible -once only - -Keep the following details handy: - -- Client ID -- Client secret - -![GitHub OAuth Client ID & Secret](/img/integrations/github-oauth-client-id-secret.png) - -### **Step 3: GitHub App** - -Navigate to your GitHub Enterprise Server (Self-Hosted) Instance and follow the -steps below to -[create a GitHub App](https://docs.github.com/en/enterprise-server@latest/apps/creating-github-apps/registering-a-github-app/registering-a-github-app): - -1. Sign in to your GitHub Enterprise account. -2. In the upper-right corner of any page, click your profile photo, then click **Settings**. -3. In the left sidebar, click **Developer settings** > **GitHub Apps** -4. Click **New GitHub App**. -5. Set the following fields: - - **GitHub App name**: `CodeRabbit` - - **Description**: `GitHub App for CodeRabbit` - - **Homepage URL**: `https://coderabbit.ai` - - **Callback URL**: `https://app.coderabbit.ai/login` - - **Request user authorization (OAuth) during installation**: `true` - - **Webhook Active**: `true` - - **Webhook URL**: `https://app.coderabbit.ai/githubHandler` - - **Webhook secret**: Use a secure string and keep it handy. - - **Permissions**: - - **Repository permissions**: - - **Actions**: Read-only - - **Checks**: Read-only - - **Contents**: Read and write - - **Commit statuses**: Read and write - - **Discussions**: Read-only - - **Issues**: Read and write - - **Metadata**: Read-only - - **Pull requests**: Read and write - - **Organization permissions**: - - **Members**: Read-only - - **Events**: - - Meta - - Issue comment - - Issues - - Label - - Public - - Pull request - - Pull request review - - Pull request review comment - - Pull request review thread - - Push - - Release - - **Where can this GitHub App be installed?**: Select `Any account` -6. Click **Create GitHub App**. - -Once the GitHub App has been created, click on **Generate a new client secret** -under the 'Client secrets' section and copy the secret as it will be visible -once only. - -Scroll down and click on **Generate a private key** under the 'Private keys' -section and download the PEM file. - -Keep the following details handy: - -- App ID -- Client ID -- Client secret -- Webhook secret -- Private key - -![GitHub App Client ID & Secret](/img/integrations/github-app-client-id-secret.png) - -We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. - -### **Step 4: CodeRabbit UI Onboarding** - -Submit the details that were accumulated in previous steps: - -- Host URL of your GitHub instance -- OAuth Client ID -- OAuth Client Secret -- GitHub App ID -- GitHub App Client ID -- GitHub App Client Secret -- GitHub App Webhook Secret -- GitHub App Private Key - -Click on Submit and the login process will be initiated. On subsequent visits, -your setup will be automatically detected, allowing for direct login. - -### **Step 5: Install the GitHub App** - -Navigate to the GitHub App that was created from your GitHub Enterprise Server -(self-hosted) instance and click on the **Install App** tab. Then, install the -GitHub App to your organization(s). - -:::warning - -If you performed this step before Step 4, the installation event likely will -have failed, and you will need to re-send the installation event. -Navigate to the **Advanced** tab in the GitHub App and click on the -**Redeliver** button for the failed `installation.created` event. - -::: - -### **Step 6: Whitelist CodeRabbit IP address** - -Use this CodeRabbit IP if your instance requires IP whitelisting -`35.222.179.152/32` and `34.170.211.100/32`. - -VPN tunneling is available as an add-on package. Please reach out to us at -[support@coderabbit.ai](mailto:support@coderabbit.ai) if you are interested. - -### **FAQ** - -#### Who should create the OAuth App and GitHub App? - -The OAuth App and GitHub App should be created by a user with administrative -privileges on the GitHub Enterprise Server instance. This user will be responsible for managing the integration with CodeRabbit. - -#### I see an error when trying to log in to CodeRabbit. What should I do? - -If you encounter an error during the login process, please ensure that: - -- The OAuth App and GitHub App are correctly configured with the right URLs and permissions. -- The browser local storage and cookies related to CodeRabbit are cleared. - -If the issue persists, contact our support team. diff --git a/docs/platforms/github-enterprise-server.mdx b/docs/platforms/github-enterprise-server.mdx new file mode 100644 index 00000000..b8e5be99 --- /dev/null +++ b/docs/platforms/github-enterprise-server.mdx @@ -0,0 +1,187 @@ +--- +title: Integrating CodeRabbit with GitHub Enterprise Server +description: Learn how to integrate CodeRabbit with GitHub Enterprise Server. +sidebar_label: GitHub Enterprise Server +sidebar_position: 3 +--- + +import InfoBox from "../../src/components/InfoBox" +import ListItems from "../../src/components/ListItems" +import Note from "../../src/components/Note" + + +This page is for GitHub Enterprise Server (Self-Hosted) users only. If you're using `github.com`, [log in to CodeRabbit](https://app.coderabbit.ai) and add your repositories from there + + +This page guides you through the process of integrating your Self-Managed GitHub with CodeRabbit. + +To initiate the integration, we require specific information. This is essential for the initial setup of CodeRabbit within your domain. Once this setup is complete, you can log in directly. + +### **Step 1: Getting Started** + +**Visit CodeRabbit:** Visit our [Login](https://app.coderabbit.ai/login?free-trial) page and select Self-Hosted GitHub + +![CodeRabbit login page](/img/integrations/login-self-hosted-github.png) + +On this page, enter the URL of your self-managed GitHub instance and click submit. Once, you submit, we check our database for a record of your organization and if we find an existing one, we will start the login process. + +![Self-hosted gitHub enterprise connection page for CodeRabbit](/img/integrations/self-hosted-github-host-url.png) + +If the self-managed GitHub instance is not found, you will be required to enter more details for the onboarding. + +### **Step 2: GitHub OAuth App** + +Navigate to your GitHub Enterprise Server (Self-Hosted) Instance and follow the steps below to [create an OAuth App](https://docs.github.com/en/enterprise-server@latest/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app): + +Sign in to your GitHub Enterprise account, + <>In the upper-right corner of any page, click your profile photo, then click Settings, + <>In the left sidebar, click Developer settings OAuth Apps, + <>Click New OAuth App, + <>Set the following fields: + Application name: CodeRabbit OAuth, + <>Homepage URL: https://coderabbit.ai, + <>Application description: OAuth application for signing into CodeRabbit, + <>Authorization callback URL: https://app.coderabbit.ai/login + ]} + />, + <>Click Register application + ]} +/> + +![GitHub Create OAuth App](/img/integrations/github-create-oauth-app.png) + +Once the OAuth App has been created, click on **Generate a new client secret** under the 'Client secrets' section and copy the secret as it will be visible once only. + +Keep the following details handy: + + + +![GitHub OAuth Client ID & Secret](/img/integrations/github-oauth-client-id-secret.png) + +### **Step 3: GitHub App** + +Navigate to your GitHub Enterprise Server (Self-Hosted) Instance and follow the steps below to [create a GitHub App](https://docs.github.com/en/enterprise-server@latest/apps/creating-github-apps/registering-a-github-app/registering-a-github-app): + +Sign in to your GitHub Enterprise account, + <>In the upper-right corner of any page, click your profile photo, then click Settings, + <>In the left sidebar, click Developer settings GitHub Apps, + <>Click New GitHub App, + <>Set the following fields: + GitHub App name: CodeRabbit, + <>Description: GitHub App for CodeRabbit, + <>Homepage URL: https://coderabbit.ai, + <>Callback URL: https://app.coderabbit.ai/login, + <>Request user authorization (OAuth) during installation: true, + <>Webhook Active: true, + <>Webhook URL: https://app.coderabbit.ai/githubHandler, + <>Webhook secret: Use a secure string and keep it handy, + <>Permissions: + Repository permissions: + Actions: Read-only, + <>Checks: Read-only, + <>Contents: Read and write, + <>Commit statuses: Read and write, + <>Discussions: Read-only, + <>Issues: Read and write, + <>Metadata: Read-only, + <>Pull requests: Read and write + ]} + />, + <>Organization permissions: + Members: Read-only + ]} + />, + <>Events: + + ]} + />, + <>Where can this GitHub App be installed?: Select Any account + ]} + />, + <>Click Create GitHub App + ]} +/> + +Once the GitHub App has been created, click on **Generate a new client secret** under the 'Client secrets' section and copy the secret as it will be visible once only. + +Scroll down and click on **Generate a private key** under the 'Private keys' section and download the PEM file. + +Keep the following details handy: + + + +![GitHub App Client ID & Secret](/img/integrations/github-app-client-id-secret.png) + +We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. + +### **Step 4: CodeRabbit UI Onboarding** + +Submit the details that were accumulated in previous steps: + + + +Click on Submit and the login process will be initiated. On subsequent visits, your setup will be automatically detected, allowing for direct login. diff --git a/docs/platforms/gitlab-com.mdx b/docs/platforms/gitlab-com.mdx index c276cd35..6f040418 100644 --- a/docs/platforms/gitlab-com.mdx +++ b/docs/platforms/gitlab-com.mdx @@ -5,11 +5,20 @@ sidebar_label: GitLab.com sidebar_position: 2 --- +import InfoBox from "../../src/components/InfoBox" +import ListItems from "../../src/components/ListItems" +import Note from "../../src/components/Note" +import ChatBubble from "../../src/components/ChatBubble" + CodeRabbit integrates with GitLab to enhance code review and collaboration by: -- Automatically initiating code reviews for newly created merge requests. -- Displaying review comments and suggestions directly on merge requests. -- Enabling seamless interaction with the CodeRabbit bot for real-time feedback and assistance. + This guide will assist you in effectively integrating CodeRabbit with SaaS GitLab. @@ -17,8 +26,13 @@ This guide will assist you in effectively integrating CodeRabbit with SaaS GitLa To enable CodeRabbit to interact with your GitLab repositories, an access token is required. This token grants the necessary permissions for interacting with the Merge Requests and Discussions APIs. - 1. Personal Access Token (PAT): You can create a new GitLab account specifically for CodeRabbit, name it “CodeRabbit” and treat it as a service account. Then generate a PAT from it where PAT will enable seamless integration between CodeRabbit and your GitLab repositories. - 2. Group Access Token: If your organization uses GitLab Premium or Ultimate, you can generate a Group Access Token. This option automatically creates a bot user associated with the group for managing access and posting reviews. +Personal Access Token (PAT): You can create a new GitLab account specifically for CodeRabbit, name it "CodeRabbit" and treat it as a service account. Then generate a PAT from it where PAT will enable seamless integration between CodeRabbit and your GitLab repositories., + <>Group Access Token: If your organization uses GitLab Premium or Ultimate, you can generate a Group Access Token. This option automatically creates a bot user associated with the group for managing access and posting reviews. + ]} +/> ### Personal Access Token @@ -32,11 +46,9 @@ We recommend creating a new user as a service account, associating this user to /> -:::note - -If you wish to change the review user, you must provide the access token for the new user who will post reviews and comments. However, this requires manually removing the previous user from the projects and associated webhooks. Once this is done, you will need to reinstall the CodeRabbit app for each project. - -::: + +If you wish to change the review user, you must provide the access token for the new user who will post reviews and comments. However, this requires manually removing the previous user from the projects and associated webhooks. Once this is done, you will need to reinstall the CodeRabbit app for each project. +
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, + <>Use the CodeRabbit logo as the profile picture - This further ensures easy recognition. You can download our logo from here, + <>Ensure Developer Access - Ensure the dedicated user has (at least) Developer access to the group or projects that you wish to install CodeRabbit on + ]} +/> #### Key Points to Remember -- Personal access tokens have expiration dates. Ensure the expiration date **covers the duration** of your intended use of CodeRabbit. -- 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. - - Enter the new Access token, and click the **Update** button on the page. +Personal access tokens have expiration dates. Ensure the expiration date covers the duration of your intended use of CodeRabbit, + <>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, + <>Enter the new Access token, and click the Update button on the page + ]} + /> + ]} +/> #### Generating a Personal Access Token GitLab provides an option to generate a personal access token for a new user. Follow these steps to generate the token: -1. Log in using the user designated for CodeRabbit reviews. This user serves as a service account for managing reviews and related activities. -2. Select your avatar on the left sidebar. -3. Choose **Edit Profile**. -4. Select **Access Tokens** from the left sidebar. -5. Click [Add New Token.](https://gitlab.com/-/user_settings/personal_access_tokens) -6. Enter a name and an expiry date for the token. -7. If no expiry date is entered, it defaults to 365 days from the current date. -8. Ensure the following scopes are selected: `api`, `read_api`, `read_user`. -9. Click **Create Personal Access Token** -10. Note down the token as it will only be displayed once. +Log in using the user designated for CodeRabbit reviews. This user serves as a service account for managing reviews and related activities, + <>Select your avatar on the left sidebar, + <>Choose Edit Profile, + <>Select Access Tokens from the left sidebar, + <>Click Add New Token, + <>Enter a name and an expiry date for the token, + <>If no expiry date is entered, it defaults to 365 days from the current date, + <>Ensure the following scopes are selected: api, read_api, read_user, + <>Click Create Personal Access Token, + <>Note down the token as it will only be displayed once + ]} +/>
By default, GitLab restricts this option to users on the Premium or Ultimate tiers. - -::: + #### Generating a Group Access Token -1. Navigate to the group you wish to install CodeRabbit on. -2. Select **Settings** from the left sidebar. -3. Select **Access Tokens** within the Settings heading. -4. Create a Group Access Token. -5. Ensure the following scopes are selected: `api`. -6. Ensure Developer Access is provided. +Navigate to the group you wish to install CodeRabbit on, + <>Select Settings from the left sidebar, + <>Select Access Tokens within the Settings heading, + <>Create a Group Access Token, + <>Ensure the following scopes are selected: api, + <>Ensure Developer Access is provided + ]} +/> --- @@ -119,9 +152,14 @@ You can confirm the correct user is being selected by verifying the user ID show ### Installing CodeRabbit into your GitLab Repositories -1. Go to the [Repositories page](https://app.coderabbit.ai/settings/repositories) in the CodeRabbit app. -2. Select the checkbox next to the repositories where you want to install CodeRabbit. To install it on all repositories at once, select the checkbox at the top. -3. Select **Install Repositories**. +Go to the Repositories page in the CodeRabbit app, + <>Select the checkbox next to the repositories where you want to install CodeRabbit. To install it on all repositories at once, select the checkbox at the top, + <>Select Install Repositories + ]} +/>
+Troubleshooting Webhook Issues: If you are experiencing issues with the webhook, such as coderabbit not being able to access the repository, or not reviewing pull requests, you can manually delete the webhook to the repository. Then refresh the repository page in the CodeRabbit app and you can reinstall the webhook. If you cannot install the webhook please check that your GitLab user has the necessary permissions to install the webhook and the PAT is not expired. - -::: + diff --git a/docs/platforms/platforms.md b/docs/platforms/platforms.md deleted file mode 100644 index d4cb1748..00000000 --- a/docs/platforms/platforms.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Integrate with Git platforms -description: Overview of CodeRabbit's supported Git platforms. ---- - -CodeRabbit supports various Git platforms to provide code review for your repositories. For the cloud-hosted Git platforms, you can [login][login] to CodeRabbit and add your repositories. The following platforms are supported: - -## GitHub - -| Host | Support | -| ------------------------ | ---------------------------------------- | -| GitHub.com | [Supported](github-com.md) | -| GitHub Enterprise Server | [Supported](github-enterprise-server.md) | - -## GitLab - -| Host | Support | -| ------------------- | ---------------------------------- | -| GitLab.com | [Supported](gitlab-com.mdx) | -| GitLab Self Managed | [Supported](self-hosted-gitlab.md) | - -## Azure DevOps - -| Host | Support | -| ------------ | ---------------------------- | -| Azure DevOps | [Supported](azure-devops.md) | - -## Bitbucket - -| Host | Support | -| -------------------- | ---------------------------------------- | -| Bitbucket Datacenter | [Supported](../self-hosted/bitbucket.md) | -| Bitbucket Cloud | [Supported](./bitbucket-cloud.md) | - -[login]: https://app.coderabbit.ai/login?free-trial diff --git a/docs/platforms/platforms.mdx b/docs/platforms/platforms.mdx new file mode 100644 index 00000000..6b29443c --- /dev/null +++ b/docs/platforms/platforms.mdx @@ -0,0 +1,77 @@ +--- +title: Integrate with Git platforms +description: Overview of CodeRabbit's supported Git platforms. +--- + +import Table from "@site/src/components/Table" + +CodeRabbit supports various Git platforms to provide code review for your repositories. For the cloud-hosted Git platforms, you can [login][login] to CodeRabbit and add your repositories. The following platforms are supported: + +## GitHub + + + +## GitLab + +
+ +## Azure DevOps + +
+ +## Bitbucket + +
+ +[login]: https://app.coderabbit.ai/login?free-trial diff --git a/docs/platforms/self-hosted-gitlab.md b/docs/platforms/self-hosted-gitlab.md deleted file mode 100644 index 3fa18a71..00000000 --- a/docs/platforms/self-hosted-gitlab.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: Integrating CodeRabbit for Self-Managed GitLab -description: Learn how to integrate CodeRabbit with your Self-Managed GitLab instance. -sidebar_label: Self-Managed GitLab -sidebar_position: 4 ---- - -This page guides you through the process of integrating your Self-Managed GitLab -with CodeRabbit. - -To initiate the integration, we require specific information. This is essential -for the initial setup of CodeRabbit within your domain. Once this setup is -complete, you can log in directly using the OAuth2 flow. - -CodeRabbit supports GitLab `16.x` and above. Version `15.x` may experience -unexpected issues such as review comments not being posted or the sign-up -process not working at all. While we won't block the integration, we recommend -upgrading your GitLab instance to obtain the intended experience. - -### **Step 1: Getting Started** - -**Visit CodeRabbit:** Visit our [Login](https://app.coderabbit.ai/login?free-trial) page and -select Self-Hosted GitLab - -![CodeRabbit login](/img/integrations/login-self-hosted-gitlab.png) - -### Step 2: Enter your Self-Managed GitLab URL - -On this page, enter the URL of your self-managed GitLab instance and click -submit. Once, you submit, we check our database for a record of your -organization and if we find an existing one, we are starting the login process. - -![Self-hosted Gitlab enterprise connection page](/img/integrations/self-hosted-gitlab-host-url.png) - -If the self-managed GitLab instance is not found, we initiate the onboarding -process, which can be either manual or automated. - -### **Step 3: Onboarding Manual or Automated** - -#### 1. Automated onboarding - -![Self-managed GitLab connection page](/img/integrations/automated-onboarding.png) - -#### **Why do we need the Admin Access Token?** - -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 -not automatically installing the CodeRabbit app across all projects. You will -add CodeRabbit manually on the projects you wish, as the next step. - -#### 2. Manual onboarding - -For the manual onboarding process we need to create the -[CodeRabbit user](#creating-coderabbit-user) and the -[OAuth2 GitLab application](#creating-oauth2-application). -![Self-managed GitLab connection page](/img/integrations/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. - -To create users in GitLab, log in with an instance admin account and follow the -steps provided in the -[GitLab documentation](https://docs.gitlab.com/ee/user/profile/account/create_accounts.html#create-users-in-admin-area). -After the user is created, you can retrieve the **User ID** from that user's -profile and generate an [**access token**](#generating-personal-access-token). -The access token is used to post reviews on merge requests. - -We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. - -#### **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 openid` -2. Callback URL: `https://app.coderabbit.ai/login` - -#### **Generating Personal Access token** - -GitLab offers an option to generate a personal access token for adding a new -user and setting up the application in the self-managed instance. To generate -the token, please follow the process outlined below: - -1. Login to your self-hosted instance. For - [automated onboarding](#1-automated-onboarding) ensure you have admin rights. -2. On the left sidebar, select your avatar. -3. Select Edit profile. -4. On the left sidebar, select Access Tokens. -5. Select Add new token. -6. Enter a name and expiry date for the token. We need this for the initial - setup, so the minimum expiry time is sufficient. -7. If you do not enter an expiry date, the expiry date is automatically set to - 365 days later than the current date. -8. Make sure, you select the scopes: `api read_api read_user` -9. Select Create personal access token. -10. Please note down this token as this will be visible one time only - -![GitLab personal access token configuration page](/img/integrations/admin-access-token.png) - -### **Step 4: Paste the details and click submit** - -- Submit the form. -- We will handle the setup process for you. -- On subsequent visits, your setup will be automatically detected, allowing for - direct login. ![CodeRabbit authentication options page](/img/integrations/self-hosted-page.png) - -### **Step 5: Whitelist CodeRabbit IP address** - -Use this CodeRabbit IP if your instance requires IP whitelisting -`35.222.179.152/32` and `34.170.211.100/32`. - -VPN tunneling is available as an add-on package. Please reach out to us at -[support@coderabbit.ai](mailto:support@coderabbit.ai) if you are interested. diff --git a/docs/platforms/self-hosted-gitlab.mdx b/docs/platforms/self-hosted-gitlab.mdx new file mode 100644 index 00000000..083885b6 --- /dev/null +++ b/docs/platforms/self-hosted-gitlab.mdx @@ -0,0 +1,110 @@ +--- +title: Integrating CodeRabbit for Self-Managed GitLab +description: Learn how to integrate CodeRabbit with your Self-Managed GitLab instance. +sidebar_label: Self-Managed GitLab +sidebar_position: 4 +--- + +import InfoBox from "../../src/components/InfoBox" +import ListItems from "../../src/components/ListItems" +import ChatBubble from "../../src/components/ChatBubble" + +This page guides you through the process of integrating your Self-Managed GitLab with CodeRabbit. + +To initiate the integration, we require specific information. This is essential for the initial setup of CodeRabbit within your domain. Once this setup is complete, you can log in directly using the OAuth2 flow. + +CodeRabbit supports GitLab `16.x` and above. Version `15.x` may experience unexpected issues such as review comments not being posted or the sign-up process not working at all. While we won't block the integration, we recommend upgrading your GitLab instance to obtain the intended experience. + +### **Step 1: Getting Started** + +**Visit CodeRabbit:** Visit our [Login](https://app.coderabbit.ai/login?free-trial) page and select Self-Hosted GitLab + +![CodeRabbit login](/img/integrations/login-self-hosted-gitlab.png) + +### Step 2: Enter your Self-Managed GitLab URL + +On this page, enter the URL of your self-managed GitLab instance and click submit. Once, you submit, we check our database for a record of your organization and if we find an existing one, we are starting the login process. + +![Self-hosted Gitlab enterprise connection page](/img/integrations/self-hosted-gitlab-host-url.png) + +If the self-managed GitLab instance is not found, we initiate the onboarding process, which can be either manual or automated. + +### **Step 3: Onboarding Manual or Automated** + +#### 1. Automated onboarding + +![Self-managed GitLab connection page](/img/integrations/automated-onboarding.png) + +#### **Why do we need the Admin Access Token?** + +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 not automatically installing the CodeRabbit app across all projects. You will add CodeRabbit manually on the projects you wish, as the next step. + +#### 2. Manual onboarding + +For the manual onboarding process we need to create the [CodeRabbit user](#creating-coderabbit-user) and the [OAuth2 GitLab application](#creating-oauth2-application). + +![Self-managed GitLab connection page](/img/integrations/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 clarity about which user is used for our application and allows for better fine-grained access control. + +To create users in GitLab, log in with an instance admin account and follow the steps provided in the [GitLab documentation](https://docs.gitlab.com/ee/user/profile/account/create_accounts.html#create-users-in-admin-area). After the user is created, you can retrieve the **User ID** from that user's profile and generate an [**access token**](#generating-personal-access-token). The access token is used to post reviews on merge requests. + +We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. + +#### **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: + +Scopes: api read_user email openid, + <>Callback URL: https://app.coderabbit.ai/login + ]} +/> + +#### **Generating Personal Access token** + +GitLab offers an option to generate a personal access token for adding a new user and setting up the application in the self-managed instance. To generate the token, please follow the process outlined below: + +Login to your self-hosted instance. For automated onboarding ensure you have admin rights, + <>On the left sidebar, select your avatar, + <>Select Edit profile, + <>On the left sidebar, select Access Tokens, + <>Select Add new token, + <>Enter a name and expiry date for the token. We need this for the initial setup, so the minimum expiry time is sufficient, + <>If you do not enter an expiry date, the expiry date is automatically set to 365 days later than the current date, + <>Make sure, you select the scopes: api read_api read_user, + <>Select Create personal access token, + <>Please note down this token as this will be visible one time only + ]} +/> + +![GitLab personal access token configuration page](/img/integrations/admin-access-token.png) + +### **Step 4: Paste the details and click submit** + +Submit the form, + <>We will handle the setup process for you, + <>On subsequent visits, your setup will be automatically detected, allowing for direct login + ]} +/> + +![CodeRabbit authentication options page](/img/integrations/self-hosted-page.png) + +### **Step 5: Whitelist CodeRabbit IP address** + +Use this CodeRabbit IP if your instance requires IP whitelisting: `35.222.179.152/32` and `34.170.211.100/32`. + +VPN tunneling is available as an add-on package. Please reach out to us at [support@coderabbit.ai](mailto:support@coderabbit.ai) if you are interested. \ No newline at end of file diff --git a/docs/self-hosted/azure-devops.md b/docs/self-hosted/azure-devops.mdx similarity index 63% rename from docs/self-hosted/azure-devops.md rename to docs/self-hosted/azure-devops.mdx index c8926b0f..3a13635b 100644 --- a/docs/self-hosted/azure-devops.md +++ b/docs/self-hosted/azure-devops.mdx @@ -5,16 +5,22 @@ description: Instructions to self-host CodeRabbit and integrate it with Azure De sidebar_position: 3 --- -:::note +import ListItems from '@site/src/components/ListItems/ListItems'; +import Note from '@site/src/components/Note/Note'; +import DarkCodeBlock from '@site/src/components/DarkCodeBlock/DarkCodeBlock'; + + The self-hosted option is only available for CodeRabbit Enterprise customers with 500 user seats or more. Please contact [CodeRabbit Sales](mailto:sales@coderabbit.ai) to learn more about the CodeRabbit Enterprise plan. -::: + ## Create an Azure DevOps User -- **Username**: Set the username to "CodeRabbit" for easier identification (optional). -- **Profile Image**: Use the CodeRabbitAI logo for the user image (optional). +Username: Set the username to "CodeRabbit" for easier identification (optional)., + <>Profile Image: Use the CodeRabbitAI logo for the user image (optional). +]} /> We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. @@ -28,30 +34,34 @@ Generate a personal access token for the CodeRabbit user to be added in the `.en **Necessary Scopes**: -- `Code` - Full -- `Work Items` - Read, write, and manage -- `Build` - Read +Code - Full, + <>Work Items - Read, write, and manage, + <>Build - Read +]} /> 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 project's 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. +Navigate to project's Service Hooks Page: Go to the service hooks configuration page in the desired Azure DevOps project., + <>Add the following webhooks: + Pull request created, + <>Pull request updated, + <>Pull request commented on + ]} /> + , + <>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 + +{`# if using OpenAI LLM_PROVIDER=openai LLM_TIMEOUT=360000 OPENAI_API_KEYS= @@ -128,39 +138,41 @@ LINEAR_PAT=[] ENABLE_WEB_SEARCH=[true] PERPLEXITY_API_KEY=[] -YAML_CONFIG=[] -``` +YAML_CONFIG=[]`} + -:::note + -- If you are using Azure OpenAI, verify that the model deployment names are 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. -- `YAML_CONFIG` is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the [CodeRabbit YAML configuration](/docs/getting-started/configure-coderabbit.md) file. It requires the entire YAML file to be in an escaped string format, for example, `YAML_CONFIG="key1: value1\nkey2: value2"`. You can use [Escape YAML](https://escapeyaml.dev/) to generate the escaped string. +If you are using Azure OpenAI, verify that the model deployment names are 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., + <>YAML_CONFIG is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the CodeRabbit YAML configuration file. It requires the entire YAML file to be in an escaped string format, for example, YAML_CONFIG="key1: value1\nkey2: value2". You can use Escape YAML to generate the escaped string. +]} /> -::: + ## 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 /coderabbit-agent:latest -``` + +{`cat coderabbit.json | docker login -u _json_key --password-stdin us-docker.pkg.dev +docker pull /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 -``` + +{`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 /coderabbit-agent:latest -``` + +{`docker run --env-file .env --publish 127.0.0.1:8080:8080 /coderabbit-agent:latest`} + diff --git a/docs/self-hosted/bitbucket.md b/docs/self-hosted/bitbucket.mdx similarity index 64% rename from docs/self-hosted/bitbucket.md rename to docs/self-hosted/bitbucket.mdx index bccbb251..ccc50a9c 100644 --- a/docs/self-hosted/bitbucket.md +++ b/docs/self-hosted/bitbucket.mdx @@ -5,16 +5,22 @@ description: Instructions to self-host CodeRabbit and integrate it with Bitbuck sidebar_position: 4 --- -:::note +import ListItems from '@site/src/components/ListItems/ListItems'; +import Note from '@site/src/components/Note/Note'; +import DarkCodeBlock from '@site/src/components/DarkCodeBlock/DarkCodeBlock'; + + The self-hosted option is only available for CodeRabbit Enterprise customers with 500 user seats or more. Please contact [CodeRabbit Sales](mailto:sales@coderabbit.ai) to learn more about the CodeRabbit Enterprise plan. -::: + ## Create a Bitbucket User -- **Username**: Set the username to "CodeRabbit" for easier identification (optional). -- **Profile Image**: Use the CodeRabbitAI logo for the user image (optional). +Username: Set the username to "CodeRabbit" for easier identification (optional)., + <>Profile Image: Use the CodeRabbitAI logo for the user image (optional). +]} /> We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. @@ -22,8 +28,10 @@ We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the prof Add the CodeRabbit user to each project where you want CodeRabbit to post reviews, with permissions to: -- Post reviews -- Open pull requests +Post reviews, + <>Open pull requests +]} /> ## Create a Personal Access Token for CodeRabbit user @@ -31,19 +39,24 @@ Generate a personal access token for the CodeRabbit user to be added in the `.en ## Add a webhook to each project -1. **Navigate to Webhook Settings**: Go to the repository settings and locate the webhooks configuration page. -2. **Configure Events**: Enable the following Pull Request events: - - "Opened" - - "Modified" - - "Comment Added" -3. **Add Webhook URL**: Enter the URL pointing to the CodeRabbit service, followed by `/bitbucket_server_webhooks` (e.g., `http://127.0.0.1:8080/bitbucket_server_webhooks`). +Navigate to Webhook Settings: Go to the repository settings and locate the webhooks configuration page., + <>Configure Events: Enable the following Pull Request events: + "Opened", + <>"Modified", + <>"Comment Added" + ]} /> + , + <>Add Webhook URL: Enter the URL pointing to the CodeRabbit service, followed by /bitbucket_server_webhooks (e.g., http://127.0.0.1:8080/bitbucket_server_webhooks). +]} /> ## Prepare a `.env` file Create a `.env` file with the following content: -```bash -# if using OpenAI + +{`# if using OpenAI LLM_PROVIDER=openai LLM_TIMEOUT=360000 OPENAI_API_KEYS= @@ -123,39 +136,40 @@ LINEAR_PAT=[] ENABLE_WEB_SEARCH=[true] PERPLEXITY_API_KEY=[] -YAML_CONFIG=[] -``` +YAML_CONFIG=[]`} + -:::note + -- If you are using Azure OpenAI, verify that the model deployment names are in the .env file. - Values marked with [] are optional and can be omitted if the feature is not needed. -- You can generate `CODERABBIT_API_KEY` from CodeRabbit UI -> Organizations Settings -> API Keys. -- `YAML_CONFIG` is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the [CodeRabbit YAML configuration](/docs/getting-started/configure-coderabbit.md) file. It requires the entire YAML file to be in an escaped string format, for example, `YAML_CONFIG="key1: value1\nkey2: value2"`. You can use [Escape YAML](https://escapeyaml.dev/) to generate the escaped string. +If you are using Azure OpenAI, verify that the model deployment names are in the .env file. Values marked with [] are optional and can be omitted if the feature is not needed., + <>You can generate CODERABBIT_API_KEY from CodeRabbit UI {"->"} Organizations Settings {"->"} API Keys., + <>YAML_CONFIG is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the CodeRabbit YAML configuration file. It requires the entire YAML file to be in an escaped string format, for example, YAML_CONFIG="key1: value1\nkey2: value2". You can use Escape YAML to generate the escaped string. +]} /> -::: + ## 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 us-docker.pkg.dev/coderabbitprod/self-hosted/coderabbit-agent:latest -``` + +{`cat coderabbit.json | docker login -u _json_key --password-stdin us-docker.pkg.dev +docker pull us-docker.pkg.dev/coderabbitprod/self-hosted/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 -``` + +{`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 us-docker.pkg.dev/coderabbitprod/self-hosted/coderabbit-agent:latest -``` + +{`docker run --env-file .env --publish 127.0.0.1:8080:8080 us-docker.pkg.dev/coderabbitprod/self-hosted/coderabbit-agent:latest`} + diff --git a/docs/self-hosted/github.md b/docs/self-hosted/github.mdx similarity index 75% rename from docs/self-hosted/github.md rename to docs/self-hosted/github.mdx index 6e2b27c1..164d4c40 100644 --- a/docs/self-hosted/github.md +++ b/docs/self-hosted/github.mdx @@ -5,56 +5,73 @@ description: Instructions to self-host CodeRabbit and integrate it with GitHub. sidebar_position: 1 --- -:::note +import ListItems from "../../src/components/ListItems" +import Note from "../../src/components/Note" +import DarkCodeBlock from "../../src/components/DarkCodeBlock" + The self-hosted option is only available for CodeRabbit Enterprise customers with 500 user seats or more. Please contact [CodeRabbit Sales](mailto:sales@coderabbit.ai) to learn more about the CodeRabbit Enterprise plan. - -::: + ## 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 -- Actions: Read-only + Set the following Organization permissions: -- Members: Read-only + Set the following events: -- Meta -- Issue comment -- Issues -- Label -- Public -- Pull request -- Pull request review -- Pull request review comment -- Pull request review thread -- Push -- Release + We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. ## Gather information from the GitHub App -- App ID -- Client ID -- Client Secret -- Webhook Secret + ## Prepare an `.env` file -```bash -# if using OpenAI +{`# if using OpenAI LLM_PROVIDER=openai LLM_TIMEOUT=360000 OPENAI_API_KEYS= @@ -141,46 +158,37 @@ LINEAR_PAT=[] ENABLE_WEB_SEARCH=[true] PERPLEXITY_API_KEY=[] -YAML_CONFIG=[] -``` - -:::note +YAML_CONFIG=[]`} + - If you are using Azure OpenAI, verify that the model deployment names are 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” +- 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. - When `ENABLE_LEARNINGS` is set to `true`, CodeRabbit will use `CODERABBIT_API_KEY` to store learnings on our servers. - `YAML_CONFIG` is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the [CodeRabbit YAML configuration](/docs/getting-started/configure-coderabbit.md) file. It requires the entire YAML file to be in an escaped string format, for example, `YAML_CONFIG="key1: value1\nkey2: value2"`. You can use [Escape YAML](https://escapeyaml.dev/) to generate the escaped string. - -::: + ## 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 /coderabbit-agent:latest -``` +{`cat coderabbit.json | docker login -u _json_key --password-stdin us-docker.pkg.dev +docker pull /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: +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 /coderabbit-agent:latest -``` +{`docker run --env-file .env --publish 127.0.0.1:8080:8080 /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 -``` +{`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. +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. \ No newline at end of file diff --git a/docs/self-hosted/gitlab.md b/docs/self-hosted/gitlab.mdx similarity index 62% rename from docs/self-hosted/gitlab.md rename to docs/self-hosted/gitlab.mdx index 395d93fc..331db545 100644 --- a/docs/self-hosted/gitlab.md +++ b/docs/self-hosted/gitlab.mdx @@ -5,16 +5,22 @@ description: Instructions to self-host CodeRabbit and integrate it with GitLab. sidebar_position: 2 --- -:::note +import ListItems from '@site/src/components/ListItems/ListItems'; +import Note from '@site/src/components/Note/Note'; +import DarkCodeBlock from '@site/src/components/DarkCodeBlock/DarkCodeBlock'; + + The self-hosted option is only available for CodeRabbit Enterprise customers with 500 user seats or more. Please contact [CodeRabbit Sales](mailto:sales@coderabbit.ai) to learn more about the CodeRabbit Enterprise plan. -::: + ## Create a GitLab User -- **Username**: Set the username to "CodeRabbit" for easier identification (optional). -- **Profile Image**: Use the CodeRabbitAI logo for the user image (optional). +Username: Set the username to "CodeRabbit" for easier identification (optional)., + <>Profile Image: Use the CodeRabbitAI logo for the user image (optional). +]} /> We recommend using the CodeRabbit [logo](/img/integrations/logo.png) as the profile picture to ensures easy recognition. @@ -34,55 +40,59 @@ Consult official CodeRabbitAI documentation for a detailed [guide](https://docs. ## Add a webhook to each project -1. **Navigate to Add Webhook Page**: Go to the webhook configuration page in the desired GitLab project. -2. **Add Webhook URL**: Enter the URL pointing to the CodeRabbit service, followed by `/gitlab_webhooks` (e.g., `http://127.0.0.1:8080/gitlab_webhooks`). -3. **Generate and Save Secret Token**: Generate a secret token, add it to the webhook, and store it securely. This will be needed for the `.env` file as `GITLAB_WEBHOOK_SECRET` (you can use a single secret token for all projects). -4. **Select triggers**: - - - Push events - - Comments - - Issues events - - Merge request events +Navigate to Add Webhook Page: Go to the webhook configuration page in the desired GitLab project., + <>Add Webhook URL: Enter the URL pointing to the CodeRabbit service, followed by /gitlab_webhooks (e.g., http://127.0.0.1:8080/gitlab_webhooks)., + <>Generate and Save Secret Token: Generate a secret token, add it to the webhook, and store it securely. This will be needed for the .env file as GITLAB_WEBHOOK_SECRET (you can use a single secret token for all projects)., + <>Select triggers: + Push events, + <>Comments, + <>Issues events, + <>Merge request events + ]} /> + +]} /> ## Add Webhook Using a Script We have a convenient [script](/code/gitlab-webhook.sh) to help you add webhooks to a project or all projects under a group in a GitLab instance. -```bash -# Make sure the script is executable: -chmod +x gitlab-webhook.sh -``` + +{`# Make sure the script is executable: +chmod +x gitlab-webhook.sh`} + Example usage: -```bash -# PAT example (header auto-detected) + +{`# PAT example (header auto-detected) export GITLAB_TOKEN="glpat-xxxxx" -./gitlab-add-webhook.sh \ - -h "gitlab.example.com" -u "http:///gitlab_webhooks" \ +./gitlab-add-webhook.sh \\ + -h "gitlab.example.com" -u "http:///gitlab_webhooks" \\ -s "mySecret" -p 42 # PAT example (explicit header) -./gitlab-add-webhook.sh \ - -h "gitlab.example.com" -u "http:///gitlab_webhooks" \ - -s "mySecret" -g "mygroup/mysubgroup/myproject" \ - -t "glpat-xxxxx" \ +./gitlab-add-webhook.sh \\ + -h "gitlab.example.com" -u "http:///gitlab_webhooks" \\ + -s "mySecret" -g "mygroup/mysubgroup/myproject" \\ + -t "glpat-xxxxx" \\ -A "PRIVATE-TOKEN" # OAuth token with explicit header -./gitlab-add-webhook.sh \ - -h "gitlab.example.com" -u "http:///gitlab_webhooks" \ - -s "mySecret" -g "company/backend" \ - -t "eyJhbGciOi..." \ - -A "Authorization: Bearer" -``` +./gitlab-add-webhook.sh \\ + -h "gitlab.example.com" -u "http:///gitlab_webhooks" \\ + -s "mySecret" -g "company/backend" \\ + -t "eyJhbGciOi..." \\ + -A "Authorization: Bearer"`} + ## Prepare a `.env` file Create a `.env` file with the following content: -```bash -# if using OpenAI + +{`# if using OpenAI LLM_PROVIDER=openai LLM_TIMEOUT=360000 OPENAI_API_KEYS= @@ -168,39 +178,41 @@ LINEAR_PAT=[] ENABLE_WEB_SEARCH=[true] PERPLEXITY_API_KEY=[] -YAML_CONFIG=[] -``` +YAML_CONFIG=[]`} + -:::note + -- If you are using Azure OpenAI, verify that the model deployment names are 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. -- `YAML_CONFIG` is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the [CodeRabbit YAML configuration](/docs/getting-started/configure-coderabbit.md) file. It requires the entire YAML file to be in an escaped string format, for example, `YAML_CONFIG="key1: value1\nkey2: value2"`. You can use [Escape YAML](https://escapeyaml.dev/) to generate the escaped string. +If you are using Azure OpenAI, verify that the model deployment names are 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., + <>YAML_CONFIG is an optional configuration file that can be used to customize CodeRabbit's behavior at the deployment level. It takes the same format as the CodeRabbit YAML configuration file. It requires the entire YAML file to be in an escaped string format, for example, YAML_CONFIG="key1: value1\nkey2: value2". You can use Escape YAML to generate the escaped string. +]} /> -::: + ## 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 /coderabbit-agent:latest -``` + +{`cat coderabbit.json | docker login -u _json_key --password-stdin us-docker.pkg.dev +docker pull /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 -``` + +{`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 /coderabbit-agent:latest -``` + +{`docker run --env-file .env --publish 127.0.0.1:8080:8080 /coderabbit-agent:latest`} + diff --git a/docusaurus.config.ts b/docusaurus.config.ts index f4cd07ca..721da114 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -273,8 +273,8 @@ const config: Config = { ], }, prism: { - theme: prismThemes.github, - darkTheme: prismThemes.dracula, + theme: prismThemes.nightOwl, + darkTheme: prismThemes.nightOwl, }, algolia: { // The application ID provided by Algolia diff --git a/src/components/BlockQuote/BlockQuote.module.css b/src/components/BlockQuote/BlockQuote.module.css new file mode 100644 index 00000000..1f77e21e --- /dev/null +++ b/src/components/BlockQuote/BlockQuote.module.css @@ -0,0 +1,33 @@ +.blockquote { + border-left: 3px solid #9B9B9B; + padding: 1rem 1.5rem; + margin: 1.2rem 0; + color: var(--ifm-color-content); + position: relative; +} + +.blockquote p { + margin: 0; + line-height: 1.6; +} + +.blockquote p:not(:last-child) { + margin-bottom: 1rem; +} + +/* Responsive design */ +@media (max-width: 768px) { + .blockquote { + padding: 0.8rem 1.2rem; + margin: 1rem 0; + border-left-width: 2px; + } +} + +@media (max-width: 480px) { + .blockquote { + padding: 0.7rem 1rem; + margin: 0.8rem 0; + border-left-width: 2px; + } +} \ No newline at end of file diff --git a/src/components/BlockQuote/BlockQuote.tsx b/src/components/BlockQuote/BlockQuote.tsx new file mode 100644 index 00000000..36c68724 --- /dev/null +++ b/src/components/BlockQuote/BlockQuote.tsx @@ -0,0 +1,14 @@ +import React from "react" +import styles from "./BlockQuote.module.css" + +interface BlockQuoteProps { + children: React.ReactNode +} + +const BlockQuote: React.FC = ({ children }) => ( +
+ {children} +
+) + +export default BlockQuote \ No newline at end of file diff --git a/src/components/BlockQuote/index.ts b/src/components/BlockQuote/index.ts new file mode 100644 index 00000000..ecadbbc2 --- /dev/null +++ b/src/components/BlockQuote/index.ts @@ -0,0 +1 @@ +export { default } from "./BlockQuote" \ No newline at end of file diff --git a/src/components/ChatBubble/ChatBubble.module.css b/src/components/ChatBubble/ChatBubble.module.css new file mode 100644 index 00000000..4842d276 --- /dev/null +++ b/src/components/ChatBubble/ChatBubble.module.css @@ -0,0 +1,77 @@ +.chatBubble { + background: var(--imf-text-button-color-bg); + color: var(--imf-text-color); + border-radius: 6px; + padding: 1em 1.2em; + margin: 1em 0; + font-family: "Fira Mono", "Menlo", "Monaco", "Consolas", monospace; + font-size: 0.98em; + white-space: pre-wrap; + word-break: break-word; + position: relative; +} + +.content { + padding-right: 2.5rem; +} + +.copyButton { + position: absolute; + top: 0.75rem; + right: 0.75rem; + background: rgba(255, 255, 255, 0.1); + border: none; + border-radius: 4px; + color: var(--imf-text-color); + cursor: pointer; + padding: 0.5rem; + opacity: 0.7; + transition: opacity 0.2s ease, background 0.2s ease; + display: flex; + align-items: center; + justify-content: center; +} + +.copyButton:hover { + opacity: 1; + background: rgba(255, 255, 255, 0.2); +} + +.copyButton:active { + transform: scale(0.95); +} + +/* Responsive design */ +@media (max-width: 768px) { + .chatBubble { + padding: 0.8rem 1rem; + font-size: 0.95rem; + } + + .content { + padding-right: 2.2rem; + } + + .copyButton { + top: 0.6rem; + right: 0.6rem; + padding: 0.4rem; + } +} + +@media (max-width: 480px) { + .chatBubble { + padding: 0.7rem 0.8rem; + font-size: 0.9rem; + } + + .content { + padding-right: 2rem; + } + + .copyButton { + top: 0.5rem; + right: 0.5rem; + padding: 0.3rem; + } +} diff --git a/src/components/ChatBubble/ChatBubble.tsx b/src/components/ChatBubble/ChatBubble.tsx new file mode 100644 index 00000000..823c3445 --- /dev/null +++ b/src/components/ChatBubble/ChatBubble.tsx @@ -0,0 +1,45 @@ +import React, { useState } from "react" +import styles from "./ChatBubble.module.css" + +export default function ChatBubble({ + children, +}: { + children: React.ReactNode +}) { + const [copied, setCopied] = useState(false); + + const handleCopy = async () => { + try { + const textContent = typeof children === 'string' + ? children + : (children as any)?.props?.children || children?.toString() || ''; + await navigator.clipboard.writeText(textContent); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + } catch (err) { + console.error('Failed to copy text: ', err); + } + }; + + return ( +
+
{children}
+ +
+ ) +} diff --git a/src/components/ChatBubble/index.ts b/src/components/ChatBubble/index.ts new file mode 100644 index 00000000..919031d1 --- /dev/null +++ b/src/components/ChatBubble/index.ts @@ -0,0 +1 @@ +export { default } from "./ChatBubble" diff --git a/src/components/DarkCodeBlock/DarkCodeBlock.module.css b/src/components/DarkCodeBlock/DarkCodeBlock.module.css new file mode 100644 index 00000000..bc4118ad --- /dev/null +++ b/src/components/DarkCodeBlock/DarkCodeBlock.module.css @@ -0,0 +1,144 @@ +.codeBlock { + margin: 1rem 0; + border-radius: 8px; + overflow: hidden; + background-color: #1a1a1a; + border: 1px solid #333; + font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace; + position: relative; +} + +/* Add border for dark theme */ +[data-theme="dark"] .codeBlock { + border: 1px solid #444; +} + +.codeHeader { + background-color: #1a1a1a; + padding: 0.75rem 1rem; + border-bottom: 1px solid #333; + color: #888; + font-size: 0.875rem; + font-weight: 400; + font-style: italic; +} + +.codeTitle { + color: #888; + font-style: italic; +} + +.codeContainer { + position: relative; + background-color: #1a1a1a; +} + +.codeContent { + margin: 0; + padding: 1rem; + padding-bottom: 2rem; + background-color: transparent; + color: #e6e6e6; + font-size: 0.875rem; + line-height: 1.6; + overflow-x: auto; + white-space: pre; +} + +.shortCode { + padding-bottom: 0.5rem; +} + +.codeLine { + display: block; + min-height: 1.6rem; +} + +.copyButtonContainer { + background-color: #1a1a1a; + padding: 0.75rem 1rem; + display: flex; + justify-content: flex-end; + cursor: pointer; +} + +.copyButton { + background-color: #333; + color: #fff; + border: 1px solid #333; + border-radius: 4px; + padding: 0.5rem 0.75rem; + font-size: 0.75rem; + cursor: pointer; + display: flex; + align-items: center; + gap: 0.5rem; + transition: all 0.2s ease; + font-family: inherit; + width: 100%; + justify-content: flex-end; +} + +.copyButton:hover { + background-color: #333; + color: #fff; + border-color: #666; +} + +.copyButton:active { + transform: scale(0.98); +} + +.copyButton svg { + width: 14px; + height: 14px; +} + +.codeContent :global(.keyword) { + color: #4fc1ff; + font-weight: 400; +} + +.codeContent :global(.comment) { + color: #6a9955; + font-style: italic; +} + +.codeContent :global(.string) { + color: #ff6b9d; +} + +.codeContent :global(.function) { + color: #ffab70; + font-weight: 400; +} + +.codeContent :global(.number) { + color: #53FFE8; +} + +.codeContent :global(.header) { + color: #e6e6e6; + font-style: italic; +} + +@media (max-width: 768px) { + .codeContent { + font-size: 0.8rem; + padding: 0.75rem; + padding-bottom: 3rem; + } + + .shortCode { + padding-bottom: 0.3rem; + } + + .copyButton { + font-size: 0.7rem; + padding: 0.4rem 0.6rem; + } + + .copyButtonContainer { + padding: 0.5rem 0.75rem; + } +} diff --git a/src/components/DarkCodeBlock/DarkCodeBlock.tsx b/src/components/DarkCodeBlock/DarkCodeBlock.tsx new file mode 100644 index 00000000..0428c180 --- /dev/null +++ b/src/components/DarkCodeBlock/DarkCodeBlock.tsx @@ -0,0 +1,186 @@ +import React, { useState, useMemo } from 'react'; +import styles from './DarkCodeBlock.module.css'; + +interface DarkCodeBlockProps { + children: string; + language?: string; + title?: string; +} + +const DarkCodeBlock: React.FC = ({ + children, + language = 'python', + title +}) => { + const [copied, setCopied] = useState(false); + + const handleCopy = async () => { + try { + await navigator.clipboard.writeText(children); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + } catch (err) { + console.error('Failed to copy text: ', err); + } + }; + + const KEYWORDS = useMemo(() => ['def', 'return', 'if', 'else', 'elif', 'for', 'while', 'class', 'import', 'from', 'as', 'try', 'except', 'finally', 'with', 'pass', 'break', 'continue', 'and', 'or', 'not', 'in', 'is', 'lambda', 'yield', 'global', 'nonlocal', 'assert', 'del', 'raise', 'True', 'False', 'None'], []); + + const highlightedCode = useMemo(() => { + const highlightCode = (code: string, lang: string) => { + const lines = code.trim().split('\n'); + const isShortCode = lines.length <= 3; + + return lines.map((line, index) => { + if (lang === 'python') { + const tokens = []; + let i = 0; + const text = line; + + while (i < text.length) { + if (/\s/.test(text[i])) { + let start = i; + while (i < text.length && /\s/.test(text[i])) i++; + tokens.push({ type: 'whitespace', value: text.substring(start, i) }); + continue; + } + + if (text[i] === '#') { + const commentText = text.substring(i); + if (index === 0 && commentText.includes('.py')) { + tokens.push({ type: 'header', value: commentText }); + } else { + tokens.push({ type: 'comment', value: commentText }); + } + break; + } + + if (text.substring(i, i + 3) === '"""' || text.substring(i, i + 3) === "'''") { + const quote = text.substring(i, i + 3); + let end = i + 3; + while (end < text.length - 2 && text.substring(end, end + 3) !== quote) { + end++; + } + if (end < text.length - 2) end += 3; + tokens.push({ type: 'string', value: text.substring(i, end) }); + i = end; + continue; + } + + if (text[i] === '"' || text[i] === "'") { + const quote = text[i]; + let end = i + 1; + while (end < text.length && text[end] !== quote) { + if (text[end] === '\\') end += 2; + else end++; + } + if (end < text.length) end++; + tokens.push({ type: 'string', value: text.substring(i, end) }); + i = end; + continue; + } + + if (/\d/.test(text[i])) { + let start = i; + while (i < text.length && /[\d.]/.test(text[i])) i++; + tokens.push({ type: 'number', value: text.substring(start, i) }); + continue; + } + + if (/[a-zA-Z_]/.test(text[i])) { + let start = i; + while (i < text.length && /[a-zA-Z0-9_]/.test(text[i])) i++; + const word = text.substring(start, i); + + if (KEYWORDS.includes(word)) { + tokens.push({ type: 'keyword', value: word }); + } else { + const prevKeywordToken = tokens.filter(t => t.type !== 'whitespace').pop(); + if (prevKeywordToken && prevKeywordToken.value === 'def') { + tokens.push({ type: 'function', value: word }); + } else { + tokens.push({ type: 'identifier', value: word }); + } + } + continue; + } + + tokens.push({ type: 'operator', value: text[i] }); + i++; + } + + const htmlParts = tokens.map(token => { + switch (token.type) { + case 'keyword': + return `${token.value}`; + case 'string': + return `${token.value}`; + case 'function': + return `${token.value}`; + case 'number': + return `${token.value}`; + case 'comment': + return `${token.value}`; + case 'header': + return `${token.value}`; + case 'whitespace': + case 'operator': + case 'identifier': + default: + return token.value; + } + }); + + return ( +
+ +
+ ); + } + + return ( +
+ {line} +
+ ); + }); + }; + + return highlightCode(children, language); + }, [children, language, KEYWORDS]); + + const lineCount = children.trim().split('\n').length; + const isShortCode = lineCount <= 3; + + return ( +
+ {title && ( +
+ {title} +
+ )} +
+
+          
+            {highlightedCode}
+          
+        
+
+ +
+
+
+ ); +}; + +export default DarkCodeBlock; diff --git a/src/components/DarkCodeBlock/index.ts b/src/components/DarkCodeBlock/index.ts new file mode 100644 index 00000000..ee453e50 --- /dev/null +++ b/src/components/DarkCodeBlock/index.ts @@ -0,0 +1 @@ +export { default } from './DarkCodeBlock'; \ No newline at end of file diff --git a/src/components/InfoBox/InfoBox.module.css b/src/components/InfoBox/InfoBox.module.css new file mode 100644 index 00000000..4a64d05f --- /dev/null +++ b/src/components/InfoBox/InfoBox.module.css @@ -0,0 +1,36 @@ +.infoBox { + border: 2px solid var(--imf-color-border-orange); + border-radius: 12px; + background: var(--imf-color-background-orange-light); + padding: 0.7em; +} + +.infoBox p { + margin: 0rem; +} + +.infoBox a { + color: var(--ifm-color-primary); + text-decoration: none; +} + +.infoBox a:hover { + text-decoration: underline; +} + +/* Responsive design */ +@media (max-width: 768px) { + .infoBox { + padding: 0.6em; + border-radius: 10px; + font-size: 0.95rem; + } +} + +@media (max-width: 480px) { + .infoBox { + padding: 0.5em; + border-radius: 8px; + font-size: 0.9rem; + } +} diff --git a/src/components/InfoBox/InfoBox.tsx b/src/components/InfoBox/InfoBox.tsx new file mode 100644 index 00000000..988d193f --- /dev/null +++ b/src/components/InfoBox/InfoBox.tsx @@ -0,0 +1,15 @@ +import React from "react" +import styles from "./InfoBox.module.css" + +interface InfoBoxProps { + children: React.ReactNode + className?: string +} + +export const InfoBox: React.FC = ({ children, className }) => { + return ( +
{children}
+ ) +} + +export default InfoBox diff --git a/src/components/InfoBox/index.ts b/src/components/InfoBox/index.ts new file mode 100644 index 00000000..7e71df22 --- /dev/null +++ b/src/components/InfoBox/index.ts @@ -0,0 +1 @@ +export { default, InfoBox } from "./InfoBox" diff --git a/src/components/ListItems/ListItems.module.css b/src/components/ListItems/ListItems.module.css new file mode 100644 index 00000000..f724eb21 --- /dev/null +++ b/src/components/ListItems/ListItems.module.css @@ -0,0 +1,160 @@ +.crFeatureCard { + background: var(--imf-list-card-background-color); + border-radius: 8px; + padding: 1.3rem; + margin: 0.8rem 0; +} + +.crNestedList { + margin: 0.5rem 0; + padding: 0; + background: none; + border: none; +} + +.crNestedList .crFeatureList li { + padding-left: 2rem; +} + +.crNestedList .crFeatureList li:before { + left: 0.5rem; +} + +/* Second level nesting - square bullets */ +.crNestedLevel2 li:before { + border-radius: 0 !important; + width: 0.3em !important; + height: 0.3em !important; + top: 0.65em !important; + background: #333 !important; +} + +.crNestedList .crNestedLevel2 li { + padding-left: 2.5rem; +} + +.crNestedList .crNestedLevel2 li:before { + left: 0.7rem; +} + +.crFeatureList { + list-style: none; + margin: 0; + padding: 0; +} + +.crOrderedList { + list-style: decimal; + margin: 0; + padding-left: 1.5em; +} + +.crFeatureList li { + position: relative; + padding-left: 1.7em; + margin-bottom: 1em; + font-size: 1.08rem; + line-height: 1.6; +} + +.crFeatureList li:last-child { + margin-bottom: 0; +} + +.crOrderedList li { + margin-bottom: 1em; + font-size: 1.08rem; + line-height: 1.6; + padding-left: 0.3em; +} + +.crOrderedList li:last-child { + margin-bottom: 0; +} + +.crFeatureList li:before { + content: ""; + position: absolute; + left: 0.3em; + top: 0.6em; + width: 0.4em; + height: 0.4em; + background: #333; + border-radius: 50%; + display: inline-block; +} + +.crFeatureList li a { + color: var(--ifm-color-primary, orange); + text-decoration: none; + font-weight: 500; +} + +.crOrderedList li a { + color: var(--ifm-color-primary, orange); + text-decoration: none; + font-weight: 500; +} + +.crFeatureList li a:hover { + text-decoration: underline; +} + +.crOrderedList li a:hover { + text-decoration: underline; +} + +/* Responsive design */ +@media (max-width: 768px) { + .crFeatureCard { + padding: 1rem; + margin: 0.6rem 0; + } + + .crFeatureList li { + padding-left: 1.5em; + margin-bottom: 0.8em; + font-size: 1rem; + } + + .crOrderedList li { + margin-bottom: 0.8em; + font-size: 1rem; + padding-left: 0.2em; + } + + .crNestedList .crFeatureList li { + padding-left: 1.8rem; + } + + .crNestedList .crNestedLevel2 li { + padding-left: 2.2rem; + } +} + +@media (max-width: 480px) { + .crFeatureCard { + padding: 0.8rem; + margin: 0.5rem 0; + } + + .crFeatureList li { + padding-left: 1.3em; + margin-bottom: 0.7em; + font-size: 0.95rem; + } + + .crOrderedList li { + margin-bottom: 0.7em; + font-size: 0.95rem; + padding-left: 0.15em; + } + + .crNestedList .crFeatureList li { + padding-left: 1.6rem; + } + + .crNestedList .crNestedLevel2 li { + padding-left: 2rem; + } +} diff --git a/src/components/ListItems/ListItems.tsx b/src/components/ListItems/ListItems.tsx new file mode 100644 index 00000000..67231379 --- /dev/null +++ b/src/components/ListItems/ListItems.tsx @@ -0,0 +1,43 @@ +import React from "react" +import styles from "./ListItems.module.css" + +interface ListItemsProps { + items: React.ReactNode[] + className?: string + orderedList?: boolean + nested?: boolean + nestingLevel?: number +} + +export const ListItems: React.FC = ({ + items, + className, + orderedList = false, + nested = false, + nestingLevel = 1, +}) => { + const ListTag = orderedList ? "ol" : "ul" + + // Determine list class based on nesting level + let listClassName = orderedList ? styles.crOrderedList : styles.crFeatureList + if (nested && nestingLevel > 1) { + listClassName = `${listClassName} ${styles.crNestedLevel2}` + } + + // Use different wrapper class for nested lists + const wrapperClassName = nested + ? `${styles.crNestedList} ${className || ""}` + : `${styles.crFeatureCard} ${className || ""}` + + return ( +
+ + {items.map((item, index) => ( +
  • {item}
  • + ))} +
    +
    + ) +} + +export default ListItems diff --git a/src/components/ListItems/index.ts b/src/components/ListItems/index.ts new file mode 100644 index 00000000..e4d4326c --- /dev/null +++ b/src/components/ListItems/index.ts @@ -0,0 +1 @@ +export { default, ListItems } from "./ListItems" diff --git a/src/components/Note/Note.module.css b/src/components/Note/Note.module.css new file mode 100644 index 00000000..87c13129 --- /dev/null +++ b/src/components/Note/Note.module.css @@ -0,0 +1,115 @@ +.note { + display: flex; + flex-direction: column; + align-items: flex-start; + background: var(--imf-note-background-color); + border: 2px solid var(--imf-note-border-color); + border-radius: 8px; + padding: 1rem 1.2rem; + margin: 1.2rem 0; + font-size: 1rem; +} + +.header { + display: flex; + align-items: center; + margin-bottom: 0.3em; +} + +.icon { + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + flex-shrink: 0; +} + +.title { + font-weight: 600; + color: var(--imf-note-text-color); +} + +.text { + margin-top: 0.2em; +} +.note.text p { + margin: 0px; +} +.note a { + color: var(--imf-note-text-color); +} +.note p { + margin: 0rem; +} + +/* Remove white background from ListItems inside Note - more aggressive approach */ +.note :global(.crFeatureCard) { + background: transparent !important; + background-color: transparent !important; + border: none !important; + padding: 0.5rem 0 !important; + margin: 0.5rem 0 !important; + box-shadow: none !important; +} + +/* Also target nested ListItems */ +.note :global(.crNestedList) { + background: transparent !important; + background-color: transparent !important; + border: none !important; +} + +/* Force override CSS variables for ListItems inside Note */ +.note { + --imf-list-card-background-color: transparent; + --ifm-background-color-secondary: transparent; +} + +/* Target any div containing ListItems inside Note */ +.note div:has(:global(.crFeatureCard)) { + background: transparent !important; + background-color: transparent !important; + border: none !important; +} + +/* Alternative approach - target all divs inside note that contain lists */ +.note > div { + background: inherit !important; + background-color: inherit !important; +} + +/* Responsive design */ +@media (max-width: 768px) { + .note { + padding: 0.8rem 1rem; + margin: 1rem 0; + font-size: 0.95rem; + } + + .icon { + width: 1.3em; + height: 1.3em; + margin-right: 0.4em; + } + + .title { + font-size: 0.95rem; + } +} + +@media (max-width: 480px) { + .note { + padding: 0.7rem 0.8rem; + margin: 0.8rem 0; + font-size: 0.9rem; + } + + .icon { + width: 1.2em; + height: 1.2em; + margin-right: 0.3em; + } + + .title { + font-size: 0.9rem; + } +} diff --git a/src/components/Note/Note.tsx b/src/components/Note/Note.tsx new file mode 100644 index 00000000..10ce1247 --- /dev/null +++ b/src/components/Note/Note.tsx @@ -0,0 +1,18 @@ +import React from "react" +import styles from "./Note.module.css" + +interface NoteProps { + children: React.ReactNode +} + +const Note: React.FC = ({ children }) => ( +
    +
    + Note + Note +
    +
    {children}
    +
    +) + +export default Note diff --git a/src/components/Note/index.ts b/src/components/Note/index.ts new file mode 100644 index 00000000..dd6db3eb --- /dev/null +++ b/src/components/Note/index.ts @@ -0,0 +1 @@ +export { default } from "./Note" diff --git a/src/components/OrderedSteps.tsx b/src/components/OrderedSteps.tsx new file mode 100644 index 00000000..505ed5c8 --- /dev/null +++ b/src/components/OrderedSteps.tsx @@ -0,0 +1,11 @@ +import React from "react" + +export default function OrderedSteps({ children }) { + return ( +
      + {React.Children.map(children, (child, idx) => ( +
    1. {child}
    2. + ))} +
    + ) +} diff --git a/src/components/PlatformCard/PlatformCard.module.css b/src/components/PlatformCard/PlatformCard.module.css new file mode 100644 index 00000000..8b710ed5 --- /dev/null +++ b/src/components/PlatformCard/PlatformCard.module.css @@ -0,0 +1,18 @@ +.platformCard { + display: flex; + align-items: center; + background: var(--imf-list-card-background-color); + border-radius: 8px; + padding: 1.3rem; + border: 2px solid var(--ifm-background-color-secondary); +} + +.platformIcon { + width: 32px; + height: 32px; + margin-right: 16px; +} + +[data-theme="dark"] .platformIcon { + filter: invert(1); +} diff --git a/src/components/PlatformCard/PlatformCard.tsx b/src/components/PlatformCard/PlatformCard.tsx new file mode 100644 index 00000000..d94b7ff0 --- /dev/null +++ b/src/components/PlatformCard/PlatformCard.tsx @@ -0,0 +1,23 @@ +import React from "react" +import styles from "./PlatformCard.module.css" + +interface PlatformCardProps { + imageSrc: string + name: string + className?: string +} + +export const PlatformCard: React.FC = ({ + imageSrc, + name, + className, +}) => { + return ( +
    + {name} + {name} +
    + ) +} + +export default PlatformCard diff --git a/src/components/PlatformCard/index.ts b/src/components/PlatformCard/index.ts new file mode 100644 index 00000000..ca2c1258 --- /dev/null +++ b/src/components/PlatformCard/index.ts @@ -0,0 +1 @@ +export { PlatformCard, default } from "./PlatformCard" diff --git a/src/components/PlatformGrid/PlatformGrid.module.css b/src/components/PlatformGrid/PlatformGrid.module.css new file mode 100644 index 00000000..dcef77a3 --- /dev/null +++ b/src/components/PlatformGrid/PlatformGrid.module.css @@ -0,0 +1,6 @@ +.platformGrid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1rem; + margin: 1.5rem 0; +} diff --git a/src/components/PlatformGrid/PlatformGrid.tsx b/src/components/PlatformGrid/PlatformGrid.tsx new file mode 100644 index 00000000..706d006a --- /dev/null +++ b/src/components/PlatformGrid/PlatformGrid.tsx @@ -0,0 +1,20 @@ +import React from "react" +import styles from "./PlatformGrid.module.css" + +interface PlatformGridProps { + children: React.ReactNode + className?: string +} + +export const PlatformGrid: React.FC = ({ + children, + className, +}) => { + return ( +
    + {children} +
    + ) +} + +export default PlatformGrid diff --git a/src/components/PlatformGrid/index.ts b/src/components/PlatformGrid/index.ts new file mode 100644 index 00000000..843327a1 --- /dev/null +++ b/src/components/PlatformGrid/index.ts @@ -0,0 +1 @@ +export { PlatformGrid, default } from "./PlatformGrid" diff --git a/src/components/Table/Table.module.css b/src/components/Table/Table.module.css new file mode 100644 index 00000000..4ca57887 --- /dev/null +++ b/src/components/Table/Table.module.css @@ -0,0 +1,209 @@ +.tableContainer { + margin: 1.5rem 0; +} + +.platformSection { + margin-bottom: 2rem; +} + +.platformSection:last-child { + margin-bottom: 0; +} + +.platformTitle { + margin-bottom: 1rem; + color: var(--ifm-heading-color); + font-size: 1.5rem; + font-weight: 700; +} + +.titleSection { + background: #E8E8E8 !important; + border-bottom: none !important; + border-right: none !important; + border-left: none !important; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +.titleWithText { + padding: 1rem 1.5rem !important; + height: auto; +} + +.titleEmpty { + padding: 0 !important; + height: 10px !important; + line-height: 10px !important; +} + +.titleText { + color: var(--ifm-heading-color); + font-size: 1rem; + font-weight: 600; +} + +.titleRow { + background: #E8E8E8; +} + +.table { + display: table; + width: 100%; + border-collapse: separate; + border-spacing: 0; + background: transparent; + border: none; + table-layout: fixed; + border-radius: 4px; + overflow: hidden; +} + +.table th { + background: #ffffff; + color: var(--ifm-heading-color); + padding: 1rem 1.5rem; + text-align: left; + font-weight: 600; + font-size: 1rem; + border-bottom: 1px solid var(--ifm-color-emphasis-300); + border-right: 1px solid var(--ifm-color-emphasis-300); + border-top: none; + box-sizing: border-box; + margin: 0; +} + +.table th:last-child { + border-right: none; +} + +.table th:first-child { + border-left: none; +} + +.table thead { + background: #ffffff; +} + +.table td { + padding: 1rem 1.5rem; + border-bottom: 1px solid var(--ifm-color-emphasis-300); + border-right: 1px solid var(--ifm-color-emphasis-300); + color: var(--ifm-color-content); + vertical-align: middle; + background: #ffffff; + box-sizing: border-box; +} + +.table td:last-child { + border-right: none; +} + +.table td:first-child { + border-left: none; +} + +.table tbody tr:last-child td { + border-bottom: none; +} + +.table tbody tr:hover { + background: var(--ifm-color-emphasis-50); +} + +.supportedStatus { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.supportIcon { + width: 20px; + height: 20px; + flex-shrink: 0; +} + +.supportText { + color: #5A9B8A; + font-weight: 500; +} + +/* Responsive design */ +@media (max-width: 768px) { + .table th, + .table td { + padding: 0.75rem 1rem; + font-size: 0.9rem; + } + + .platformTitle { + font-size: 1.25rem; + } + + .supportedStatus { + gap: 0.375rem; + } + + .supportIcon { + width: 18px; + height: 18px; + } + + .supportText { + font-size: 0.9rem; + } +} + +@media (max-width: 480px) { + .table th, + .table td { + padding: 0.5rem 0.75rem; + font-size: 0.85rem; + } + + .platformTitle { + font-size: 1.125rem; + } + + .supportIcon { + width: 16px; + height: 16px; + } + + .supportText { + font-size: 0.85rem; + } +} + +/* Dark mode adjustments */ +[data-theme="dark"] .table { + background: var(--ifm-background-color-secondary); + border-color: var(--ifm-color-emphasis-300); +} + +[data-theme="dark"] .table th { + background: var(--ifm-background-color-secondary); + border: none !important; +} + +[data-theme="dark"] .table td { + border: none !important; + background: var(--ifm-background-color-secondary); +} + +[data-theme="dark"] .titleSection { + background: var(--ifm-color-emphasis-200) !important; + border-bottom-color: var(--ifm-color-emphasis-300) !important; +} + +[data-theme="dark"] .titleRow { + background: var(--ifm-color-emphasis-200); +} + +[data-theme="dark"] .table tbody tr:hover { + background: var(--ifm-color-emphasis-100); +} + +[data-theme="dark"] .supportText { + color: #7CB3A3; +} \ No newline at end of file diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx new file mode 100644 index 00000000..7238fe3d --- /dev/null +++ b/src/components/Table/Table.tsx @@ -0,0 +1,89 @@ +import React from "react" +import styles from "./Table.module.css" + +interface SupportedStatusProps { + text: string + icon?: string +} + +const SupportedStatus: React.FC = ({ text, icon }) => { + return ( +
    + {icon && } + {text} +
    + ) +} + +interface TableColumn { + key: string + label: string +} + +interface TableRow { + [key: string]: React.ReactNode +} + +interface PlatformSection { + title: string + rows: TableRow[] +} + +interface TableProps { + columns: TableColumn[] + sections: PlatformSection[] + className?: string +} + +export const Table: React.FC = ({ + columns, + sections, + className, +}) => { + const columnWidth = `${100 / columns.length}%` + + return ( +
    + {sections.map((section, sectionIndex) => ( +
    +
    + + + + + + {columns.map((column) => ( + + ))} + + + + {section.rows.map((row, rowIndex) => ( + + {columns.map((column) => ( + + ))} + + ))} + +
    + {section.title && {section.title}} +
    + {column.label} +
    + {column.key === 'support' && typeof row[column.key] === 'string' && row[column.key] === 'Supported' ? ( + + ) : ( + row[column.key] + )} +
    +
    + ))} +
    + ) +} + +export default Table \ No newline at end of file diff --git a/src/components/Table/index.ts b/src/components/Table/index.ts new file mode 100644 index 00000000..f26095d5 --- /dev/null +++ b/src/components/Table/index.ts @@ -0,0 +1,2 @@ +export { default } from "./Table" +export { Table } from "./Table" \ No newline at end of file diff --git a/src/components/Tip/Tip.module.css b/src/components/Tip/Tip.module.css new file mode 100644 index 00000000..f162e5ce --- /dev/null +++ b/src/components/Tip/Tip.module.css @@ -0,0 +1,84 @@ +.tip { + display: flex; + flex-direction: column; + align-items: flex-start; + background: #FFFCFB; + border: 2px solid #FFCEB6; + border-radius: 12px; + padding: 1rem 1.2rem; + margin: 1.2rem 0; + font-size: 1rem; +} + +.header { + display: flex; + align-items: center; + margin-bottom: 0.3em; +} + +.icon { + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + flex-shrink: 0; + color: #FF570A; +} + +.title { + font-weight: 600; + color: #FF570A; + font-size: 1rem; +} + +.content { + margin-top: 0.2em; + color: var(--ifm-color-content); +} + +.tip p { + margin: 0; + line-height: 1.6; +} + +.tip p:not(:last-child) { + margin-bottom: 1rem; +} + +/* Responsive design */ +@media (max-width: 768px) { + .tip { + padding: 0.8rem 1rem; + margin: 1rem 0; + font-size: 0.95rem; + border-radius: 10px; + } + + .icon { + width: 1.3em; + height: 1.3em; + margin-right: 0.4em; + } + + .title { + font-size: 0.95rem; + } +} + +@media (max-width: 480px) { + .tip { + padding: 0.7rem 0.8rem; + margin: 0.8rem 0; + font-size: 0.9rem; + border-radius: 8px; + } + + .icon { + width: 1.2em; + height: 1.2em; + margin-right: 0.3em; + } + + .title { + font-size: 0.9rem; + } +} \ No newline at end of file diff --git a/src/components/Tip/Tip.tsx b/src/components/Tip/Tip.tsx new file mode 100644 index 00000000..c9935925 --- /dev/null +++ b/src/components/Tip/Tip.tsx @@ -0,0 +1,20 @@ +import React from "react" +import styles from "./Tip.module.css" + +interface TipProps { + children: React.ReactNode +} + +const Tip: React.FC = ({ children }) => ( +
    +
    + + + + Tip +
    +
    {children}
    +
    +) + +export default Tip \ No newline at end of file diff --git a/src/components/Tip/index.ts b/src/components/Tip/index.ts new file mode 100644 index 00000000..78c619e8 --- /dev/null +++ b/src/components/Tip/index.ts @@ -0,0 +1 @@ +export { default } from "./Tip" \ No newline at end of file diff --git a/src/components/Warning/Warning.module.css b/src/components/Warning/Warning.module.css new file mode 100644 index 00000000..f49f80c7 --- /dev/null +++ b/src/components/Warning/Warning.module.css @@ -0,0 +1,119 @@ +.warning { + display: flex; + flex-direction: column; + align-items: flex-start; + background: #FFFEFB; + border: 2px solid #f1c232; + border-radius: 8px; + padding: 1rem 1.2rem; + margin: 1.2rem 0; + font-size: 1rem; +} + +.header { + display: flex; + align-items: center; + margin-bottom: 0.3em; +} + +.icon { + width: 1em; + height: 1em; + margin-right: 0.5em; + flex-shrink: 0; +} + +.title { + font-weight: 600; + color: #B38705; +} + +.text { + margin-top: 0.2em; + color: #333; +} + +.warning .text p { + margin: 0px; +} + +.warning a { + color: #B38705; +} + +.warning p { + margin: 0rem; +} + +/* Remove white background from ListItems inside Warning - more aggressive approach */ +.warning :global(.crFeatureCard) { + background: transparent !important; + background-color: transparent !important; + border: none !important; + padding: 0.5rem 0 !important; + margin: 0.5rem 0 !important; + box-shadow: none !important; +} + +/* Also target nested ListItems */ +.warning :global(.crNestedList) { + background: transparent !important; + background-color: transparent !important; + border: none !important; +} + +/* Force override CSS variables for ListItems inside Warning */ +.warning { + --imf-list-card-background-color: transparent; + --ifm-background-color-secondary: transparent; +} + +/* Target any div containing ListItems inside Warning */ +.warning div:has(:global(.crFeatureCard)) { + background: transparent !important; + background-color: transparent !important; + border: none !important; +} + +/* Alternative approach - target all divs inside warning that contain lists */ +.warning > div { + background: inherit !important; + background-color: inherit !important; +} + +/* Responsive design */ +@media (max-width: 768px) { + .warning { + padding: 0.8rem 1rem; + margin: 1rem 0; + font-size: 0.95rem; + } + + .icon { + width: 1.3em; + height: 1.3em; + margin-right: 0.4em; + } + + .title { + font-size: 0.95rem; + } +} + +@media (max-width: 480px) { + .warning { + padding: 0.7rem 0.8rem; + margin: 0.8rem 0; + font-size: 0.9rem; + } + + .icon { + width: 1.2em; + height: 1.2em; + margin-right: 0.3em; + } + + .title { + font-size: 0.9rem; + } +} \ No newline at end of file diff --git a/src/components/Warning/Warning.tsx b/src/components/Warning/Warning.tsx new file mode 100644 index 00000000..318ddba1 --- /dev/null +++ b/src/components/Warning/Warning.tsx @@ -0,0 +1,18 @@ +import React from "react" +import styles from "./Warning.module.css" + +interface WarningProps { + children: React.ReactNode +} + +const Warning: React.FC = ({ children }) => ( +
    +
    + Warning + Warning +
    +
    {children}
    +
    +) + +export default Warning \ No newline at end of file diff --git a/src/components/Warning/index.ts b/src/components/Warning/index.ts new file mode 100644 index 00000000..07e3da26 --- /dev/null +++ b/src/components/Warning/index.ts @@ -0,0 +1 @@ +export { default as Warning } from "./Warning" \ No newline at end of file diff --git a/src/css/custom.css b/src/css/custom.css index 7365089e..27d4e5b3 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -41,6 +41,16 @@ --ifm-background-color-primary: #f6f6f1; --ifm-background-color-secondary: #e8e8e8; --ifm-breadcrumb-item-background-active: #ffe9e2; + --imf-list-card-background-color: #ffffff; + --imf-list-bullets-color: #25bab1; + --imf-color-background-orange-light: #fffcfb; + --imf-color-border-orange: #ffceb6; + --imf-note-border-color: #25bab1; + --imf-note-background-color: #f1fffe; + --imf-note-text-color: #208682; + --imf-text-color-bg: #e8e8e8; + --imf-text-color: #171717; + --imf-text-button-color-bg: #e8e8e8; } [data-theme="dark"] { @@ -55,6 +65,15 @@ --ifm-background-color-primary: #171717; --ifm-background-color-secondary: #232323; --ifm-breadcrumb-item-background-active: #3f322e; + --imf-list-card-background-color: #232323; + --imf-list-bullets-color: #208682; + --imf-color-background-orange-light: #232323; + --imf-color-border-orange: #232323; + --imf-note-border-color: #208682; + --imf-note-background-color: #252828; + --imf-text-color-bg: #232323; + --imf-text-color: #f5f5f5; + --imf-text-button-color-bg: #232323; } #__docusaurus { @@ -73,27 +92,6 @@ a[docid="docs"] > svg { display: none; } -/* Adjustments for mobile view */ -@media (max-width: 768px) { - /* Reduce the logo size for smaller screens */ - .navbar__logo img { - height: 32px; - align-items: center; - } - - /* Reduce the padding around the logo for smaller screens */ - .navbar__logo { - padding: 2px; /* Adjust the padding for smaller screens */ - } -} - -/* Center the Discord link within its parent */ -.navbar__items.navbar__items--right { - display: flex; - justify-content: center; - align-items: center; -} - [data-theme="light"] img[src$="#gh-dark-mode-only"], [data-theme="dark"] img[src$="#gh-light-mode-only"] { display: none; @@ -129,7 +127,14 @@ a[docid="docs"] > svg { display: none; } -/* Adjustments for mobile view */ +/* Center the Discord link within its parent */ +.navbar__items.navbar__items--right { + display: flex; + justify-content: center; + align-items: center; +} + +/* Consolidated mobile view adjustments */ @media (max-width: 768px) { /* Reduce the logo size for smaller screens */ .navbar__logo img { @@ -139,15 +144,13 @@ a[docid="docs"] > svg { /* Reduce the padding around the logo for smaller screens */ .navbar__logo { - padding: 2px; /* Adjust the padding for smaller screens */ + padding: 2px; } -} -/* Center the Discord link within its parent */ -.navbar__items.navbar__items--right { - display: flex; - justify-content: center; - align-items: center; + /* Content padding for mobile */ + .markdown { + padding-left: 1rem; + } } /* Light mode Discord icon */ @@ -304,6 +307,17 @@ a[docid="docs"] > svg { .pagination-nav { display: none; } +.language-text { + background-color: var(--imf-text-color-bg) !important; +} +.language-text .token-line { + color: var(--imf-text-color) !important; +} +.language-text [class*="buttonGroup"] button { + background-color: var(--imf-text-color-bg) !important; + color: var(--imf-text-color) !important; + border-radius: 4px; +} /* ===== MARKDOWN STYLES ===== */ .theme-doc-markdown.markdown { line-height: 1.8rem; @@ -335,3 +349,19 @@ a[docid="docs"] > svg { cursor: default; background-color: var(--ifm-breadcrumb-item-background-active); } + +/* Add left spacing to main content */ +.markdown { + padding-left: 1.5rem; +} + +/* Align numbered lists with other content */ +.markdown ol { + padding-left: 1.2rem; + margin-left: 0; +} + +.markdown ol > li { + margin-left: 0; + padding-left: 0.5rem; +} diff --git a/static/img/Icons/Icons.png b/static/img/Icons/Icons.png new file mode 100644 index 00000000..4fd5b868 Binary files /dev/null and b/static/img/Icons/Icons.png differ diff --git a/static/img/Icons/Tip.png b/static/img/Icons/Tip.png new file mode 100644 index 00000000..8cfb10cb Binary files /dev/null and b/static/img/Icons/Tip.png differ diff --git a/static/img/Icons/Vector.png b/static/img/Icons/Vector.png new file mode 100644 index 00000000..cec316fe Binary files /dev/null and b/static/img/Icons/Vector.png differ diff --git a/static/img/Icons/Warning.png b/static/img/Icons/Warning.png new file mode 100644 index 00000000..73aecee6 Binary files /dev/null and b/static/img/Icons/Warning.png differ diff --git a/static/img/overview/Azure.png b/static/img/overview/Azure.png new file mode 100644 index 00000000..6e8b02ee Binary files /dev/null and b/static/img/overview/Azure.png differ diff --git a/static/img/overview/Bitbucket.png b/static/img/overview/Bitbucket.png new file mode 100644 index 00000000..0f349913 Binary files /dev/null and b/static/img/overview/Bitbucket.png differ diff --git a/static/img/overview/Github.png b/static/img/overview/Github.png new file mode 100644 index 00000000..cfe4be2e Binary files /dev/null and b/static/img/overview/Github.png differ diff --git a/static/img/overview/Gitlab.png b/static/img/overview/Gitlab.png new file mode 100644 index 00000000..9ed9a1a8 Binary files /dev/null and b/static/img/overview/Gitlab.png differ diff --git a/static/img/overview/Jira.png b/static/img/overview/Jira.png new file mode 100644 index 00000000..abb1c8b1 Binary files /dev/null and b/static/img/overview/Jira.png differ diff --git a/static/img/overview/Linear.png b/static/img/overview/Linear.png new file mode 100644 index 00000000..8960789c Binary files /dev/null and b/static/img/overview/Linear.png differ