From 307b3b4bf7560ee676636d9dc810329e1c794f14 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Wed, 30 Aug 2023 19:42:46 +0300 Subject: [PATCH 1/3] GitHub App instructions --- CONFIGURATION.md | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 9bbfd910..79f86313 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -21,20 +21,41 @@ verbosity_level=2 ``` This is useful for debugging or experimenting with the different tools. -### Working from pre-built repo (GitHub Action/GitHub App/Docker) -When running PR-Agent from a pre-built repo, the default configuration file will be loaded. +### Working from GitHub App (pre-built repo) +When running PR-Agent from GitHub App, the default configuration file (`configuration.toml`) will be loaded. -To edit the configuration, you have two options: -1. Place a local configuration file in the root of your local repo. The local file will be used instead of the default one. -2. For online usage, just add `--config_path=` to you command, to edit a specific configuration value. +#### GitHub app default tools +The GitHub app configuration is defined in the `[github_app]` section of the configuration file. +The main parameter is `pr_commands`, which is a list of tools to run 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 actions parameters by uploading a local configuration 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. + +#### Online usage +For online usage (calling tools by comments on a PR), just add `--config_path=` to any command, to edit a specific configuration value. For example if you want to edit `pr_reviewer` configurations, you can run: ``` /review --pr_reviewer.extra_instructions="..." --pr_reviewer.require_score_review=false ... ``` - Any configuration value in `configuration.toml` file can be similarly edited. -### General configuration parameters + +### General configuration walkthrough #### Changing a model See [here](pr_agent/algo/__init__.py) for the list of available models. From ad6dd38fe37a7b700eea4ebc5ec8c831f0c61429 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Wed, 30 Aug 2023 19:46:33 +0300 Subject: [PATCH 2/3] GitHub App instructions --- CONFIGURATION.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 79f86313..07cc5701 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -25,7 +25,7 @@ This is useful for debugging or experimenting with the different tools. When running PR-Agent from GitHub App, the default configuration file (`configuration.toml`) will be loaded. #### GitHub app default tools -The GitHub app configuration is defined in the `[github_app]` section of the configuration file. +The GitHub app specific configurations are defined in the `[github_app]` section of the configuration file. The main parameter is `pr_commands`, which is a list of tools to run when a new PR is opened: ``` [github_app] @@ -37,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 actions parameters by uploading a local configuration called `.pr_agent.toml`, to the root of your repo. +However, you can override the default tool parameters by uploading a local configuration called `.pr_agent.toml`, to the root of your repo. For example, if your local `.pr_agent.toml` file contains: ``` [pr_description] @@ -46,6 +46,8 @@ 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 by default. + #### Online usage For online usage (calling tools by comments on a PR), just add `--config_path=` to any command, to edit a specific configuration value. For example if you want to edit `pr_reviewer` configurations, you can run: From 3c27432f50ba074171896761ec1e4e6b7c35f3f5 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Wed, 30 Aug 2023 19:53:28 +0300 Subject: [PATCH 3/3] GitHub App instructions --- CONFIGURATION.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 07cc5701..66ec4f06 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -25,8 +25,8 @@ This is useful for debugging or experimenting with the different tools. When running PR-Agent from GitHub App, the default configuration file (`configuration.toml`) will be loaded. #### GitHub app default tools -The GitHub app specific configurations are defined in the `[github_app]` section of the configuration file. -The main parameter is `pr_commands`, which is a list of tools to run when a new PR is opened: +The `[github_app]` section of the configuration file defines GitHub app specific configurations. +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 = [ @@ -37,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 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] @@ -46,10 +46,10 @@ 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 by default. +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), just add `--config_path=` to any command, to edit a specific configuration value. +For online usage (calling tools by comments on a PR like `/ask ...`), just add `--config_path=` to any command, to edit a specific configuration value. For example if you want to edit `pr_reviewer` configurations, you can run: ``` /review --pr_reviewer.extra_instructions="..." --pr_reviewer.require_score_review=false ...