From 54ca100e4196eaa318fd57cb629edb4365d28aff Mon Sep 17 00:00:00 2001 From: Oleg Iarygin Date: Fri, 10 Feb 2023 12:30:21 +0400 Subject: [PATCH 1/3] Make Bedevere showing label names like GitHub does --- master/custom/pr_testing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/master/custom/pr_testing.py b/master/custom/pr_testing.py index 34927c2b7..c2a55f944 100644 --- a/master/custom/pr_testing.py +++ b/master/custom/pr_testing.py @@ -37,6 +37,11 @@ def should_pr_be_tested(change): return change.properties.getProperty("should_test_pr", False) +def emote(markup_text): + """Manually replace some GitHub emoji markup with Unicode .emojis""" + return markup_text.replace(':hammer:', '🔨') + + class CustomGitHubEventHandler(GitHubEventHandler): def __init__(self, *args, builder_names, **kwargs): super().__init__(*args, **kwargs) @@ -83,7 +88,7 @@ def _remove_label_and_comment(self, payload, label): url.replace(self.github_api_endpoint, ""), json={ "body": BUILD_SCHEDULED_MESSAGE.format( - user=username, commit=commit, label=label + user=username, commit=commit, label=emote(label) ) }, ) From 5737fff72101be16ef14e811142db7302916d9f4 Mon Sep 17 00:00:00 2001 From: Oleg Iarygin Date: Fri, 10 Feb 2023 12:50:56 +0400 Subject: [PATCH 2/3] Fix a misspell --- master/custom/pr_testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master/custom/pr_testing.py b/master/custom/pr_testing.py index c2a55f944..f5cc62e3d 100644 --- a/master/custom/pr_testing.py +++ b/master/custom/pr_testing.py @@ -38,7 +38,7 @@ def should_pr_be_tested(change): def emote(markup_text): - """Manually replace some GitHub emoji markup with Unicode .emojis""" + """Manually replace some GitHub emoji markup with Unicode emojis.""" return markup_text.replace(':hammer:', '🔨') From 3d364aafa3f023c5c6b3a7c6bb15eb64eac50410 Mon Sep 17 00:00:00 2001 From: Oleg Iarygin Date: Thu, 16 Feb 2023 12:04:43 +0400 Subject: [PATCH 3/3] Replace backticks with `` --- master/custom/pr_testing.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/master/custom/pr_testing.py b/master/custom/pr_testing.py index f5cc62e3d..ddb9b3b12 100644 --- a/master/custom/pr_testing.py +++ b/master/custom/pr_testing.py @@ -18,7 +18,7 @@ BUILD_SCHEDULED_MESSAGE = f"""\ :robot: New build scheduled with the buildbot fleet by @{{user}} for commit {{commit}} :robot: -If you want to schedule another build, you need to add the `{{label}}` label again. +If you want to schedule another build, you need to add the {{label}} label again. """ BUILD_COMMAND_SCHEDULED_MESSAGE = f"""\ @@ -37,11 +37,6 @@ def should_pr_be_tested(change): return change.properties.getProperty("should_test_pr", False) -def emote(markup_text): - """Manually replace some GitHub emoji markup with Unicode emojis.""" - return markup_text.replace(':hammer:', '🔨') - - class CustomGitHubEventHandler(GitHubEventHandler): def __init__(self, *args, builder_names, **kwargs): super().__init__(*args, **kwargs) @@ -88,7 +83,7 @@ def _remove_label_and_comment(self, payload, label): url.replace(self.github_api_endpoint, ""), json={ "body": BUILD_SCHEDULED_MESSAGE.format( - user=username, commit=commit, label=emote(label) + user=username, commit=commit, label=label ) }, )