Customize reports
This feature is available exclusively as part of the Pro plan and is not included in the Lite plan. Please refer to our pricing page for more information about our plans and features.
CodeRabbit Pro allows you to create custom reports tailored to your specific needs using a flexible prompt-based system. This guide will help you understand how to create effective custom reports.
Understanding Custom Reports
Custom reports allow you to:
- Define exactly what information you want to see
- Specify the format and structure of the report
- Set custom filtering and grouping rules
- Generate reports in different languages
Creating Custom Report Templates
Basic Structure
A custom report template consists of instructions that tell CodeRabbit what information to include and how to present it. Here's a basic example:
Please provide a summary of:
- All merged pull requests
- Critical bug fixes
- Code review discussions
Group by:
- Repository
- Team
Format using:
- Bullet points for changes
- Tables for statistics
Example for different languages
Japanese:
レポートを英語ではなく日本語で送信してください。
以下の要約を提供してください:
- すべてのプルリクエスト活動
- コードレビューの議論
French:
Veuillez envoyer le rapport en français et non en anglais.
Veuillez fournir un résumé de :
- Toutes les activités de demandes de fusion
- Discussions sur la révision de code
Available Data Points
Your custom reports can access the following PR information that you can reference in your prompts:
Pull Request Status
Contained within the <pr_details>
tag.
Merged
: boolean (true/false) - Whether the PR has been mergedDraft
: boolean (true/false) - Whether the PR is in draft stateState
: string ("open"/"closed") - Current state of the PRMergeable
: boolean (true/false) - Whether the PR can be mergedIs stale
: boolean - Whether PR has been inactive for over 168 hoursPR Stage
: string - The current stage of open PRs in Open or Draft state, can be one of:- "Needs Author Action" - PR requires author attention due to merge conflicts, draft status, or requested changes
- "Waiting for Author to Merge" - PR has approvals and is ready for author to merge
- "Waiting for Code Reviews" - PR is waiting for reviewers to approve
- undefined - PR is not in an open state (is merged or closed)
Basic Information
Contained within the <pr_details>
tag.
Pull request number
: number - The PR's identifierTitle
: string - PR titleURL
: string - Link to the PRAuthor name
: string - PR creator's usernameCreated at
: datetime - When the PR was createdLast activity
: datetime - Most recent activity timestampClosed at
: datetime (if applicable) - When the PR was closedSource branch
: string - Source branch nameTarget branch
: string - Target branch nameLabels
: array of strings - All labels applied to the PRReviewers
: array of strings - Assigned reviewers' usernames
Summarized PR Details
<pr_description>
: string - Contains the body of your pull request (aka the PR description at the top of the PR page).<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:filename
: string - The name of the file that was changed.AI-generated summary of changes
: markdown - An overall summary of the changes made in the file.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.
Comments
<pr_comments>
: array of comment objects - Contains all the comments made on the PR.<comment>
: object - Each indidvidual comment is wrapped in this tag and is an object with the following properties:<comment_author_username>
: string - The username of the comment author.<comment_created_at>
: datetime - The date and time the comment was created.<comment_updated_at>
: datetime - The date and time the comment was last updated.<comment_body>
: markdown - The content of the comment.
Here's an example prompt that uses these data points:
Use the <overall_instructions> to guide the content of the summary. Use the format shown in <example> but do not include or refer the example's content in the final summary/report.
<overall_instructions>
Generate a summary of each pull request in the following bullet point format:
- PR Link: Provide a hyperlink to the pull request from the 'URL:' value
- Title: Provide the value of the 'Title:' field
- PR State: Provide the state of the PR based on the following conditions:
- If 'Merged: true' set 'PR State: 🔀 Merged'
- Else If 'Draft: true' set 'PR State: 📝 Draft'
- Else If 'State: open' or 'State: active' set 'PR State: 💬 Open'
- Else If 'State: closed' or 'State: DECLINED' and 'Merged: false' set 'PR State: 🔒 Closed'
- Else set 'PR State: ❓ Unknown'
- If the PR is stale, add '⚠️ Stale' at the end of the PR State.
- Mergeable (if PR State is not 'Merged'): Provide the mergeable status of the PR as 'Mergeable' or 'Not Mergeable' based on the "Mergeable: " value.
- PR Stage (if PR State is not 'Merged'): Provide the stage of the PR based on the "PR Stage: " value.
- Summary: In under 50 words provide a short summary of the PR.
- Comments: In under 50 words provide a short summary of all comments found within <pr_comments>, including each comments author username from <comment_author_username>. If there are no comments available, output 'No comments'.
</overall_instructions>
<example>
- **PR Link:** [#3001](https://github.com/mygithuborg/myrepo/pull/3001)
- **Title:** PR Title
- **PR State:** 💬 Open
- **Mergeable:** Mergeable
- **PR Stage:** Waiting for Code Reviews
- **Summary:** Summary of the PR.
- **Comments:** Summary of the PR comments or No comments.
- **PR Link:** [#302](https://github.com/mygithuborg/thatrepo/pull/302)
- **Title:** PR Title
- **PR State:** 💬 Open
- **Mergeable:** Mergeable
- **PR Stage:** Waiting for Author to Merge
- **Summary:** Summary of the PR.
- **Comments:** Summary of the PR comments or No comments.
- **PR Link:** [#3](https://github.com/mygithuborg/myotherrepo/pull/3)
- **Title:** PR Title
- **PR State:** 🔀 Merged
- **Summary:** Summary of the PR.
- **Comments:** Summary of the PR comments or No comments.
- **PR Link:** [#14](https://github.com/mygithuborg/frontend/pull/14)
- **Title:** PR Title
- **PR State:** 💬 Open
- **Mergeable:** Mergeable
- **PR Stage:** Needs Author Action
- **Summary:** Summary of the PR.
- **Comments:** Summary of the PR comments or No comments.
- **PR Link:** [#13005](https://github.com/mygithuborg/backend/pull/13005)
- **Title:** PR Title
- **PR State:** 🔀 Merged
- **Summary:** Summary of the PR.
- **Comments:** Summary of the PR comments or No comments.
- **PR Link:** [#3006](https://github.com/mygithuborg/myrepo/pull/3006)
- **Title:** PR Title
- **PR State:** 🔀 Merged
- **Summary:** Summary of the PR.
- **Comments:** Summary of the PR comments or No comments.
- **PR Link:** [#3007](https://github.com/mygithuborg/myrepo/pull/3007)
- **Title:** PR Title
- **PR State:** 📝 Draft
- **Mergeable:** Not Mergeable
- **PR Stage:** Needs Author Action
- **Summary:** Summary of the PR.
- **Comments:** Summary of the PR comments or No comments.
</example>
Formatting Options
CodeRabbit supports markdown formatting in custom reports. You can use:
- Headers (
#
,##
,###
) - Lists (bullet points and numbered)
- Tables
- Code blocks
- Bold and italic text
- Links
Headers and Titles
The name you give to each report in the CodeRabbit menu will be used for the first line of any report or the subject for emails. For example if your report is named Executive Summary Template
then this string will appear on the subject of your emails and start of all message chains.
When using the Preview Report
button in the CodeRabbit menu, the subject will begin with Preview: <report name>
.
The reports will also have an overall title describing the report content such as Pull Request Summary Report (January 2025)
.
To change these details of this overall title you should include specific instructions in your custom prompt with examples such as:
- Do not add a date to the titles like "Pull Request Summary Report (January 2025)" it should just be "Pull Request Summary Report"
Language Support
You can generate reports in multiple languages by specifying the ISO language code in your template. For example:
Language: fr
Please provide a summary of:
- All pull request activities
- Code review discussions
Advanced Features
Filtering
Include specific filtering instructions in your template:
Include only:
- PRs with "critical" or "bug" labels
- Changes to production code
- Reviews from senior developers
Exclude:
- Automated commits
- Documentation changes
- Dependencies updates