From c605e3c497b9d170a9f455acd16215b1b24cc958 Mon Sep 17 00:00:00 2001 From: Meni Yakove Date: Fri, 21 Nov 2025 00:04:27 +0200 Subject: [PATCH] fix: correct PR welcome message formatting Fixed broken markdown formatting in PR welcome message caused by improper string concatenation inside f-strings. The bug caused literal quote marks and escaped newlines to appear in the rendered markdown. Changes: - Removed explicit string concatenation quotes inside f-string (lines 293-295) - Added proper newline spacing before Pre-commit Checks bullet - Removed redundant trailing newlines from issue_creation_note variable The welcome message now renders cleanly with proper markdown formatting. --- .../libs/handlers/pull_request_handler.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/webhook_server/libs/handlers/pull_request_handler.py b/webhook_server/libs/handlers/pull_request_handler.py index ef7f81c8..126b4671 100644 --- a/webhook_server/libs/handlers/pull_request_handler.py +++ b/webhook_server/libs/handlers/pull_request_handler.py @@ -277,10 +277,10 @@ def _prepare_welcome_comment(self) -> str: if self.github_webhook.create_issue_for_new_pr: issue_creation_note = ( "* **Issue Creation**: A tracking issue is created for this PR " - "and will be closed when the PR is merged or closed\n" + "and will be closed when the PR is merged or closed" ) else: - issue_creation_note = "* **Issue Creation**: Disabled for this repository\n" + issue_creation_note = "* **Issue Creation**: Disabled for this repository" return f""" {self.github_webhook.issue_url_for_welcome_msg} @@ -290,13 +290,10 @@ def _prepare_welcome_comment(self) -> str: This pull request will be automatically processed with the following features:{auto_verified_note} ### 🔄 Automatic Actions -* **Reviewer Assignment**: Reviewers are automatically assigned based on the " - "OWNERS file in the repository root\n" - "* **Size Labeling**: PR size labels (XS, S, M, L, XL, XXL) are " - "automatically applied based on changes\n" - f"{issue_creation_note}" - "* **Pre-commit Checks**: [pre-commit](https://pre-commit.ci/) runs " - "automatically if `.pre-commit-config.yaml` exists\n" +* **Reviewer Assignment**: Reviewers are automatically assigned based on the OWNERS file in the repository root +* **Size Labeling**: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes +{issue_creation_note} +* **Pre-commit Checks**: [pre-commit](https://pre-commit.ci/) runs automatically if `.pre-commit-config.yaml` exists * **Branch Labeling**: Branch-specific labels are applied to track the target branch * **Auto-verification**: Auto-verified users have their PRs automatically marked as verified