From 738eb055ff91aaa3ae5b3d530a2a5dc4636ccd6d Mon Sep 17 00:00:00 2001 From: mrT23 Date: Wed, 8 May 2024 14:28:38 +0300 Subject: [PATCH] s --- docs/docs/tools/review.md | 133 +++++++++++++----- .../docs/usage-guide/configuration_options.md | 7 +- 2 files changed, 96 insertions(+), 44 deletions(-) diff --git a/docs/docs/tools/review.md b/docs/docs/tools/review.md index 2e5c4bb6..97ea5e9f 100644 --- a/docs/docs/tools/review.md +++ b/docs/docs/tools/review.md @@ -40,45 +40,6 @@ num_code_suggestions = ... - The `pr_commands` lists commands that will be executed automatically when a PR is opened. - The `[pr_reviewer]` section contains the configurations for the `review` tool you want to edit (if any). - -## Configuration options - -### General configurations - -!!! example "General options" - - `num_code_suggestions`: number of code suggestions provided by the 'review' tool. For manual comments, default is 4. For [PR-Agent app](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L142) auto tools, default is 0, meaning no code suggestions will be provided by the review tool, unless you manually edit `pr_commands`. - - `inline_code_comments`: if set to true, the tool will publish the code suggestions as comments on the code diff. Default is false. - - `persistent_comment`: if set to true, the review comment will be persistent, meaning that every new review request will edit the previous one. Default is true. - - `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...". - - `enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true. - -!!! example "Enable\\disable sub-sections" - You can enable or disable specific sub-sections of the review tool: - - - `require_score_review`: if set to true, the tool will add a section that scores the PR. Default is false. - - `require_tests_review`: if set to true, the tool will add a section that checks if the PR contains tests. Default is true. - - `require_estimate_effort_to_review`: if set to true, the tool will add a section that estimates the effort needed to review the PR. Default is true. - - `require_can_be_split_review`: if set to true, the tool will add a section that checks if the PR contains several themes, and can be split into smaller PRs. Default is false. - -!!! example "SOC2 ticket compliance 💎" - - This sub-tool checks if the PR description properly contains a ticket to a project management system (e.g., Jira, Asana, Trello, etc.), as required by SOC2 compliance. If not, it will add a label to the PR: "Missing SOC2 ticket". - - - `require_soc2_ticket`: If set to true, the SOC2 ticket checker sub-tool will be enabled. Default is false. - - `soc2_ticket_prompt`: The prompt for the SOC2 ticket review. Default is: `Does the PR description include a link to ticket in a project management system (e.g., Jira, Asana, Trello, etc.) ?`. Edit this field if your compliance requirements are different. - -!!! example "Adding PR labels" - You can enable the tool to add specific labels to the PR: - - - `enable_review_labels_security`: if set to true, the tool will publish a 'possible security issue' label if it detects a security issue. Default is true. - - `enable_review_labels_effort`: if set to true, the tool will publish a 'Review effort [1-5]: x' label. Default is true. - -!!! example "Auto-approval" - The review tool can approve a PR when a specific comment, `/review auto_approve` is invoked. - - - `enable_auto_approval`: if set to true, the tool will approve the PR when invoked with the 'auto_approve' command. Default is false. This flag can be changed only from configuration file. - - `maximal_review_effort`: maximal effort level for auto-approval. If the PR's estimated review effort is above this threshold, the auto-approval will not run. Default is 5. - ### Incremental Mode Incremental review only considers changes since the last PR-Agent review. This can be useful when working on the PR in an iterative manner, and you want to focus on the changes since the last review instead of reviewing the entire PR again. For invoking the incremental mode, the following command can be used: @@ -104,6 +65,100 @@ The tool will first ask the author questions about the PR, and will guide the re ![reflection insights](https://codium.ai/images/pr_agent/reflection_insights.png){width=512} + +## Configuration options + +!!! example "General options" + + + + + + + + + + + + + + + + + + + + + + +
num_code_suggestionsNumber of code suggestions provided by the 'review' tool. For manual comments, default is 4. For PR-Agent app auto tools, default is 0, meaning no code suggestions will be provided by the review tool, unless you manually edit pr_commands.
inline_code_commentsIf set to true, the tool will publish the code suggestions as comments on the code diff. Default is false.
persistent_commentIf set to true, the review comment will be persistent, meaning that every new review request will edit the previous one. Default is true.
extra_instructionsOptional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
enable_help_textIf set to true, the tool will display a help text in the comment. Default is true.
+ +!!! example "Enable\\disable specific sub-sections" + + + + + + + + + + + + + + + + + + +
require_score_reviewIf set to true, the tool will add a section that scores the PR. Default is false.
require_tests_reviewIf set to true, the tool will add a section that checks if the PR contains tests. Default is true.
require_estimate_effort_to_reviewIf set to true, the tool will add a section that estimates the effort needed to review the PR. Default is true.
require_can_be_split_reviewIf set to true, the tool will add a section that checks if the PR contains several themes, and can be split into smaller PRs. Default is false.
+ +!!! example "SOC2 ticket compliance 💎" + +This sub-tool checks if the PR description properly contains a ticket to a project management system (e.g., Jira, Asana, Trello, etc.), as required by SOC2 compliance. If not, it will add a label to the PR: "Missing SOC2 ticket". + + + + + + + + + + +
require_soc2_ticketIf set to true, the SOC2 ticket checker sub-tool will be enabled. Default is false.
soc2_ticket_promptThe prompt for the SOC2 ticket review. Default is: `Does the PR description include a link to ticket in a project management system (e.g., Jira, Asana, Trello, etc.) ?`. Edit this field if your compliance requirements are different.
+ +!!! example "Adding PR labels" + +You can enable\disable the `review` tool to add specific labels to the PR: + + + + + + + + + + +
enable_review_labels_securityIf set to true, the tool will publish a 'possible security issue' label if it detects a security issue. Default is true.
enable_review_labels_effortIf set to true, the tool will publish a 'Review effort [1-5]: x' label. Default is true.
+ +!!! example "Auto-approval" + +If enabled, the `review` tool can approve a PR when a specific comment, `/review auto_approve`, is invoked. + + + + + + + + + + +
enable_auto_approvalIf set to true, the tool will approve the PR when invoked with the 'auto_approve' command. Default is false. This flag can be changed only from configuration file.
maximal_review_effortMaximal effort level for auto-approval. If the PR's estimated review effort is above this threshold, the auto-approval will not run. Default is 5.
+ ## Usage Tips !!! tip "General guidelines" diff --git a/docs/docs/usage-guide/configuration_options.md b/docs/docs/usage-guide/configuration_options.md index 99287957..68a8492b 100644 --- a/docs/docs/usage-guide/configuration_options.md +++ b/docs/docs/usage-guide/configuration_options.md @@ -11,11 +11,8 @@ There are three ways to set persistent configurations: In terms of precedence, wiki configurations will override local configurations, and local configurations will override global configurations. -!!! tip "Edit only what you need" - - Your configuration file should be minimal, and edit only the relevant values. Don't copy the entire configuration options, since it can lead to legacy problems when something changes. - - +!!! tip "Tip: edit only what you need" + Your configuration file should be minimal, and edit only the relevant values. Don't copy the entire configuration options, since it can lead to legacy problems when something changes. ## Wiki configuration file 💎