You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tutorial gives you a hands-on demonstration of CodeRabbit, using a real, GitHub-based repository. It guides you through the following tasks:
11
17
12
-
1. Integrate CodeRabbit into a GitHub-based repository that you own.
13
-
1. Observe CodeRabbit perform a code review of a pull request that you initiate.
14
-
1. Converse with CodeRabbit about the code review.
15
-
1. Prompt CodeRabbit to generate its own improvements to the pull request.
18
+
<ListItems
19
+
orderedList
20
+
items={[
21
+
"Integrate CodeRabbit into a GitHub-based repository that you own.",
22
+
"Observe CodeRabbit perform a code review of a pull request that you initiate.",
23
+
"Converse with CodeRabbit about the code review.",
24
+
"Prompt CodeRabbit to generate its own improvements to the pull request.",
25
+
]}
26
+
/>
16
27
17
28
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.
18
29
19
-
For a more general overview of CodeRabbit, see [Introduction](/).
30
+
<InfoBox>
31
+
For a more general overview of CodeRabbit, see <ahref="/">Introduction</a>.
32
+
</InfoBox>
20
33
21
-
:::note
22
-
While this tutorial focuses on GitHub, CodeRabbit also works with GitLab, Azure DevOps, and Bitbucket. For more information, see [Integrate with Git platforms](/platforms/).
23
-
:::
34
+
<Note>
35
+
While this tutorial focuses on GitHub, CodeRabbit also works with GitLab,
36
+
Azure DevOps, and Bitbucket. For more information, see{""}
37
+
<ahref="/platforms/">Integrate with Git platforms</a>.
38
+
</Note>
24
39
25
40
## Before you begin
26
41
@@ -30,9 +45,24 @@ Create a new, private repository on GitHub. Name the new repository `coderabbit-
30
45
31
46
To integrate CodeRabbit with your GitHub account, follow these steps:
CodeRabbit takes a moment to set up the integration. After it finishes, the CodeRabbit dashboard appears.
38
68
@@ -57,33 +87,42 @@ The following steps initiate a pull request to add a tiny and somewhat flawed Py
57
87
58
88
Use your usual Git workflow to perform the following steps in the `coderabbit-test` repository:
59
89
60
-
1. Create a branch named `add-utils`.
61
-
62
-
1. In that new `add-utils` branch, create a new file called `simple_utils.py`, with the following content:
63
-
64
-
```python
65
-
# simple_utils.py - A tiny utility library
66
-
67
-
defreverse_string(text):
68
-
"""Reverses the characters in a string."""
69
-
return text[::-1]
70
-
71
-
defcount_words(sentence):
72
-
returnlen(sentence.split())
90
+
<ListItems
91
+
orderedList
92
+
items={[
93
+
"Create a branch named `add-utils`.",
94
+
<>
95
+
In that new <code>add-utils</code> branch, create a new file called <code>simple_utils.py</code>, with the following content:
96
+
<CodeBlocklanguage="python">{`
97
+
# simple_utils.py - A tiny utility library
98
+
99
+
def reverse_string(text):
100
+
"""Reverses the characters in a string."""
101
+
return text[::-1]
102
+
103
+
def count_words(sentence):
104
+
return len(sentence.split())
105
+
106
+
def celsius_to_fahrenheit(celsius):
107
+
return (celsius \* 9/5) + 32
108
+
`}</CodeBlock>
109
+
</>,
110
+
"Commit the added file to the `add-utils`branch. Use any text you want for the commit message.",
111
+
"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.",
112
+
]}
113
+
/>
73
114
74
-
defcelsius_to_fahrenheit(celsius):
75
-
return (celsius *9/5) +32
76
-
```
77
-
78
-
1. Commit the added file to the `add-utils` branch. Use any text you want for the commit message.
115
+
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:
79
116
80
-
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.
117
+
<ListItems
118
+
items={[
119
+
"If you didn't write a pull request summary, then CodeRabbit adds a new summary to the pull request.",
120
+
"CodeRabbit posts a comment titled **Walkthrough** containing analysis and commentary about the content of the pull request.",
121
+
"CodeRabbit attaches a detailed code review to the pull request as another comment.",
81
122
82
-
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:
123
+
]}
83
124
84
-
- If you didn't write a pull request summary, then CodeRabbit adds a new summary to the pull request.
85
-
- CodeRabbit posts a comment titled **Walkthrough** containing analysis and commentary about the content of the pull request.
86
-
- CodeRabbit attaches a detailed code review to the pull request as another comment.
125
+
/>
87
126
88
127
Part of the review resembles the following screenshot:
89
128
@@ -103,13 +142,15 @@ After CodeRabbit reviews a pull request, you can converse with it about its revi
103
142
104
143
After a few moments, CodeRabbit posts its reply, explaining its motivations for its recommendation. The reply might resemble the following:
105
144
106
-
> 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.
107
-
>
108
-
> 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.
109
-
>
110
-
> 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?
145
+
<ChatBubble>
146
+
{`> 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.
147
+
>
148
+
> 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.
149
+
>
150
+
> 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?`}
151
+
</ChatBubble>
111
152
112
-
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.
153
+
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.
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
18
23
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.
19
24
20
25
<divclass="video-container">
21
-
<iframesrc="https://www.youtube.com/embed/3SyUOSebG7E?si=i0oT9RAnH0PW81lY"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>
For more information, see <ahref="/platforms/">Supported Git Platforms</a>.
91
+
</InfoBox>
67
92
68
93
### Issue-management integration
69
94
70
95
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:
For more information, see [Issue Creation](/guides/issue-creation) and [Issue Chat](/guides/issue-chat).
104
+
<InfoBox>
105
+
For more information, see <ahref="/guides/issue-creation">Issue Creation</a>{""}
106
+
and <ahref="/guides/issue-chat">Issue Chat</a>.
107
+
</InfoBox>
78
108
79
109
## Data privacy and security
80
110
81
111
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:
82
112
83
-
- All queries to large language models (LLMs) exist in-memory only, with zero retention after each query completes.
84
-
- We don't use your code, code reviews, or other collected data to train LLMs.
85
-
- CodeRabbit doesn't share any collected customer data with third parties.
86
-
- We keep all customer data confidential, and isolated by organization.
87
-
- Our data collection and storage practices comply with SOC 2 and GDPR standards.
88
-
89
-
For more information about how we protect your data, see [the CodeRabbit Trust Center](https://trust.coderabbit.ai).
113
+
<ListItems
114
+
items={[
115
+
"All queries to large language models (LLMs) exist in-memory only, with zero retention after each query completes.",
116
+
"We don't use your code, code reviews, or other collected data to train LLMs.",
117
+
"CodeRabbit doesn't share any collected customer data with third parties.",
118
+
"Works with contributors through natural-language conversation in comments.",
119
+
"We keep all customer data confidential, and isolated by organization.",
120
+
"Our data collection and storage practices comply with SOC 2 and GDPR standards.",
121
+
]}
122
+
/>
123
+
124
+
<InfoBox>
125
+
For more information about how we protect your data, see{""}
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.
94
132
95
-
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).
133
+
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.
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.
100
143
101
-
For more information, see [Review local changes](/code-editors).
144
+
<InfoBox>
145
+
For more information, see <ahref="/code-editors">Review local changes</a>.
146
+
</InfoBox>
102
147
103
148
## What's next
104
149
105
-
-[Quickstart](/getting-started/quickstart/) lets you experience your first CodeRabbit code review first-hand.
106
-
107
-
-[Review local changes](/code-editors) guides you through installing and using a subset of CodeRabbit features directly from your code editor.
108
-
109
-
-[Why CodeRabbit?](/overview/why-coderabbit) dives further into the philosophies and technologies that drive CodeRabbit.
150
+
<ListItems
151
+
items={[
152
+
<>
153
+
<ahref="/getting-started/quickstart/">Quickstart</a> lets you experience
154
+
your first CodeRabbit code review first-hand.
155
+
</>,
156
+
<>
157
+
<ahref="/code-editors">Review local changes</a> guides you through
158
+
installing and using a subset of CodeRabbit features directly from your
159
+
code editor.
160
+
</>,
161
+
<>
162
+
<ahref="/overview/why-coderabbit">Why CodeRabbit?</a> dives further into
163
+
the philosophies and technologies that drive CodeRabbit.
0 commit comments