mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 21:00:40 +08:00
docs: add auto-approval configuration documentation
This commit is contained in:
@ -311,6 +311,44 @@ code_suggestions_self_review_text = "... (your text here) ..."
|
|||||||
|
|
||||||
To prevent unauthorized approvals, this configuration defaults to false, and cannot be altered through online comments; enabling requires a direct update to the configuration file and a commit to the repository. This ensures that utilizing the feature demands a deliberate documented decision by the repository owner.
|
To prevent unauthorized approvals, this configuration defaults to false, and cannot be altered through online comments; enabling requires a direct update to the configuration file and a commit to the repository. This ensures that utilizing the feature demands a deliberate documented decision by the repository owner.
|
||||||
|
|
||||||
|
### Auto-approval
|
||||||
|
|
||||||
|
Under specific conditions, Qodo Merge can auto-approve a PR when a specific comment is invoked, or when the PR meets certain criteria.
|
||||||
|
|
||||||
|
To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set, in a pre-defined _configuration file_, the following:
|
||||||
|
```toml
|
||||||
|
[config]
|
||||||
|
enable_auto_approval = true
|
||||||
|
```
|
||||||
|
Note that this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository.
|
||||||
|
This ensures that enabling auto-approval is a deliberate decision by the repository owner.
|
||||||
|
|
||||||
|
**(1) Auto-approval by commenting**
|
||||||
|
|
||||||
|
After enabling, by commenting on a PR:
|
||||||
|
```
|
||||||
|
/review auto_approve
|
||||||
|
```
|
||||||
|
Qodo Merge will automatically approve the PR, and add a comment with the approval.
|
||||||
|
|
||||||
|
**(2) Auto-approval when the PR meets certain criteria**
|
||||||
|
|
||||||
|
There are two criteria that can be set for auto-approval:
|
||||||
|
|
||||||
|
- **Review effort score**
|
||||||
|
```toml
|
||||||
|
[config]
|
||||||
|
auto_approve_for_low_review_effort = X # X is a number between 1 to 5
|
||||||
|
```
|
||||||
|
When the [review effort score](https://www.qodo.ai/images/pr_agent/review3.png) is lower or equal to X, the PR will be auto-approved.
|
||||||
|
|
||||||
|
___
|
||||||
|
- **No code suggestions**
|
||||||
|
```toml
|
||||||
|
[config]
|
||||||
|
auto_approve_for_no_suggestions = true
|
||||||
|
```
|
||||||
|
When no [code suggestion](https://www.qodo.ai/images/pr_agent/code_suggestions_as_comment_closed.png) were found for the PR, the PR will be auto-approved.
|
||||||
|
|
||||||
### How many code suggestions are generated?
|
### How many code suggestions are generated?
|
||||||
Qodo Merge uses a dynamic strategy to generate code suggestions based on the size of the pull request (PR). Here's how it works:
|
Qodo Merge uses a dynamic strategy to generate code suggestions based on the size of the pull request (PR). Here's how it works:
|
||||||
|
@ -114,16 +114,6 @@ You can enable\disable the `review` tool to add specific labels to the PR:
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
!!! example "Auto-approval"
|
|
||||||
|
|
||||||
If enabled, the `review` tool can approve a PR when a specific comment, `/review auto_approve`, is invoked.
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td><b>enable_auto_approval</b></td>
|
|
||||||
<td>If set to true, the tool will approve the PR when invoked with the 'auto_approve' command. Default is false. This flag can be changed only from a configuration file.</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
## Usage Tips
|
## Usage Tips
|
||||||
|
|
||||||
@ -175,23 +165,6 @@ If enabled, the `review` tool can approve a PR when a specific comment, `/review
|
|||||||
Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.
|
Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.
|
||||||
|
|
||||||
|
|
||||||
!!! tip "Auto-approval"
|
|
||||||
|
|
||||||
Qodo Merge can approve a PR when a specific comment is invoked.
|
|
||||||
|
|
||||||
To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set in a pre-defined configuration file the following:
|
|
||||||
```
|
|
||||||
[pr_reviewer]
|
|
||||||
enable_auto_approval = true
|
|
||||||
```
|
|
||||||
(this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository)
|
|
||||||
|
|
||||||
|
|
||||||
After enabling, by commenting on a PR:
|
|
||||||
```
|
|
||||||
/review auto_approve
|
|
||||||
```
|
|
||||||
Qodo Merge will automatically approve the PR, and add a comment with the approval.
|
|
||||||
|
|
||||||
|
|
||||||
!!! tip "Code suggestions"
|
!!! tip "Code suggestions"
|
||||||
|
@ -48,6 +48,11 @@ ignore_pr_authors = [] # authors to ignore from PR agent when an PR is created
|
|||||||
#
|
#
|
||||||
is_auto_command = false # will be auto-set to true if the command is triggered by an automation
|
is_auto_command = false # will be auto-set to true if the command is triggered by an automation
|
||||||
enable_ai_metadata = false # will enable adding ai metadata
|
enable_ai_metadata = false # will enable adding ai metadata
|
||||||
|
# auto approval 💎
|
||||||
|
enable_auto_approval=false # Set to true to enable auto-approval of PRs under certain conditions
|
||||||
|
auto_approve_for_low_review_effort=-1 # -1 to disable, [1-5] to set the threshold for auto-approval
|
||||||
|
auto_approve_for_no_suggestions=false # If true, the PR will be auto-approved if there are no suggestions
|
||||||
|
|
||||||
|
|
||||||
[pr_reviewer] # /review #
|
[pr_reviewer] # /review #
|
||||||
# enable/disable features
|
# enable/disable features
|
||||||
@ -70,9 +75,6 @@ minimal_commits_for_incremental_review=0
|
|||||||
minimal_minutes_for_incremental_review=0
|
minimal_minutes_for_incremental_review=0
|
||||||
enable_intro_text=true
|
enable_intro_text=true
|
||||||
enable_help_text=false # Determines whether to include help text in the PR review. Enabled by default.
|
enable_help_text=false # Determines whether to include help text in the PR review. Enabled by default.
|
||||||
# auto approval
|
|
||||||
enable_auto_approval=false
|
|
||||||
|
|
||||||
|
|
||||||
[pr_description] # /describe #
|
[pr_description] # /describe #
|
||||||
publish_labels=false
|
publish_labels=false
|
||||||
|
Reference in New Issue
Block a user