From c7c411eb63a47e06b0c3b27dfa1e234e70ea772d Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Sun, 9 Mar 2025 14:26:01 +0200 Subject: [PATCH 1/4] docs: update auto-approval documentation with clearer configuration options --- docs/docs/tools/improve.md | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/docs/docs/tools/improve.md b/docs/docs/tools/improve.md index 4292ef7b..846faf09 100644 --- a/docs/docs/tools/improve.md +++ b/docs/docs/tools/improve.md @@ -318,15 +318,25 @@ code_suggestions_self_review_text = "... (your text here) ..." Under specific conditions, Qodo Merge can auto-approve a PR when a specific comment is invoked, or when the PR meets certain criteria. -To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set, in a pre-defined _configuration file_, the following: +To ensure safety, the auto-approval feature is disabled by default. +To enable auto-approval, you need to actively set, in a pre-defined _configuration file_, by enabling either one the following configs: ```toml [config] +enable_manual_approval = true enable_auto_approval = true ``` -Note that this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository. -This ensures that enabling auto-approval is a deliberate decision by the repository owner. -**(1) Auto-approval by commenting** +!!! note "Notes" + - Note that this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository. + - Enabling auto-approval must be a deliberate decision by the repository owner. + +1\. **Auto-approval by commenting** +To enable auto-approval by commenting, set in the configuration file: + +```toml +[config] +enable_manual_approval = true +``` After enabling, by commenting on a PR: ``` @@ -334,13 +344,20 @@ After enabling, by commenting on a PR: ``` Qodo Merge will automatically approve the PR, and add a comment with the approval. -**(2) Auto-approval when the PR meets certain criteria** +2\. **Auto-approval when the PR meets certain criteria** + +To enable auto-approval based on specific criteria, first, you need to enable the top-level flag: +```toml +[config] +enable_auto_approval = true +``` There are two criteria that can be set for auto-approval: - **Review effort score** ```toml [config] +enable_auto_approval = true auto_approve_for_low_review_effort = X # X is a number between 1 to 5 ``` When the [review effort score](https://www.qodo.ai/images/pr_agent/review3.png) is lower or equal to X, the PR will be auto-approved. @@ -349,6 +366,7 @@ ___ - **No code suggestions** ```toml [config] +enable_auto_approval = true auto_approve_for_no_suggestions = true ``` When no [code suggestion](https://www.qodo.ai/images/pr_agent/code_suggestions_as_comment_closed.png) were found for the PR, the PR will be auto-approved. From c6e44986539961ea503f424cfcda18ebc8b39ffa Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Sun, 9 Mar 2025 15:03:45 +0200 Subject: [PATCH 2/4] docs: improve auto-approval documentation formatting and clarity --- docs/docs/tools/improve.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/docs/tools/improve.md b/docs/docs/tools/improve.md index 846faf09..c6059aab 100644 --- a/docs/docs/tools/improve.md +++ b/docs/docs/tools/improve.md @@ -318,12 +318,12 @@ code_suggestions_self_review_text = "... (your text here) ..." Under specific conditions, Qodo Merge can auto-approve a PR when a specific comment is invoked, or when the PR meets certain criteria. -To ensure safety, the auto-approval feature is disabled by default. -To enable auto-approval, you need to actively set, in a pre-defined _configuration file_, by enabling either one the following configs: +**To ensure safety, the auto-approval feature is disabled by default.** +To enable auto-approval features, you need to actively set one or both of the following options in a pre-defined _configuration file_: ```toml [config] -enable_manual_approval = true -enable_auto_approval = true +enable_manual_approval = true # For approval via comments +enable_auto_approval = true # For criteria-based auto-approval ``` !!! note "Notes" @@ -331,6 +331,7 @@ enable_auto_approval = true - Enabling auto-approval must be a deliberate decision by the repository owner. 1\. **Auto-approval by commenting** + To enable auto-approval by commenting, set in the configuration file: ```toml From 338ec5cae06671406a1b104143a395882caef2bc Mon Sep 17 00:00:00 2001 From: Hussam Lawen Date: Sun, 9 Mar 2025 16:45:08 +0200 Subject: [PATCH 3/4] Update docs/docs/tools/improve.md Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com> --- docs/docs/tools/improve.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/docs/tools/improve.md b/docs/docs/tools/improve.md index c6059aab..876a2505 100644 --- a/docs/docs/tools/improve.md +++ b/docs/docs/tools/improve.md @@ -333,7 +333,6 @@ enable_auto_approval = true # For criteria-based auto-approval 1\. **Auto-approval by commenting** To enable auto-approval by commenting, set in the configuration file: - ```toml [config] enable_manual_approval = true From 884b49dd8489dc73590aca4e16fce3c263b7c5d3 Mon Sep 17 00:00:00 2001 From: "Hussam.lawen" Date: Sun, 9 Mar 2025 17:01:04 +0200 Subject: [PATCH 4/4] Add encoded: enable_manual_approval --- pr_agent/algo/cli_args.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/algo/cli_args.py b/pr_agent/algo/cli_args.py index 44324697..33009af2 100644 --- a/pr_agent/algo/cli_args.py +++ b/pr_agent/algo/cli_args.py @@ -9,7 +9,7 @@ class CliArgs: return True, "" # decode forbidden args - _encoded_args = 'ZW5hYmxlX2F1dG9fYXBwcm92YWw=:YXBwcm92ZV9wcl9vbl9zZWxmX3Jldmlldw==:YmFzZV91cmw=:dXJs:YXBwX25hbWU=:c2VjcmV0X3Byb3ZpZGVy:Z2l0X3Byb3ZpZGVy:c2tpcF9rZXlz:b3BlbmFpLmtleQ==:QU5BTFlUSUNTX0ZPTERFUg==:dXJp:YXBwX2lk:d2ViaG9va19zZWNyZXQ=:YmVhcmVyX3Rva2Vu:UEVSU09OQUxfQUNDRVNTX1RPS0VO:b3ZlcnJpZGVfZGVwbG95bWVudF90eXBl:cHJpdmF0ZV9rZXk=:bG9jYWxfY2FjaGVfcGF0aA==:ZW5hYmxlX2xvY2FsX2NhY2hl:amlyYV9iYXNlX3VybA==:YXBpX2Jhc2U=:YXBpX3R5cGU=:YXBpX3ZlcnNpb24=:c2tpcF9rZXlz' + _encoded_args = 'ZW5hYmxlX21hbnVhbF9hcHByb3ZhbA==:ZW5hYmxlX2F1dG9fYXBwcm92YWw=:YXBwcm92ZV9wcl9vbl9zZWxmX3Jldmlldw==:YmFzZV91cmw=:dXJs:YXBwX25hbWU=:c2VjcmV0X3Byb3ZpZGVy:Z2l0X3Byb3ZpZGVy:c2tpcF9rZXlz:b3BlbmFpLmtleQ==:QU5BTFlUSUNTX0ZPTERFUg==:dXJp:YXBwX2lk:d2ViaG9va19zZWNyZXQ=:YmVhcmVyX3Rva2Vu:UEVSU09OQUxfQUNDRVNTX1RPS0VO:b3ZlcnJpZGVfZGVwbG95bWVudF90eXBl:cHJpdmF0ZV9rZXk=:bG9jYWxfY2FjaGVfcGF0aA==:ZW5hYmxlX2xvY2FsX2NhY2hl:amlyYV9iYXNlX3VybA==:YXBpX2Jhc2U=:YXBpX3R5cGU=:YXBpX3ZlcnNpb24=:c2tpcF9rZXlz' forbidden_cli_args = [] for e in _encoded_args.split(':'): forbidden_cli_args.append(b64decode(e).decode())