Optibot configuration for Reviews
Configuration Parameters for Optibot
Configuration options for code reviews
In the .optibot configfuration file the reviews object controls automated code review functionality.
Complete Structure
{
"reviews": {
"auto": false,
"autoOnPush": false,
"autoOnDraft": false,
"exclude": [],
"include": [],
"autoApprove": false,
"codeSuggestions": true,
"codeSuggestionsSkipFiles": [],
"excludedLabels": [],
"excludedUsers": []
}
}
Auto Reviews on PR Creation
Type:boolean
Default: false
Description: Controls whether Optibot automatically reviews pull/merge requests when they are created or updated.
When to use and impact:
- Set to true if you want immediate feedback on all pull requests when they are first opened. Optibot will generate a
thoughtful code review of your changes.
- Set to false if you prefer to manually trigger reviews which can be done in plain text on github and gitlab comments
by typing "Optibot can you review this"
Example:
{
"reviews": {
"auto": true
}
}
Automatic Reviews on New Commits (autoOnPush)
Type: boolean
Default: false
Description:
You can now configure Optibot to automatically re-review a pull or merge request every time you push new commits. This
gives you continuous feedback as you update the PR, without needing to manually ask Optibot to review again.
To enable this, add autoOnPush: true inside the reviews section of your .optibot configuration file.
When to use and impact:
- Ideal when you push multiple follow-up commits to address feedback.
- Ensures each update is automatically re-reviewed.
- Removes the need to manually trigger additional reviews.
- Helps teams maintain high-quality, iterative review workflows.
Example:
{
"reviews": {
"auto": false,
"autoOnPush": true,
"autoApprove": false
}
}
Automated PR approvals
Type: boolean
Default: false
Description: Automatically approve pull/merge requests that pass optibots stringent review criteria. This setting gives
optibot the ability to automatically approve a pull request that it deems mergeable.
When to use and impact:
- For trusted contributors or automated dependency updates
- When you have strict CI/CD checks and trust Optibot's judgment.
- When you regularly push atomic changes (small to medium PR/MR's) to branches.
- When you require a multiple reviews on a PR/MR to merge. An optibot approval can be one of the core approvers on
your team.
Example:
{
"reviews": {
"auto": true,
"autoApprove": true
}
}
⚠️ Important Considerations:
- Use carefully - this gives Optibot approval authority. If you use a CI/CD pipeline with a lack of tests or merge
directly into main.
- Best combined with excludedLabels or excludedUsers for controlled auto-approval
- Consider your team's review policies before enabling.
Our Recommended Setup:
{
"reviews": {
"auto": true,
"autoApprove": true,
"excludedLabels": ["needs-review", "breaking-change"],
"excludedUsers": ["junior-devs"]
}
}
Optibot Code Suggestions
Type: boolean
Default: true
Description: This lets optibot suggest inline code suggestions and improvements. These suggestions can show up as either
committable changes or show up as code change recommendations. These are turned on by default.
When to use and impact:
- Set to true for actionable code improvement suggestions.
- Set to false if you only want high-level feedback without specific code changes. This is only useful if you either
a) have an internal mandate to not have any AI generated code suggestions for your repo or b) going through a
process of training engineers to not be dependent on AI generated code fixes for reviews.
Example:
{
"reviews": {
"auto": true,
"codeSuggestions": true
}
}
Skip optibot reviews on specific files
Type: array of strings (glob patterns)
Default: []
Description: This setting tells optibot to skip reviewing certain files based on patterns. When enabled optibot will not
generate code suggestions on those specific files. This will also stop optibot from reading those files during a review.
When to use:
- Exclude auto generated files, test files, or documentation
- Focus suggestions on production code only and ignore compiled code in reviews.
- Skip files that change frequently or follow different conventions
- Skip files that have specific legal requirements against AI generated code enforcement. Some regulated sectors
require that specific files can only be edited and maintained by humans.
Examples:
// Example 1: Skip test files and documentation
{
"reviews": {
"auto": true,
"codeSuggestions": true,
"codeSuggestionsSkipFiles": ["*.test.js", "*.test.ts", "*.md", "docs/**/*"]
}
}
// Example 2: Skip generated and configuration files
{
"reviews": {
"auto": true,
"codeSuggestions": true,
"codeSuggestionsSkipFiles": [
"*.generated.*",
"dist/**/*",
"build/**/*",
"*.config.js",
"package-lock.json"
]
}
}
// Example 3: Skip vendor and third-party code
{
"reviews": {
"auto": true,
"codeSuggestions": true,
"codeSuggestionsSkipFiles": [
"vendor/**/*",
"node_modules/**/*",
"third_party/**/*"
]
}
}
Glob Pattern Guide:
- *.ext - All files with extension in current directory
- **/*.ext - All files with extension in any directory
- dir/**/* - All files under a specific directory
- *.test.* - Files with .test. in the name
Exclude optibot reviews on specific Pull Request labels
Type: array of strings
Default: []
Description: This setting stops optibot from reviewing code changes in pull/merge requests that contain specified labels
of your choice. Labels are case sensitive and must have an exact name match when configuring this setting.
When to use:
- Skip reviews for work-in-progress changes
- Skip reviews on autogenerated PR's, such as those generated by Snyk, Dependabot, Sonarqube, etc
- Exclude draft or experimental branches
- Bypass reviews for hotfixes or emergency changes
Examples:
// Example 1: Skip WIP and draft PRs
{
"reviews": {
"auto": true,
"excludedLabels": ["WIP", "work-in-progress", "draft"]
}
}
// Example 2: Emergency and hotfix bypass
{
"reviews": {
"auto": true,
"excludedLabels": ["hotfix", "emergency", "critical-fix"]
}
}
// Example 3: Exclude documentation-only changes
{
"reviews": {
"auto": true,
"excludedLabels": ["documentation", "docs-only", "readme-update"]
}
}
Platform-specific label names:
- GitHub: Use exact label names (case-sensitive)
- GitLab: Use exact label names (case-sensitive)
Exclude Optibot reviews from specific users
Type: array of strings
Default: []
Description: This setting prevents optibot from reviewing pull/merge requests from specified users. This ensures that
when your specified user(s) creates a pull or merge request, optibot will not review their code even when you have
reviews set to auto.
When to use:
- Exclude bot accounts (Dependabot, Renovate, etc.)
- Skip reviews for trusted senior developers
- Bypass automated deployment accounts
Examples:
// Example 1: Exclude dependency bots
{
"reviews": {
"auto": true,
"excludedUsers": ["dependabot", "renovate", "renovate[bot]"]
}
}
// Example 2: Exclude CI/CD and release bots
{
"reviews": {
"auto": true,
"excludedUsers": [
"github-actions[bot]",
"gitlab-ci",
"release-bot",
"deployment-bot"
]
}
}
// Example 3: Exclude specific team members
{
"reviews": {
"auto": true,
"excludedUsers": ["senior-architect", "tech-lead"]
}
}
Platform-specific usernames:
- GitHub: Use the exact username (e.g., dependabot[bot] for GitHub Apps)
- GitLab: Use the exact username
Exclude optibot reviewing draft pull requests
Type: boolean
Default: false
Description: This setting prevents optibot from reviewing pull/merge requests that have their state set to draft i.e
pull requests that are opened as drafts. By default optibot does not review draft pull requests when they are opened.
Reviews only execute when you set the status of the PR to "Ready to review" on github.
This works similarly for gitlab. Merge requests that are set to draft will follow the same convention as github.
When to use:
- When you want optibot to continually review your work in progress pull or merge requests.
Example
{
"reviews": {
"auto": true,
"autoOnDraft": true,
"autoApprove": true,
"codeSuggestions": true
}
}