mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 05:40:38 +08:00
docs
This commit is contained in:
@ -168,17 +168,11 @@ The description should be comprehensive and detailed, indicating when to add the
|
|||||||
!!! tip "Automation"
|
!!! tip "Automation"
|
||||||
- When you first install PR-Agent app, the [default mode](../usage-guide/automations_and_usage.md#github-app) for the describe tool is:
|
- When you first install PR-Agent app, the [default mode](../usage-guide/automations_and_usage.md#github-app) for the describe tool is:
|
||||||
```
|
```
|
||||||
pr_commands = ["/describe --pr_description.add_original_user_description=true ..."]
|
pr_commands = ["/describe", ...]
|
||||||
```
|
```
|
||||||
meaning the `describe` tool will run automatically on every PR, and will add the original user description above the generated description.
|
meaning the `describe` tool will run automatically on every PR, with the default configurations.
|
||||||
<br> This default settings aim to strike a good balance between automation and control:
|
|
||||||
- If you want more automation, just give the PR a title, and the tool will auto-write a full description; If you want more control, you can add a detailed description, and the tool will add the complementary description below it.
|
|
||||||
- For maximal automation, you can change the default mode to:
|
|
||||||
```
|
|
||||||
pr_commands = ["/describe --pr_description.add_original_user_description=false"
|
|
||||||
" --pr_description.generate_ai_tile=true", ...]
|
|
||||||
```
|
|
||||||
so the title of the PR will be auto-generated as well.
|
|
||||||
- Markers are an alternative way to control the generated description, to give maximal control to the user. If you set:
|
- Markers are an alternative way to control the generated description, to give maximal control to the user. If you set:
|
||||||
```
|
```
|
||||||
pr_commands = ["/describe --pr_description.use_description_markers=true", ...]
|
pr_commands = ["/describe --pr_description.use_description_markers=true", ...]
|
||||||
|
@ -62,21 +62,21 @@ The configuration parameter `pr_commands` defines the list of tools that will be
|
|||||||
```
|
```
|
||||||
[github_app]
|
[github_app]
|
||||||
pr_commands = [
|
pr_commands = [
|
||||||
"/describe --pr_description.add_original_user_description=true --pr_description.final_update_message=false",
|
"/describe --pr_description.final_update_message=false",
|
||||||
"/review --pr_reviewer.num_code_suggestions=0",
|
"/review --pr_reviewer.num_code_suggestions=0",
|
||||||
"/improve",
|
"/improve",
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
This means that when a new PR is opened/reopened or marked as ready for review, PR-Agent will run the `describe`, `review` and `improve` tools.
|
This means that when a new PR is opened/reopened or marked as ready for review, PR-Agent will run the `describe`, `review` and `improve` tools.
|
||||||
For the `describe` tool, for example, the `add_original_user_description` parameter will be set to true.
|
For the `review` tool, for example, the `num_code_suggestions` parameter will be set to 0.
|
||||||
|
|
||||||
You can override the default tool parameters by using one the three options for a [configuration file](https://codium-ai.github.io/Docs-PR-Agent/usage-guide/#configuration-options): **wiki**, **local**, or **global**.
|
You can override the default tool parameters by using one the three options for a [configuration file](https://codium-ai.github.io/Docs-PR-Agent/usage-guide/#configuration-options): **wiki**, **local**, or **global**.
|
||||||
For example, if your local `.pr_agent.toml` file contains:
|
For example, if your local `.pr_agent.toml` file contains:
|
||||||
```
|
```
|
||||||
[pr_description]
|
[pr_description]
|
||||||
add_original_user_description = false
|
generate_ai_title = true
|
||||||
```
|
```
|
||||||
When a new PR is opened, PR-Agent will run the `describe` tool with the above parameters.
|
Every time you run the `describe` tool, including automatic runs, the PR title will be generated by the AI.
|
||||||
|
|
||||||
To cancel the automatic run of all the tools, set:
|
To cancel the automatic run of all the tools, set:
|
||||||
```
|
```
|
||||||
@ -101,7 +101,7 @@ The configuration parameter `push_commands` defines the list of tools that will
|
|||||||
[github_app]
|
[github_app]
|
||||||
handle_push_trigger = true
|
handle_push_trigger = true
|
||||||
push_commands = [
|
push_commands = [
|
||||||
"/describe --pr_description.add_original_user_description=true",
|
"/describe",
|
||||||
"/review --pr_reviewer.num_code_suggestions=0 --pr_reviewer.final_update_message=false",
|
"/review --pr_reviewer.num_code_suggestions=0 --pr_reviewer.final_update_message=false",
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
@ -141,7 +141,7 @@ After setting up a GitLab webhook, to control which commands will run automatica
|
|||||||
```
|
```
|
||||||
[gitlab]
|
[gitlab]
|
||||||
pr_commands = [
|
pr_commands = [
|
||||||
"/describe --pr_description.add_original_user_description=true",
|
"/describe",
|
||||||
"/review --pr_reviewer.num_code_suggestions=0",
|
"/review --pr_reviewer.num_code_suggestions=0",
|
||||||
"/improve",
|
"/improve",
|
||||||
]
|
]
|
||||||
@ -201,7 +201,7 @@ To control which commands will run automatically when a new PR is opened, you ca
|
|||||||
```
|
```
|
||||||
[azure_devops_server]
|
[azure_devops_server]
|
||||||
pr_commands = [
|
pr_commands = [
|
||||||
"/describe --pr_description.add_original_user_description=true",
|
"/describe",
|
||||||
"/review --pr_reviewer.num_code_suggestions=0",
|
"/review --pr_reviewer.num_code_suggestions=0",
|
||||||
"/improve",
|
"/improve",
|
||||||
]
|
]
|
||||||
|
@ -140,7 +140,7 @@ async def handle_new_pr_opened(body: Dict[str, Any],
|
|||||||
if not (pull_request and api_url):
|
if not (pull_request and api_url):
|
||||||
get_logger().info(f"Invalid PR event: {action=} {api_url=}")
|
get_logger().info(f"Invalid PR event: {action=} {api_url=}")
|
||||||
return {}
|
return {}
|
||||||
if action in get_settings().github_app.handle_pr_actions: # ['opened', 'reopened', 'ready_for_review', 'review_requested']
|
if action in get_settings().github_app.handle_pr_actions: # ['opened', 'reopened', 'ready_for_review']
|
||||||
if get_identity_provider().verify_eligibility("github", sender_id, api_url) is not Eligibility.NOT_ELIGIBLE:
|
if get_identity_provider().verify_eligibility("github", sender_id, api_url) is not Eligibility.NOT_ELIGIBLE:
|
||||||
await _perform_auto_commands_github("pr_commands", agent, body, api_url, log_context)
|
await _perform_auto_commands_github("pr_commands", agent, body, api_url, log_context)
|
||||||
else:
|
else:
|
||||||
|
@ -68,9 +68,9 @@ some_config2=...
|
|||||||
output += """\
|
output += """\
|
||||||
- When you first install the app, the [default mode](https://pr-agent-docs.codium.ai/usage-guide/automations_and_usage/#github-app-automatic-tools-when-a-new-pr-is-opened) for the describe tool is:
|
- When you first install the app, the [default mode](https://pr-agent-docs.codium.ai/usage-guide/automations_and_usage/#github-app-automatic-tools-when-a-new-pr-is-opened) for the describe tool is:
|
||||||
```
|
```
|
||||||
pr_commands = ["/describe --pr_description.add_original_user_description=true ..."]
|
pr_commands = ["/describe", ...]
|
||||||
```
|
```
|
||||||
meaning the `describe` tool will run automatically on every PR, and will add the original user description above the generated description.
|
meaning the `describe` tool will run automatically on every PR.
|
||||||
|
|
||||||
- Markers are an alternative way to control the generated description, to give maximal control to the user. If you set:
|
- Markers are an alternative way to control the generated description, to give maximal control to the user. If you set:
|
||||||
```
|
```
|
||||||
|
@ -148,7 +148,7 @@ override_deployment_type = true
|
|||||||
# settings for "pull_request" event
|
# settings for "pull_request" event
|
||||||
handle_pr_actions = ['opened', 'reopened', 'ready_for_review']
|
handle_pr_actions = ['opened', 'reopened', 'ready_for_review']
|
||||||
pr_commands = [
|
pr_commands = [
|
||||||
"/describe --pr_description.add_original_user_description=true",
|
"/describe",
|
||||||
"/review --pr_reviewer.num_code_suggestions=0",
|
"/review --pr_reviewer.num_code_suggestions=0",
|
||||||
"/improve",
|
"/improve",
|
||||||
]
|
]
|
||||||
@ -160,7 +160,7 @@ push_trigger_wait_for_initial_review = true
|
|||||||
push_trigger_pending_tasks_backlog = true
|
push_trigger_pending_tasks_backlog = true
|
||||||
push_trigger_pending_tasks_ttl = 300
|
push_trigger_pending_tasks_ttl = 300
|
||||||
push_commands = [
|
push_commands = [
|
||||||
"/describe --pr_description.add_original_user_description=true",
|
"/describe",
|
||||||
"/review --pr_reviewer.num_code_suggestions=0",
|
"/review --pr_reviewer.num_code_suggestions=0",
|
||||||
]
|
]
|
||||||
ignore_pr_title = []
|
ignore_pr_title = []
|
||||||
@ -169,7 +169,7 @@ ignore_bot_pr = true
|
|||||||
[gitlab]
|
[gitlab]
|
||||||
url = "https://gitlab.com" # URL to the gitlab service
|
url = "https://gitlab.com" # URL to the gitlab service
|
||||||
pr_commands = [
|
pr_commands = [
|
||||||
"/describe --pr_description.add_original_user_description=true",
|
"/describe",
|
||||||
"/review --pr_reviewer.num_code_suggestions=0",
|
"/review --pr_reviewer.num_code_suggestions=0",
|
||||||
"/improve",
|
"/improve",
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user