From 75a27d64b4cca2315480ae8f03f9977d4ee3993e Mon Sep 17 00:00:00 2001 From: mrT23 Date: Wed, 5 Jun 2024 20:26:45 +0300 Subject: [PATCH 1/2] gitlab push_commands --- docs/docs/usage-guide/automations_and_usage.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/docs/usage-guide/automations_and_usage.md b/docs/docs/usage-guide/automations_and_usage.md index 35c95099..9c6185b2 100644 --- a/docs/docs/usage-guide/automations_and_usage.md +++ b/docs/docs/usage-guide/automations_and_usage.md @@ -136,7 +136,7 @@ publish_labels = false to prevent PR-Agent from publishing labels when running the `describe` tool. ## GitLab Webhook -After setting up a GitLab webhook, to control which commands will run automatically when a new PR is opened, you can set the `pr_commands` parameter in the configuration file, similar to the GitHub App: +After setting up a GitLab webhook, to control which commands will run automatically when a new MR is opened, you can set the `pr_commands` parameter in the configuration file, similar to the GitHub App: ``` [gitlab] pr_commands = [ @@ -146,6 +146,20 @@ pr_commands = [ ] ``` +the GitLab webhook can also respond to new code that is pushed to an open MR. +The configuration toggle `handle_push_trigger` can be used to enable this feature. +The configuration parameter `push_commands` defines the list of tools that will be **run automatically** when new code is pushed to the MR. +``` +[gitlab] +handle_push_trigger = true +push_commands = [ + "/describe", + "/review --pr_reviewer.num_code_suggestions=0 --pr_reviewer.final_update_message=false", +] +``` + +Note that to use the 'handle_push_trigger' feature, you need give the gitlab webhook also the "Push events" scope. + ## BitBucket App Similar to GitHub app, when running PR-Agent from BitBucket App, the default [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml) from a pre-built docker will be initially loaded. From 9c6a363a5168c90a4da409844a76cdbf0a124efa Mon Sep 17 00:00:00 2001 From: mrT23 Date: Wed, 5 Jun 2024 20:31:35 +0300 Subject: [PATCH 2/2] gitlab push_commands --- docs/docs/usage-guide/automations_and_usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/usage-guide/automations_and_usage.md b/docs/docs/usage-guide/automations_and_usage.md index 9c6185b2..f72afe9e 100644 --- a/docs/docs/usage-guide/automations_and_usage.md +++ b/docs/docs/usage-guide/automations_and_usage.md @@ -158,7 +158,7 @@ push_commands = [ ] ``` -Note that to use the 'handle_push_trigger' feature, you need give the gitlab webhook also the "Push events" scope. +Note that to use the 'handle_push_trigger' feature, you need to give the gitlab webhook also the "Push events" scope. ## BitBucket App Similar to GitHub app, when running PR-Agent from BitBucket App, the default [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml) from a pre-built docker will be initially loaded.