Merge remote-tracking branch 'origin/tr/readme_updates' into tr/readme_updates

# Conflicts:
#	CONFIGURATION.md
This commit is contained in:
mrT23
2023-09-01 20:14:56 +03:00

View File

@ -2,36 +2,18 @@
The different tools and sub-tools used by CodiumAI PR-Agent are adjustable via the **[configuration file](pr_agent/settings/configuration.toml)**
The `git_provider` field in the configuration file determines the GIT provider that will be used by PR-Agent. Currently, the following providers are supported:
`
"github", "gitlab", "azure", "codecommit", "local"
`
Options that are available in the configuration file can be specified at run time when calling actions. Two examples:
```
- /review --pr_reviewer.extra_instructions="focus on the file: ..."
- /describe --pr_description.add_original_user_description=false -pr_description.extra_instructions="make sure to mention: ..."
```
### Working from CLI
When running from source (CLI), your local configuration file will be used.
When running from source (CLI), your local configuration file will be initially used.
Examples for invoking the different tools via the CLI:
Example for invoking the 'review' tools via the CLI:
- **Review**: `python cli.py --pr_url=<pr_url> review`
- **Describe**: `python cli.py --pr_url=<pr_url> describe`
- **Improve**: `python cli.py --pr_url=<pr_url> improve`
- **Ask**: `python cli.py --pr_url=<pr_url> ask "Write me a poem about this PR"`
- **Reflect**: `python cli.py --pr_url=<pr_url> reflect`
- **Update Changelog**: `python cli.py --pr_url=<pr_url> update_changelog`
```
python cli.py --pr-url=<pr_url> review
```
In addition to general configurations, the 'review' tool will use parameters from the `[pr_reviewer]` section (every tool has a dedicated section in the configuration file).
`<pr_url>` is the url of the relevant PR (for example: https://github.com/Codium-ai/pr-agent/pull/50).
Note that you can print results locally, without publishing them, by setting in `configuration.toml`:
**Notes:**
(1) In addition to general configuration options, each tool has its own configurations. For example, the 'review' tool will use parameters from the `[pr_reviewer]` section in the [configuration file](/pr_agent/settings/configuration.toml#L16)
(2) You can print results locally, without publishing them, by setting in `configuration.toml`:
```
[config]
publish_output=true
@ -40,7 +22,7 @@ verbosity_level=2
This is useful for debugging or experimenting with the different tools.
### Working from GitHub App (pre-built repo)
When running PR-Agent from GitHub App, the default configuration file (`configuration.toml`) will be initially loaded.
When running PR-Agent from GitHub App, the default configuration file (`configuration.toml`) will be loaded.
#### GitHub app default tools
The `[github_app]` section defines the GitHub app specific configurations.
@ -55,7 +37,7 @@ pr_commands = [
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.
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]
@ -109,13 +91,23 @@ key = ...
Also review the [AiHandler](pr_agent/algo/ai_handler.py) file for instruction how to set keys for other models.
#### Changing a GIT provider
See [here](pr_agent/git_providers/__init__.py) for the list of GIT providers.
To use GitHub, for example, set:
```
[config]
git_provider="github"
```
#### Extra instructions
##### General
All PR-Agent tools have a parameter called `extra_instructions`, that enables to add free-text extra instructions. Example usage:
```
/update_changelog --pr_update_changelog.extra_instructions="Make sure to update also the version ..."
```
#### Azure DevOps provider
##### Azure DevOps provider
To use Azure DevOps provider use the following settings in configuration.toml:
```
[config]