Files
pr-agent/docs/DESCRIBE.md

62 lines
2.6 KiB
Markdown
Raw Normal View History

2023-09-29 09:47:13 +03:00
# Describe Tool
The `describe` tool scans the PR code changes, and automatically generates PR description - title, type, summary, code walkthrough and labels.
2023-09-29 11:53:39 +03:00
It can be invoked manually by commenting on any PR:
2023-09-29 09:47:13 +03:00
```
/describe
```
For example:
<kbd><img src=./../pics/describe_comment.png width="768"></kbd>
<kbd><img src=./../pics/describe.png width="768"></kbd>
The `describe` tool can also be triggered automatically every time a new PR is opened. See examples for automatic triggers for [GitHub App](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) and [GitHub Action](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-action)
### Configuration options
Under the section 'pr_description', the [configuration file](./../pr_agent/settings/configuration.toml#L28) contains options to customize the 'describe' tool:
- `publish_labels`: if set to true, the tool will publish the labels to the PR. Default is true.
- `publish_description_as_comment`: if set to true, the tool will publish the description as a comment to the PR. If false, it will overwrite the origianl description. Default is false.
- `add_original_user_description`: if set to true, the tool will add the original user description to the generated description. Default is false.
2023-10-08 14:35:54 +03:00
- `keep_original_user_title`: if set to true, the tool will keep the original PR title, and won't change it. Default is false.
2023-09-29 09:47:13 +03:00
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
2023-10-19 11:43:18 +03:00
### Markers template
2023-09-29 09:47:13 +03:00
2023-09-29 11:53:39 +03:00
markers enable to easily integrate user's content and auto-generated content, with a template-like mechanism.
2023-09-29 09:47:13 +03:00
- `use_description_markers`: if set to true, the tool will use markers template. It replaces every marker of the form `pr_agent:marker_name` with the relevant content. Default is false.
2023-10-19 11:43:18 +03:00
- `include_generated_by_header`: if set to true, the tool will add a dedicated header: 'Generated by PR Agent at ...' to any automatic content. Default is true.
2023-09-29 11:53:39 +03:00
2023-09-29 09:47:13 +03:00
For example, if the PR original description was:
```
User content...
## PR Type:
pr_agent:pr_type
## PR Description:
pr_agent:summary
## PR Walkthrough:
pr_agent:walkthrough
```
The marker `pr_agent:pr_type` will be replaced with the PR type, `pr_agent:summary` will be replaced with the PR summary, and `pr_agent:walkthrough` will be replaced with the PR walkthrough.
2023-10-19 11:43:18 +03:00
##### Example:
2023-10-19 11:38:21 +03:00
```
env:
pr_description.use_description_markers: 'true'
```
<kbd><img src=./../pics/describe_markers_before.png width="768"></kbd>
2023-10-19 11:40:01 +03:00
2023-10-19 11:38:21 +03:00
==>
2023-10-19 11:40:01 +03:00
2023-10-19 11:38:21 +03:00
<kbd><img src=./../pics/describe_markers_after.png width="768"></kbd>