From 9f6429c0ad08c275b670d7adca5b0779df30f084 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Fri, 10 May 2024 13:35:00 -0700 Subject: [PATCH 1/5] ci: Add originating comment to TryMergeExplainer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also changes the Advanced Debugging message to be buttons utilizing the following format:

 [Title][Link] 

See https://github.com/MarkedDown/Buttons/blob/main/Types/KBD.md for more information Signed-off-by: Eli Uriegas [ghstack-poisoned] --- .github/scripts/trymerge.py | 1 + .github/scripts/trymerge_explainer.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/scripts/trymerge.py b/.github/scripts/trymerge.py index 95311d2d9b83..4abf32aabf0f 100755 --- a/.github/scripts/trymerge.py +++ b/.github/scripts/trymerge.py @@ -2114,6 +2114,7 @@ def merge( pr.org, pr.project, ignore_current, + comment_id, ) # probably a bad name, but this is a list of current checks that should be diff --git a/.github/scripts/trymerge_explainer.py b/.github/scripts/trymerge_explainer.py index 22797909714a..bffa7ab3f9d0 100644 --- a/.github/scripts/trymerge_explainer.py +++ b/.github/scripts/trymerge_explainer.py @@ -24,6 +24,7 @@ class TryMergeExplainer: org: str project: str ignore_current: bool + commend_id: str has_trunk_label: bool has_ciflow_label: bool @@ -36,6 +37,7 @@ def __init__( org: str, project: str, ignore_current: bool, + comment_id: str, ): self.force = force self.labels = labels @@ -43,6 +45,7 @@ def __init__( self.org = org self.project = project self.ignore_current = ignore_current + self.comment_id = comment_id def _get_flag_msg( self, @@ -73,12 +76,18 @@ def get_merge_message( ) -> str: title = "### Merge started" main_message = self._get_flag_msg(ignore_current_checks) + gh_run_url = os.getenv("GH_RUN_URL") + gh_comment_url = f"https://github.com/{self.org}/{self.project}/pull/{self.pr_num}#issuecomment-{self.comment_id}" advanced_debugging = "\n".join( ( "
Advanced Debugging", - "Check the merge workflow status ", - f"here", + "
", + f"
 [Merge workflow status][{gh_run_url}] 
", + "
", + "
", + f"
 [Merge trigger][{gh_comment_url}] 
", + "
", "
", ) ) From 711947112ebc822048815d73d2307e68c0434746 Mon Sep 17 00:00:00 2001 From: Eli Uriegas <1700823+seemethere@users.noreply.github.com> Date: Fri, 10 May 2024 14:03:23 -0700 Subject: [PATCH 2/5] fix typo Co-authored-by: clee2000 <44682903+clee2000@users.noreply.github.com> --- .github/scripts/trymerge_explainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/trymerge_explainer.py b/.github/scripts/trymerge_explainer.py index bffa7ab3f9d0..bad0e3b534d0 100644 --- a/.github/scripts/trymerge_explainer.py +++ b/.github/scripts/trymerge_explainer.py @@ -24,7 +24,7 @@ class TryMergeExplainer: org: str project: str ignore_current: bool - commend_id: str + comment_id: str has_trunk_label: bool has_ciflow_label: bool From 0a0f96662373ceac960d88cfd27f23dd4cb84fea Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Fri, 10 May 2024 14:19:50 -0700 Subject: [PATCH 3/5] Update on "ci: Add originating comment to TryMergeExplainer" Signed-off-by: Eli Uriegas [ghstack-poisoned] --- .github/scripts/trymerge_explainer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/scripts/trymerge_explainer.py b/.github/scripts/trymerge_explainer.py index bad0e3b534d0..f5511d28c867 100644 --- a/.github/scripts/trymerge_explainer.py +++ b/.github/scripts/trymerge_explainer.py @@ -24,7 +24,7 @@ class TryMergeExplainer: org: str project: str ignore_current: bool - comment_id: str + commend_id: str has_trunk_label: bool has_ciflow_label: bool @@ -83,10 +83,8 @@ def get_merge_message( ( "
Advanced Debugging", "
", - f"
 [Merge workflow status][{gh_run_url}] 
", - "
", - "
", - f"
 [Merge trigger][{gh_comment_url}] 
", + f" * [Merge workflow status][{gh_run_url}]", + f" * [Merge trigger][{gh_comment_url}]", "
", "
", ) From bc3e34b5473eef99270ff2043ac795e28973d8b0 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Fri, 10 May 2024 14:20:44 -0700 Subject: [PATCH 4/5] Update on "ci: Add originating comment to TryMergeExplainer" Signed-off-by: Eli Uriegas [ghstack-poisoned] --- .github/scripts/trymerge_explainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/trymerge_explainer.py b/.github/scripts/trymerge_explainer.py index f5511d28c867..1a67a123f781 100644 --- a/.github/scripts/trymerge_explainer.py +++ b/.github/scripts/trymerge_explainer.py @@ -24,7 +24,7 @@ class TryMergeExplainer: org: str project: str ignore_current: bool - commend_id: str + comment_id: str has_trunk_label: bool has_ciflow_label: bool From 72d90f844dbf512242fcd41f28ae26c729c62f41 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Tue, 14 May 2024 14:53:37 -0500 Subject: [PATCH 5/5] Update on "ci: Add originating comment to TryMergeExplainer" Signed-off-by: Eli Uriegas [ghstack-poisoned] --- .github/scripts/trymerge_explainer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/trymerge_explainer.py b/.github/scripts/trymerge_explainer.py index 1a67a123f781..93430860ee81 100644 --- a/.github/scripts/trymerge_explainer.py +++ b/.github/scripts/trymerge_explainer.py @@ -24,7 +24,7 @@ class TryMergeExplainer: org: str project: str ignore_current: bool - comment_id: str + comment_id: int has_trunk_label: bool has_ciflow_label: bool @@ -37,7 +37,7 @@ def __init__( org: str, project: str, ignore_current: bool, - comment_id: str, + comment_id: int, ): self.force = force self.labels = labels