From 8821b950e0d3105e497ee8b9696d69e5fcdde85a Mon Sep 17 00:00:00 2001 From: Meni Yakove Date: Thu, 24 Apr 2025 12:26:59 +0300 Subject: [PATCH 1/7] Add approvers and reviewers to welcome comment --- webhook_server_container/libs/github_api.py | 120 +++++++++++++------- 1 file changed, 77 insertions(+), 43 deletions(-) diff --git a/webhook_server_container/libs/github_api.py b/webhook_server_container/libs/github_api.py index acd8638c..b66a80b4 100644 --- a/webhook_server_container/libs/github_api.py +++ b/webhook_server_container/libs/github_api.py @@ -150,45 +150,11 @@ def __init__(self, hook_data: dict[Any, Any], headers: Headers, logger: logging. self.clone_repo_dir: str = os.path.join("/tmp", f"{self.repository.name}") self.add_api_users_to_auto_verified_and_merged_users() - self.supported_user_labels_str: str = "".join([f" * {label}\n" for label in USER_LABELS_DICT.keys()]) self.current_pull_request_supported_retest = self._current_pull_request_supported_retest - self.welcome_msg: str = f""" -Report bugs in [Issues](https://github.com/myakove/github-webhook-server/issues) - -The following are automatically added: - * Add reviewers from OWNER file (in the root of the repository) under reviewers section. - * Set PR size label. - * New issue is created for the PR. (Closed when PR is merged/closed) - * Run [pre-commit](https://pre-commit.ci/) if `.pre-commit-config.yaml` exists in the repo. - -Available user actions: - * To mark PR as WIP comment `/wip` to the PR, To remove it from the PR comment `/wip cancel` to the PR. - * To block merging of PR comment `/hold`, To un-block merging of PR comment `/hold cancel`. - * To mark PR as verified comment `/verified` to the PR, to un-verify comment `/verified cancel` to the PR. - verified label removed on each new commit push. - * To cherry pick a merged PR comment `/cherry-pick ` in the PR. - * Multiple target branches can be cherry-picked, separated by spaces. (`/cherry-pick branch1 branch2`) - * Cherry-pick will be started when PR is merged - * To build and push container image command `/build-and-push-container` in the PR (tag will be the PR number). - * You can add extra args to the Podman build command - * Example: `/build-and-push-container --build-arg OPENSHIFT_PYTHON_WRAPPER_COMMIT=` - * To add a label by comment use `/