Skip to content

Commit c656b6c

Browse files
authored
Merge branch 'main' into PrasadBhat4/navigation-ui-improvements
2 parents 348f9ed + 981b7e0 commit c656b6c

19 files changed

+274
-128
lines changed

docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ import ProPlanNotice from "@site/src/components/ProPlanNotice.mdx"
250250

251251
New and Improved Dashboards to provide more useful feedback such as:
252252

253-
- Avgerage PR Merge Time
253+
- Average PR Merge Time
254254
- Weekly Pull Request Activity
255255
- Number of PRs Reviewed
256256
- Acceptance rate of CodeRabbit Suggestions

docs/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ CodeRabbit works with all programming languages, with varying proficiency based
6363
- Available training data
6464
- Community usage patterns
6565

66-
### Whats the difference between CodeRabbit Code Reviews and CodeRabbit Reports?
66+
### What's the difference between CodeRabbit Code Reviews and CodeRabbit Reports?
6767

6868
CodeRabbit offers two distinct features that serve different roles in your development workflow:
6969

docs/guides/configuration-overview.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,13 @@ This means that configuration is not merged or inherited - the highest priority
7272

7373
The [Initial configuration guide](/guides/initial-configuration) tours you through several settings that we
7474
recommend that you review after you set up CodeRabbit with your organization.
75+
76+
## Learnings {#learnings}
77+
78+
As a complement to the configuration methods listed above, CodeRabbit keeps an internal database with _learnings_ that it collects about your team's code review preferences, based on your interactions with the CodeRabbit bot over time. CodeRabbit learnings let you fine-tune the ways that CodeRabbit conducts its code reviews in ways that are highly specific to your repositories, and your team's coding styles.
79+
80+
For more information, see [Teach CodeRabbit your review preferences](/guides/learnings).
81+
82+
## What's next {#whats-next}
83+
84+
- [Initial configuration guide](/guides/initial-configuration)

docs/guides/custom-reports.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Contained within the `<pr_details>` tag.
103103
#### Summarized PR Details
104104

105105
- `<pr_description>`: string - Contains the body of your pull request (aka the PR description at the top of the PR page).
106-
- `<file_changes_summary>`: string - Contains a file by file summary of the changes made in the PR in markdown format. This summary is generated by CodeRabbit AI durring the PR review process. This includes several sections for each file that was changed:
106+
- `<file_changes_summary>`: string - Contains a file by file summary of the changes made in the PR in markdown format. This summary is generated by CodeRabbit AI during the PR review process. This includes several sections for each file that was changed:
107107
- `filename`: string - The name of the file that was changed.
108108
- `AI-generated summary of changes`: markdown - An overall summary of the changes made in the file.
109109
- `Alterations to the declarations of exported or public entities`: markdown - A more specific breakdown of the changes made to the file such as exactly what was added, removed, or modified.
@@ -307,9 +307,9 @@ Issues and tickets brings in conversations, descriptions, and comments from Jira
307307

308308
This option gives you the ability to create a report limited only to pull requests containing a "Score Card" or "Score Chart" bot comment from CodeRabbit or other bots. To enable issues and tickets you must include the tag `<pr_score_card>` in your prompt.
309309

310-
> **IMPORTANT:** This will automatically remove any pull requests from your reports if they do not contain a "Score Card" or "Score Chart" bot comment. Using this option without setting up a flow to create these comments will result in `No new pull request activity in the last XYZ hours` errors. Do not enable this option unless you have asked coderabbit to create a "Score Card" thourhg a comment or implimented the "Score Chart" bot comment flow below.
310+
> **IMPORTANT:** This will automatically remove any pull requests from your reports if they do not contain a "Score Card" or "Score Chart" bot comment. Using this option without setting up a flow to create these comments will result in `No new pull request activity in the last XYZ hours` errors. Do not enable this option unless you have asked CodeRabbit to create a "Score Card" through a comment or implemented the "Score Chart" bot comment flow below.
311311
312-
For example you can ask coderabbit to check serveral conditions on a pull request and produce a "Score Chart":
312+
For example, you can ask CodeRabbit to check several conditions on a pull request and produce a "Score Chart":
313313

