Add self-review checkbox functionality to improve tool and update documentation

This commit is contained in:
mrT23
2024-06-17 20:26:09 +03:00
parent 8d44804f84
commit bc09330a44
4 changed files with 41 additions and 9 deletions

View File

@ -59,6 +59,30 @@ auto_extended_mode=true
Note that the extended mode divides the PR code changes into chunks, up to the token limits, where each chunk is handled separately (might use multiple calls to GPT-4 for large PRs).
Hence, the total number of suggestions is proportional to the number of chunks, i.e., the size of the PR.
### Self-review
if you set in a configuration file:
```
[pr_code_suggestions]
demand_code_suggestions_self_review = true
```
The `improve` tool will add a checkbox below the suggestions, asking the user to confirm that they have reviewed the suggestions.
You can control the content of the checkbox text by setting:
```
[pr_code_suggestions]
code_suggestions_self_review_text = "... (your text here) ..."
```
![self_review_1](https://codium.ai/images/pr_agent/self_review_1.png){width=512}
In addition, a configuration flag of:
```
[pr_code_suggestions]
approve_pr_on_self_review = true
```
enables the tool to automatically approve the PR when the user checks the self-review checkbox.
!!! tip "Demanding self-review from the PR author"
If you set the number of required reviewers for a PR to 2, this effectively means that the PR author must click the self-review checkbox before the PR can be merged (in addition to a human reviewer).
![self_review_2](https://codium.ai/images/pr_agent/self_review_2.png){width=512}
## Configuration options