Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add originating comment to TryMergeExplainer #125959

Open
wants to merge 5 commits into
base: gh/seemethere/1/base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/scripts/trymerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,7 @@
pr.org,
pr.project,
ignore_current,
comment_id,

Check failure on line 2117 in .github/scripts/trymerge.py

View workflow job for this annotation

GitHub Actions / lintrunner-noclang / linux-job

MYPYSTRICT [arg-type]

Argument 7 to "TryMergeExplainer" has incompatible type "Optional[int]"; expected "int"
)

# probably a bad name, but this is a list of current checks that should be
Expand Down
11 changes: 9 additions & 2 deletions .github/scripts/trymerge_explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class TryMergeExplainer:
org: str
project: str
ignore_current: bool
comment_id: int

has_trunk_label: bool
has_ciflow_label: bool
Expand All @@ -36,13 +37,15 @@ def __init__(
org: str,
project: str,
ignore_current: bool,
comment_id: int,
):
self.force = force
self.labels = labels
self.pr_num = pr_num
self.org = org
self.project = project
self.ignore_current = ignore_current
self.comment_id = comment_id

def _get_flag_msg(
self,
Expand Down Expand Up @@ -73,12 +76,16 @@ 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(
(
"<details><summary>Advanced Debugging</summary>",
"Check the merge workflow status ",
f"<a href=\"{os.getenv('GH_RUN_URL')}\">here</a>",
"<br>",
f" * [Merge workflow status][{gh_run_url}]",
f" * [Merge trigger][{gh_comment_url}]",
"<br>",
"</details>",
)
)
Expand Down