mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 05:10:38 +08:00
Merge pull request #1613 from qodo-ai/hl/update_auto_approve_docs
docs: update auto-approval documentation with clearer configuration
This commit is contained in:
@ -318,15 +318,25 @@ code_suggestions_self_review_text = "... (your text here) ..."
|
|||||||
|
|
||||||
Under specific conditions, Qodo Merge can auto-approve a PR when a specific comment is invoked, or when the PR meets certain criteria.
|
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:
|
**To ensure safety, the auto-approval feature is disabled by default.**
|
||||||
|
To enable auto-approval features, you need to actively set one or both of the following options in a pre-defined _configuration file_:
|
||||||
```toml
|
```toml
|
||||||
[config]
|
[config]
|
||||||
enable_auto_approval = true
|
enable_manual_approval = true # For approval via comments
|
||||||
|
enable_auto_approval = true # For criteria-based auto-approval
|
||||||
```
|
```
|
||||||
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**
|
!!! note "Notes"
|
||||||
|
- Note that this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository.
|
||||||
|
- Enabling auto-approval must be a deliberate decision by the repository owner.
|
||||||
|
|
||||||
|
1\. **Auto-approval by commenting**
|
||||||
|
|
||||||
|
To enable auto-approval by commenting, set in the configuration file:
|
||||||
|
```toml
|
||||||
|
[config]
|
||||||
|
enable_manual_approval = true
|
||||||
|
```
|
||||||
|
|
||||||
After enabling, by commenting on a PR:
|
After enabling, by commenting on a PR:
|
||||||
```
|
```
|
||||||
@ -334,13 +344,20 @@ After enabling, by commenting on a PR:
|
|||||||
```
|
```
|
||||||
Qodo Merge will automatically approve the PR, and add a comment with the approval.
|
Qodo Merge will automatically approve the PR, and add a comment with the approval.
|
||||||
|
|
||||||
**(2) Auto-approval when the PR meets certain criteria**
|
2\. **Auto-approval when the PR meets certain criteria**
|
||||||
|
|
||||||
|
To enable auto-approval based on specific criteria, first, you need to enable the top-level flag:
|
||||||
|
```toml
|
||||||
|
[config]
|
||||||
|
enable_auto_approval = true
|
||||||
|
```
|
||||||
|
|
||||||
There are two criteria that can be set for auto-approval:
|
There are two criteria that can be set for auto-approval:
|
||||||
|
|
||||||
- **Review effort score**
|
- **Review effort score**
|
||||||
```toml
|
```toml
|
||||||
[config]
|
[config]
|
||||||
|
enable_auto_approval = true
|
||||||
auto_approve_for_low_review_effort = X # X is a number between 1 to 5
|
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.
|
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.
|
||||||
@ -349,6 +366,7 @@ ___
|
|||||||
- **No code suggestions**
|
- **No code suggestions**
|
||||||
```toml
|
```toml
|
||||||
[config]
|
[config]
|
||||||
|
enable_auto_approval = true
|
||||||
auto_approve_for_no_suggestions = true
|
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.
|
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.
|
||||||
|
@ -9,7 +9,7 @@ class CliArgs:
|
|||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
# decode forbidden args
|
# decode forbidden args
|
||||||
_encoded_args = 'ZW5hYmxlX2F1dG9fYXBwcm92YWw=:YXBwcm92ZV9wcl9vbl9zZWxmX3Jldmlldw==:YmFzZV91cmw=:dXJs:YXBwX25hbWU=:c2VjcmV0X3Byb3ZpZGVy:Z2l0X3Byb3ZpZGVy:c2tpcF9rZXlz:b3BlbmFpLmtleQ==:QU5BTFlUSUNTX0ZPTERFUg==:dXJp:YXBwX2lk:d2ViaG9va19zZWNyZXQ=:YmVhcmVyX3Rva2Vu:UEVSU09OQUxfQUNDRVNTX1RPS0VO:b3ZlcnJpZGVfZGVwbG95bWVudF90eXBl:cHJpdmF0ZV9rZXk=:bG9jYWxfY2FjaGVfcGF0aA==:ZW5hYmxlX2xvY2FsX2NhY2hl:amlyYV9iYXNlX3VybA==:YXBpX2Jhc2U=:YXBpX3R5cGU=:YXBpX3ZlcnNpb24=:c2tpcF9rZXlz'
|
_encoded_args = 'ZW5hYmxlX21hbnVhbF9hcHByb3ZhbA==:ZW5hYmxlX2F1dG9fYXBwcm92YWw=:YXBwcm92ZV9wcl9vbl9zZWxmX3Jldmlldw==:YmFzZV91cmw=:dXJs:YXBwX25hbWU=:c2VjcmV0X3Byb3ZpZGVy:Z2l0X3Byb3ZpZGVy:c2tpcF9rZXlz:b3BlbmFpLmtleQ==:QU5BTFlUSUNTX0ZPTERFUg==:dXJp:YXBwX2lk:d2ViaG9va19zZWNyZXQ=:YmVhcmVyX3Rva2Vu:UEVSU09OQUxfQUNDRVNTX1RPS0VO:b3ZlcnJpZGVfZGVwbG95bWVudF90eXBl:cHJpdmF0ZV9rZXk=:bG9jYWxfY2FjaGVfcGF0aA==:ZW5hYmxlX2xvY2FsX2NhY2hl:amlyYV9iYXNlX3VybA==:YXBpX2Jhc2U=:YXBpX3R5cGU=:YXBpX3ZlcnNpb24=:c2tpcF9rZXlz'
|
||||||
forbidden_cli_args = []
|
forbidden_cli_args = []
|
||||||
for e in _encoded_args.split(':'):
|
for e in _encoded_args.split(':'):
|
||||||
forbidden_cli_args.append(b64decode(e).decode())
|
forbidden_cli_args.append(b64decode(e).decode())
|
||||||
|
Reference in New Issue
Block a user