314314
<details>
315315
<summary>Click to view example User Score Card/Chart Comment:</summary>
@@ -461,7 +461,7 @@ You will create a new chart averaging all the values from various pull requests
461461
- Only include checks for very specific scenarios, such as a specific check failing or using tabs vs spaces.
462462
- Do not use general rules without explaining specifically what they mean. If you add "Insure the pull request follows development best practices" you must define what "development best practices" actually mean or the AI will guess.
463463
- Make one point for each specific check and make sure its a True/False condition.
464-
- Instead of manually commenting on pull requests you can use the [Github Actions Bot](https://github.com/marketplace/actions/create-or-update-comment) to automatically comment on pull requests and trigger coderabbit score card/chart comments by including `@coderabbit` in the comment.
464+
- Instead of manually commenting on pull requests, you can use the [GitHub Actions Bot](https://github.com/marketplace/actions/create-or-update-comment) to automatically comment on pull requests and trigger CodeRabbit score card/chart comments by including `@coderabbitai` in the comment.
465465

466466
## Best Practices
467467

docs/guides/initial-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ For more information, see
5757

5858
### Configure learnings {#learnings}
5959

60-
CodeRabbit learns your team's review preferences by letting you [teach it your preferences in plain language during code reviews](/integrations/knowledge-base#learnings). CodeRabbit remembers these preferences, and applies them to subsequent code reviews in the same repository.
60+
CodeRabbit learns your team's review preferences by letting you [teach it your preferences in plain language during code reviews](/guides/learnings). CodeRabbit remembers these preferences, and applies them to subsequent code reviews in the same repository.
6161

6262
This setting lets you set the scope of which stored learnings that CodeRabbit should apply to its code reviews. For more information, see [Learnings](/reference/configuration#learnings) in the configuration reference.
6363

docs/guides/learnings.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
title: Teach CodeRabbit your review preferences
3+
description: An overview of the CodeRabbit learnings feature.
4+
---
5+
6+
This page describes how you can configure the code-review behavior of CodeRabbit using natural-language
7+
chat.
8+
9+
For a conceptual overview of CodeRabbit configuration methods, see [Configure CodeRabbit](/guides/configuration-overview). For more information about performing code reviews with CodeRabbit, see
10+
[Review pull requests](/guides/code-review-overview).
11+
12+
## About CodeRabbit learnings {#about}
13+
14+
As your team works with CodeRabbit, it learns your team's code-review
15+
preferences based on chat interactions, and adds these preferences
16+
to an internal database that it associates with your Git platform organization. We call these internal records _learnings_.
17+
18+
<div class="video-container">
19+
<iframe src="https://www.youtube.com/embed/Yu0cmmOYA-U?si=WIeOxqPw4ZFFgvlw" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen></iframe>
20+
</div>
21+
22+
CodeRabbit learnings are flexible, natural-language statements about code-review preferences whose purpose can include the following:
23+
24+
- Special instructions about reviewing particular files.
25+
- Guidance for reviewing all of the files of one repository.
26+
- Code-review preferences that CodeRabbit must apply across all of your organization's repositories.
27+
28+
Every time CodeRabbit prepares to add a comment to a pull request or issue, it loads all of the learnings that it has collected about your organization's code review preferences. CodeRabbit applies these learnings as additional context or instructions for its comment.
29+
30+
CodeRabbit learnings complement the more traditional configuration that you set for your organization and its repositories using the CodeRabbit web interface or [`.coderabbit.yaml` files](/getting-started/configure-coderabbit). Learnings give you a convenient way to quickly set or correct the behavior of CodeRabbit in ways that are highly specific to your team's coding style, or in ways that the CodeRabbit configuration options don't otherwise account for.
31+
32+
You can review and edit your organization's CodeRabbit learnings at any time, as detailed later in this page.
33+
34+
## Add learnings {#add}
35+
36+
To add learnings to the database CodeRabbit keeps about your organization's preferences, communicate
37+
your preferences directly to the appropriate CodeRabbit service account using natural language, in a comment attached to any pull request or issue. For more information about chatting with CodeRabbit using comments, see [CodeRabbit chat](/guides/agent_chat/).
38+
39+
If CodeRabbit decides to create one or more learnings based on a comment, then it makes this explicit in its response to that comment by adding a collapsible section titled **Learnings Added** to its own response comment.
40+
41+
### An example of adding a learning {#example}
42+
43+
Imagine a scenario where CodeRabbit has reviewed a GitHub-based pull request from your team that adds a feature to an authentication middleware library. CodeRabbit has flagged a certain file as needing improvement, attaching this comment to the relevant lines in its review:
44+
45+
> Consider using nested try-catch blocks here to handle different error scenarios more comprehensively.
46+
47+
If this critique disagrees with your team's coding practices specific to try-catch blocks, then you can reply to this CodeRabbit using a comment of your own, addressed to the `@coderabbitai` service account on GitHub:
48+
49+
> @coderabbitai Actually, we've found that nested try-catch blocks make our auth middleware harder to debug in production. We prefer early returns with specific error codes - it's cleaner and our monitoring tools can track them better.
50+
51+
CodeRabbit considers your reply, and decides to make a learning out of it. It acknowledges this in another reply:
52+
53+
> You're absolutely right about the debugging benefits. Early returns with specific error codes do provide better clarity and monitoring capabilities. I'll remember this preference for your authentication middleware. Thank you for the guidance!
54+
55+
CodeRabbit also adds a **Learnings added** section to this comment, making explicit the fact that this chat has modified its future behavior with your team.
56+
57+
CodeRabbit then creates a new learnings record for itself. Along with metadata such as the pull request number, filename, and GitHub user associated with the learning, CodeRabbit adds this self-instructive text to the new record:
58+
59+
> In authentication middleware, prefer returning early with specific error codes rather than nested try-catch blocks. This improves readability and makes error tracking easier in production environments.
60+
61+
### Best practices for new learnings {#best-practices}
62+
63+
When communicating with CodeRabbit during an active code review, you can help make any resulting learnings more specific by replying directly to review comments that CodeRabbit has left on specific files, rather than leaving comments on the overall pull request. This gives CodeRabbit more context when considering feedback, allowing it to create more specific learnings.
64+
65+
## View learnings {#view}
66+
67+
To view the learnings that CodeRabbit has associated with your organization,
68+
follow these steps:
69+
70+
1. Visit [the CodeRabbit web interface](https://app.coderabbit.ai/settings/repositories).
71+
72+
1. In the sidebar, click **Learnings**.
73+
74+
This displays a paged list of all of the learnings associated with your organization, sorted by creation time, newest-first. To see more details about any learnings record, click its text.
75+
76+
### Filter displayed learnings {#filter}
77+
78+
Over time, the learnings that CodeRabbit gathers for your organization can become quite numerous. This can make manually browsing the full list difficult. The CodeRabbit web interface has search and filtering tools to help you find specific learnings, based on the topic of the learning text, or on other metadata.
79+
80+
To filter the displayed learnings by topic or concept, enter that topic or concept into the **Similarity search** field, and set **Top K** to the number of results you want returned. Because this is a vector-based similarity search, the returned learnings don't necessarily contain the exact text of your search terms.
81+
82+
For example, to see the top ten learnings that have to do with error reporting, enter `error reporting` into **Similarity search** and set **Top K** to `10`.
83+
84+
To filter the displayed learnings by repository, user, or file path, click **+ Filters**, and select additional criteria.
85+
86+
### Edit or delete learnings {#edit}
87+
88+
If your account has the **Admin** [CodeRabbit role](/guides/roles) with your organization, then you can freely edit the text of any stored learning, or delete it outright.
89+
90+
To edit or delete a learning, follow these steps:
91+
92+
1. Click the **Action** menu on the learning record, which resembles three dots.
93+
94+
1. Select **Edit** or **Delete**.
95+
96+
## Configure learnings storage and application {#configure}
97+
98+
CodeRabbit has several configuration options that modify the storage and application of learnings.
99+
100+
### Opt out of learnings storage {#opt-out}
101+
102+
CodeRabbit enables learnings by default. To disable learnings, modify one of the following configuration options:
103+
104+
- To disable all CodeRabbit [knowledge base](/integrations/knowledge-base) features for your organization or repository, which includes learnings, enable [the _Opt out_ setting](/reference/configuration#opt-out).
105+
106+
- To disable all CodeRabbit features that require long-term data retention about your organization's use of CodeRabbit—including learnings—disable [the _Data retention_ setting](/reference/configuration#data-retention).
107+
108+
:::warning
109+
Disabling data retention immediately and irrevocably deletes all learnings that CodeRabbit has associated with your organization.
110+
:::
111+
112+
### Specify the scope of applied learnings {#scope}
113+
114+
[The Learnings configuration setting](/reference/configuration#learnings) lets you specify the _scope_ that CodeRabbit applies to all
115+
of the learnings it has collected about your organization. You can set this option to one of the
116+
following values:
117+
118+
- **`auto`**: When reviewing a public repository, CodeRabbit applies only the learnings specific to that repository. When reviewing private repository, CodeRabbit applies all of your organization's learnings. This is the default setting.
119+
- **`global`**: CodeRabbit applies all of your organization's learnings to all code reviews.
120+
- **`local`**: CodeRabbit applies only learnings associated with code reviews' respective repositories.
121+
122+
## What's next {#whats-next}
123+
124+
- [Add review instructions](/guides/review-instructions)

docs/guides/ondemand-reports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx';
1414

1515
This page is about using the CodeRabbit API to generate on-demand reports about your organization's usage of CodeRabbit. For a conceptual overview of reports in CodeRabbit, see [Generate reports](/guides/reports-overview).
1616

17-
If you're new to CodeRabbit's reporting features, then we recommend starting with [Scheduled reports](/guides/scheduled-reports) to understand the available options and capabilities. In almost every scenario we recommend using the **Scheduled Reports** option. The **On-demand Report** does not have any additional benifits from the **Scheduled Reports** and has many limitations.
17+
If you're new to CodeRabbit's reporting features, then we recommend starting with [Scheduled reports](/guides/scheduled-reports) to understand the available options and capabilities. In almost every scenario we recommend using the **Scheduled Reports** option. The **On-demand Report** does not have any additional benefits from the **Scheduled Reports** and has many limitations.
1818

1919
## API Access
2020

docs/guides/reports-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ There are two ways to generate reports:
2626

2727
- **[On-demand Reports](/guides/ondemand-reports)**: If you want to test a report format and produce a single report once, try the "On-demand Reports" Option. You can also generate reports programmatically through our API, but we do not recommend this as the API reporting is in beta. If you want to run an **On-demand Report** more than once then you must use the **Scheduled Reports** option.
2828

29-
In almost every scenario we recommend using the **Scheduled Reports** option. The **On-demand Report** does not have any additional benifits from the **Scheduled Reports** and has many limitations.
29+
In almost every scenario we recommend using the **Scheduled Reports** option. The **On-demand Report** does not have any additional benefits from the **Scheduled Reports** and has many limitations.
3030

3131
## Customize reports using natural language {#customize}
3232

docs/guides/setup-best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Setup and configuration best practices"
3-
description: Best practices for seting up CodeRabbit.
3+
description: Best practices for setting up CodeRabbit.
44
sidebar_label: Setup and configuration
55
---
66

docs/integrations/knowledge-base.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Apply your code review preferences
2+
title: Knowledge base overview
33
description: Learn about CodeRabbit's internal knowledge base and its integrations with external services.
44
---
55

@@ -17,11 +17,7 @@ For example, you can add a comment in a PR to chat directly with CodeRabbit. `@c
1717

1818
Or you can comment directly on some lines of code in the PR. `@coderabbitai do not complain about lack of error handling here, it is handled higher up the execution stack.`
1919

20-
:::tip Video Tutorial
21-
22-
Watch our [video walkthrough on learnings](https://www.youtube.com/watch?v=Yu0cmmOYA-U) for more information.
23-
24-
:::
20+
For more information, see [Teach CodeRabbit your review preferences](/guides/learnings).
2521

2622
## Code Guidelines {#code_guidelines}
2723

0 commit comments

Comments
 (0)