mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 03:40:38 +08:00
Merge pull request #258 from Codium-ai/tr/github_app
Update GitHub App Configuration Instructions
This commit is contained in:
@ -21,20 +21,43 @@ verbosity_level=2
|
|||||||
```
|
```
|
||||||
This is useful for debugging or experimenting with the different tools.
|
This is useful for debugging or experimenting with the different tools.
|
||||||
|
|
||||||
### Working from pre-built repo (GitHub Action/GitHub App/Docker)
|
### Working from GitHub App (pre-built repo)
|
||||||
When running PR-Agent from a pre-built repo, the default configuration file will be loaded.
|
When running PR-Agent from GitHub App, the default configuration file (`configuration.toml`) will be loaded.
|
||||||
|
|
||||||
To edit the configuration, you have two options:
|
#### GitHub app default tools
|
||||||
1. Place a local configuration file in the root of your local repo. The local file will be used instead of the default one.
|
The `[github_app]` section of the configuration file defines GitHub app specific configurations.
|
||||||
2. For online usage, just add `--config_path=<value>` to you command, to edit a specific configuration value.
|
The important parameter is `pr_commands`, which is a list of tools that will be run automatically when a new PR is opened:
|
||||||
|
```
|
||||||
|
[github_app]
|
||||||
|
pr_commands = [
|
||||||
|
"/describe --pr_description.add_original_user_description=true --pr_description.keep_original_user_title=true",
|
||||||
|
"/auto_review",
|
||||||
|
]
|
||||||
|
```
|
||||||
|
This means that when a new PR is opened, PR-Agent will run the `describe` and `auto_review` tools.
|
||||||
|
For the describe tool, the `add_original_user_description` and `keep_original_user_title` parameters will be set to `true`.
|
||||||
|
|
||||||
|
However, you can override the default tool parameters by uploading a local configuration file called `.pr_agent.toml` to the root of your repo.
|
||||||
|
For example, if your local `.pr_agent.toml` file contains:
|
||||||
|
```
|
||||||
|
[pr_description]
|
||||||
|
add_original_user_description = false
|
||||||
|
keep_original_user_title = false
|
||||||
|
```
|
||||||
|
Then when a new PR is opened, PR-Agent will run the `describe` tool with the above parameters.
|
||||||
|
|
||||||
|
Note that a local `.pr_agent.toml` file enables you to edit and customize the default parameters of any tool, not just the ones that are run automatically.
|
||||||
|
|
||||||
|
#### Online usage
|
||||||
|
For online usage (calling tools by comments on a PR like `/ask ...`), just add `--config_path=<value>` to any command, to edit a specific configuration value.
|
||||||
For example if you want to edit `pr_reviewer` configurations, you can run:
|
For example if you want to edit `pr_reviewer` configurations, you can run:
|
||||||
```
|
```
|
||||||
/review --pr_reviewer.extra_instructions="..." --pr_reviewer.require_score_review=false ...
|
/review --pr_reviewer.extra_instructions="..." --pr_reviewer.require_score_review=false ...
|
||||||
```
|
```
|
||||||
|
|
||||||
Any configuration value in `configuration.toml` file can be similarly edited.
|
Any configuration value in `configuration.toml` file can be similarly edited.
|
||||||
|
|
||||||
### General configuration parameters
|
|
||||||
|
### General configuration walkthrough
|
||||||
|
|
||||||
#### Changing a model
|
#### Changing a model
|
||||||
See [here](pr_agent/algo/__init__.py) for the list of available models.
|
See [here](pr_agent/algo/__init__.py) for the list of available models.
|
||||||
|
Reference in New Issue
Block a user