From 3b071ccb4e8a5d9ba64456b379185dffbed7372e Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Wed, 2 Jul 2025 19:11:53 +0530 Subject: [PATCH 1/4] apply repository settings before processing push commands in GitLab webhook --- pr_agent/servers/gitlab_webhook.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pr_agent/servers/gitlab_webhook.py b/pr_agent/servers/gitlab_webhook.py index af777a9a..a699f190 100644 --- a/pr_agent/servers/gitlab_webhook.py +++ b/pr_agent/servers/gitlab_webhook.py @@ -234,6 +234,8 @@ async def gitlab_webhook(background_tasks: BackgroundTasks, request: Request): get_logger().info(f"Skipping draft MR: {url}") return JSONResponse(status_code=status.HTTP_200_OK, content=jsonable_encoder({"message": "success"})) + # Apply repo settings before checking push commands or handle_push_trigger + apply_repo_settings(url) commands_on_push = get_settings().get(f"gitlab.push_commands", {}) handle_push_trigger = get_settings().get(f"gitlab.handle_push_trigger", False) if not commands_on_push or not handle_push_trigger: From 8a7b37ab4cd735bb20116f48e967dbb2a914b911 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Wed, 2 Jul 2025 19:13:01 +0530 Subject: [PATCH 2/4] Revert "clarify that Fetching Ticket Context affects Ask tool" This reverts commit 822a253eb593192b9f5d9a2061a49cc336445d70. --- README.md | 6 +++--- docs/docs/core-abilities/fetching_ticket_context.md | 9 --------- docs/docs/index.md | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f6e24e18..0ee113a8 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Supported commands per platform: | | [Chat on code suggestions](https://qodo-merge-docs.qodo.ai/core-abilities/chat_on_code_suggestions/) | βœ… | βœ… | | | | | | [Code Validation πŸ’Ž](https://qodo-merge-docs.qodo.ai/core-abilities/code_validation/) | βœ… | βœ… | βœ… | βœ… | | | | [Dynamic context](https://qodo-merge-docs.qodo.ai/core-abilities/dynamic_context/) | βœ… | βœ… | βœ… | βœ… | | -| | [Fetching ticket context](https://qodo-merge-docs.qodo.ai/core-abilities/fetching_ticket_context/) | βœ… | βœ… | βœ… | βœ… | | +| | [Fetching ticket context](https://qodo-merge-docs.qodo.ai/core-abilities/fetching_ticket_context/) | βœ… | βœ… | βœ… | | | | | [Global and wiki configurations](https://qodo-merge-docs.qodo.ai/usage-guide/configuration_options/) πŸ’Ž | βœ… | βœ… | βœ… | | | | | [Impact Evaluation](https://qodo-merge-docs.qodo.ai/core-abilities/impact_evaluation/) πŸ’Ž | βœ… | βœ… | | | | | | [Incremental Update](https://qodo-merge-docs.qodo.ai/core-abilities/incremental_update/) | βœ… | | | | | @@ -249,9 +249,9 @@ https://openai.com/enterprise-privacy - When using Qodo Merge πŸ’Ž, hosted by Qodo, we will not store any of your data, nor will we use it for training. You will also benefit from an OpenAI account with zero data retention. -- For certain clients, Qodo-hosted Qodo Merge will use Qodo's proprietary models β€” if this is the case, you will be notified. +- For certain clients, Qodo-hosted Qodo Merge will use Qodo’s proprietary models β€” if this is the case, you will be notified. -- No passive collection of Code and Pull Requests' data β€” Qodo Merge will be active only when you invoke it, and it will then extract and analyze only data relevant to the executed command and queried pull request. +- No passive collection of Code and Pull Requests’ data β€” Qodo Merge will be active only when you invoke it, and it will then extract and analyze only data relevant to the executed command and queried pull request. ### Qodo Merge Chrome extension diff --git a/docs/docs/core-abilities/fetching_ticket_context.md b/docs/docs/core-abilities/fetching_ticket_context.md index ed8c81f0..63cd65f4 100644 --- a/docs/docs/core-abilities/fetching_ticket_context.md +++ b/docs/docs/core-abilities/fetching_ticket_context.md @@ -50,15 +50,6 @@ Each ticket will be assigned a label (Compliance/Alignment level), Indicates the A `PR Code Verified` label indicates the PR code meets ticket requirements, but requires additional manual testing beyond the code scope. For example - validating UI display across different environments (Mac, Windows, mobile, etc.). -### Ask tool - -The `ask` tool will also leverage the ticket content (title, description, labels, etc.) to provide additional context when answering questions about the PR. This means that when you use the Ask tool, it can: - -- Use ticket context to provide more relevant and accurate answers to your questions about the PR. -- Directly answer questions related to the ticket itself, such as its requirements, acceptance criteria, or intent. -- Help clarify how the code changes relate to the ticket, or whether the PR fulfills the ticket's goals. - -By including ticket context, the Ask tool ensures that responses are as informed and useful as those from the Describe and Review tools. #### Configuration options diff --git a/docs/docs/index.md b/docs/docs/index.md index 8f0af294..46f49ff2 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -60,7 +60,7 @@ PR-Agent and Qodo Merge offers extensive pull request functionalities across var | | [Chat on code suggestions](https://qodo-merge-docs.qodo.ai/core-abilities/chat_on_code_suggestions/) | βœ… | βœ… | | | | | | [Code Validation πŸ’Ž](https://qodo-merge-docs.qodo.ai/core-abilities/code_validation/) | βœ… | βœ… | βœ… | βœ… | | | | [Dynamic context](https://qodo-merge-docs.qodo.ai/core-abilities/dynamic_context/) | βœ… | βœ… | βœ… | βœ… | | -| | [Fetching ticket context](https://qodo-merge-docs.qodo.ai/core-abilities/fetching_ticket_context/) | βœ… | βœ… | βœ… | βœ… | | +| | [Fetching ticket context](https://qodo-merge-docs.qodo.ai/core-abilities/fetching_ticket_context/) | βœ… | βœ… | βœ… | | | | | [Global and wiki configurations](https://qodo-merge-docs.qodo.ai/usage-guide/configuration_options/) πŸ’Ž | βœ… | βœ… | βœ… | | | | | [Impact Evaluation](https://qodo-merge-docs.qodo.ai/core-abilities/impact_evaluation/) πŸ’Ž | βœ… | βœ… | | | | | | [Incremental Update πŸ’Ž](https://qodo-merge-docs.qodo.ai/core-abilities/incremental_update/) | βœ… | | | | | From a3d52f9cc7dde525fc377ef58d522534c0ddbcaf Mon Sep 17 00:00:00 2001 From: Tal Date: Sat, 5 Jul 2025 09:05:23 +0300 Subject: [PATCH 3/4] Update pr_agent/servers/gitlab_webhook.py Co-authored-by: qodo-merge-for-open-source[bot] <189517486+qodo-merge-for-open-source[bot]@users.noreply.github.com> --- pr_agent/servers/gitlab_webhook.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pr_agent/servers/gitlab_webhook.py b/pr_agent/servers/gitlab_webhook.py index a699f190..c020ec44 100644 --- a/pr_agent/servers/gitlab_webhook.py +++ b/pr_agent/servers/gitlab_webhook.py @@ -236,6 +236,8 @@ async def gitlab_webhook(background_tasks: BackgroundTasks, request: Request): # Apply repo settings before checking push commands or handle_push_trigger apply_repo_settings(url) + + commands_on_push = get_settings().get(f"gitlab.push_commands", {}) commands_on_push = get_settings().get(f"gitlab.push_commands", {}) handle_push_trigger = get_settings().get(f"gitlab.handle_push_trigger", False) if not commands_on_push or not handle_push_trigger: From 34cc434459e555f651aa6c6536c632a7e305b7f6 Mon Sep 17 00:00:00 2001 From: Tal Date: Sat, 5 Jul 2025 09:07:47 +0300 Subject: [PATCH 4/4] Update gitlab_webhook.py --- pr_agent/servers/gitlab_webhook.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pr_agent/servers/gitlab_webhook.py b/pr_agent/servers/gitlab_webhook.py index c020ec44..60f13501 100644 --- a/pr_agent/servers/gitlab_webhook.py +++ b/pr_agent/servers/gitlab_webhook.py @@ -237,7 +237,6 @@ async def gitlab_webhook(background_tasks: BackgroundTasks, request: Request): # Apply repo settings before checking push commands or handle_push_trigger apply_repo_settings(url) - commands_on_push = get_settings().get(f"gitlab.push_commands", {}) commands_on_push = get_settings().get(f"gitlab.push_commands", {}) handle_push_trigger = get_settings().get(f"gitlab.handle_push_trigger", False) if not commands_on_push or not handle_push_trigger: @@ -286,8 +285,8 @@ def handle_ask_line(body, data): question = body.replace('/ask', '').strip() path = data['object_attributes']['position']['new_path'] side = 'RIGHT' # if line_range_['start']['type'] == 'new' else 'LEFT' - comment_id = data['object_attributes']["discussion_id"] - get_logger().info("Handling line comment") + _id = data['object_attributes']["discussion_id"] + get_logger().info("Handling line ") body = f"/ask_line --line_start={start_line} --line_end={end_line} --side={side} --file_name={path} --comment_id={comment_id} {question}" except Exception as e: get_logger().error(f"Failed to handle ask line comment: {e}")