mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 12:50:38 +08:00
docs: update auto-approval feature documentation and configuration
This commit is contained in:
@ -53,9 +53,10 @@ num_code_suggestions_per_chunk = ...
|
|||||||
- The `pr_commands` lists commands that will be executed automatically when a PR is opened.
|
- The `pr_commands` lists commands that will be executed automatically when a PR is opened.
|
||||||
- The `[pr_code_suggestions]` section contains the configurations for the `improve` tool you want to edit (if any)
|
- The `[pr_code_suggestions]` section contains the configurations for the `improve` tool you want to edit (if any)
|
||||||
|
|
||||||
### Assessing Impact 💎
|
### Assessing Impact
|
||||||
|
>`💎 feature`
|
||||||
|
|
||||||
Note that Qodo Merge tracks two types of implementations:
|
Qodo Merge tracks two types of implementations for tracking implemented suggestions:
|
||||||
|
|
||||||
- Direct implementation - when the user directly applies the suggestion by clicking the `Apply` checkbox.
|
- Direct implementation - when the user directly applies the suggestion by clicking the `Apply` checkbox.
|
||||||
- Indirect implementation - when the user implements the suggestion in their IDE environment. In this case, Qodo Merge will utilize, after each commit, a dedicated logic to identify if a suggestion was implemented, and will mark it as implemented.
|
- Indirect implementation - when the user implements the suggestion in their IDE environment. In this case, Qodo Merge will utilize, after each commit, a dedicated logic to identify if a suggestion was implemented, and will mark it as implemented.
|
||||||
@ -68,8 +69,8 @@ In post-process, Qodo Merge counts the number of suggestions that were implement
|
|||||||
|
|
||||||
{width=512}
|
{width=512}
|
||||||
|
|
||||||
## Suggestion tracking 💎
|
## Suggestion tracking
|
||||||
`Platforms supported: GitHub, GitLab`
|
>`💎 feature. Platforms supported: GitHub, GitLab`
|
||||||
|
|
||||||
Qodo Merge employs a novel detection system to automatically [identify](https://qodo-merge-docs.qodo.ai/core-abilities/impact_evaluation/) AI code suggestions that PR authors have accepted and implemented.
|
Qodo Merge employs a novel detection system to automatically [identify](https://qodo-merge-docs.qodo.ai/core-abilities/impact_evaluation/) AI code suggestions that PR authors have accepted and implemented.
|
||||||
|
|
||||||
@ -102,8 +103,6 @@ The `improve` tool can be further customized by providing additional instruction
|
|||||||
|
|
||||||
### Extra instructions
|
### Extra instructions
|
||||||
|
|
||||||
>`Platforms supported: GitHub, GitLab, Bitbucket, Azure DevOps`
|
|
||||||
|
|
||||||
You can use the `extra_instructions` configuration option to give the AI model additional instructions for the `improve` tool.
|
You can use the `extra_instructions` configuration option to give the AI model additional instructions for the `improve` tool.
|
||||||
Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter.
|
Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter.
|
||||||
|
|
||||||
@ -119,9 +118,9 @@ extra_instructions="""\
|
|||||||
```
|
```
|
||||||
Use triple quotes to write multi-line instructions. Use bullet points or numbers to make the instructions more readable.
|
Use triple quotes to write multi-line instructions. Use bullet points or numbers to make the instructions more readable.
|
||||||
|
|
||||||
### Best practices 💎
|
### Best practices
|
||||||
|
|
||||||
>`Platforms supported: GitHub, GitLab, Bitbucket`
|
> `💎 feature. Platforms supported: GitHub, GitLab, Bitbucket`
|
||||||
|
|
||||||
Another option to give additional guidance to the AI model is by creating a `best_practices.md` file, either in your repository's root directory or as a [**wiki page**](https://github.com/Codium-ai/pr-agent/wiki) (we recommend the wiki page, as editing and maintaining it over time is easier).
|
Another option to give additional guidance to the AI model is by creating a `best_practices.md` file, either in your repository's root directory or as a [**wiki page**](https://github.com/Codium-ai/pr-agent/wiki) (we recommend the wiki page, as editing and maintaining it over time is easier).
|
||||||
This page can contain a list of best practices, coding standards, and guidelines that are specific to your repo/organization.
|
This page can contain a list of best practices, coding standards, and guidelines that are specific to your repo/organization.
|
||||||
@ -192,9 +191,9 @@ And the label will be: `{organization_name} best practice`.
|
|||||||
|
|
||||||
{width=512}
|
{width=512}
|
||||||
|
|
||||||
### Auto best practices 💎
|
### Auto best practices
|
||||||
|
|
||||||
>`Platforms supported: GitHub`
|
>`💎 feature. Platforms supported: GitHub.`
|
||||||
|
|
||||||
'Auto best practices' is a novel Qodo Merge capability that:
|
'Auto best practices' is a novel Qodo Merge capability that:
|
||||||
|
|
||||||
@ -229,7 +228,8 @@ max_patterns = 5
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Combining `extra instructions` and `best practices` 💎
|
### Combining 'extra instructions' and 'best practices'
|
||||||
|
> `💎 feature`
|
||||||
|
|
||||||
The `extra instructions` configuration is more related to the `improve` tool prompt. It can be used, for example, to avoid specific suggestions ("Don't suggest to add try-except block", "Ignore changes in toml files", ...) or to emphasize specific aspects or formats ("Answer in Japanese", "Give only short suggestions", ...)
|
The `extra instructions` configuration is more related to the `improve` tool prompt. It can be used, for example, to avoid specific suggestions ("Don't suggest to add try-except block", "Ignore changes in toml files", ...) or to emphasize specific aspects or formats ("Answer in Japanese", "Give only short suggestions", ...)
|
||||||
|
|
||||||
@ -268,6 +268,8 @@ dual_publishing_score_threshold = x
|
|||||||
Where x represents the minimum score threshold (>=) for suggestions to be presented as commitable PR comments in addition to the table. Default is -1 (disabled).
|
Where x represents the minimum score threshold (>=) for suggestions to be presented as commitable PR comments in addition to the table. Default is -1 (disabled).
|
||||||
|
|
||||||
### Self-review
|
### Self-review
|
||||||
|
> `💎 feature`
|
||||||
|
|
||||||
If you set in a configuration file:
|
If you set in a configuration file:
|
||||||
```toml
|
```toml
|
||||||
[pr_code_suggestions]
|
[pr_code_suggestions]
|
||||||
@ -312,6 +314,7 @@ 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
|
### Auto-approval
|
||||||
|
> `💎 feature`
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
@ -123,10 +123,10 @@ class PRReviewer:
|
|||||||
if self.incremental.is_incremental and not self._can_run_incremental_review():
|
if self.incremental.is_incremental and not self._can_run_incremental_review():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if isinstance(self.args, list) and self.args and self.args[0] == 'auto_approve':
|
# if isinstance(self.args, list) and self.args and self.args[0] == 'auto_approve':
|
||||||
get_logger().info(f'Auto approve flow PR: {self.pr_url} ...')
|
# get_logger().info(f'Auto approve flow PR: {self.pr_url} ...')
|
||||||
self.auto_approve_logic()
|
# self.auto_approve_logic()
|
||||||
return None
|
# return None
|
||||||
|
|
||||||
get_logger().info(f'Reviewing PR: {self.pr_url} ...')
|
get_logger().info(f'Reviewing PR: {self.pr_url} ...')
|
||||||
relevant_configs = {'pr_reviewer': dict(get_settings().pr_reviewer),
|
relevant_configs = {'pr_reviewer': dict(get_settings().pr_reviewer),
|
||||||
@ -402,7 +402,7 @@ class PRReviewer:
|
|||||||
"""
|
"""
|
||||||
Auto-approve a pull request if it meets the conditions for auto-approval.
|
Auto-approve a pull request if it meets the conditions for auto-approval.
|
||||||
"""
|
"""
|
||||||
if get_settings().pr_reviewer.enable_auto_approval:
|
if get_settings().config.enable_auto_approval:
|
||||||
is_auto_approved = self.git_provider.auto_approve()
|
is_auto_approved = self.git_provider.auto_approve()
|
||||||
if is_auto_approved:
|
if is_auto_approved:
|
||||||
get_logger().info("Auto-approved PR")
|
get_logger().info("Auto-approved PR")
|
||||||
|
Reference in New Issue
Block a user