[PATCH] D125744: github: Add a helpful message for issues without milestones
Tom Stellard via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 15 10:11:56 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
tstellar marked an inline comment as done.
Closed by commit rG51eaaa3092c0: github: Add a helpful message for issues without milestones (authored by tstellar).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125744/new/
https://reviews.llvm.org/D125744
Files:
llvm/utils/git/github-automation.py
Index: llvm/utils/git/github-automation.py
===================================================================
--- llvm/utils/git/github-automation.py
+++ llvm/utils/git/github-automation.py
@@ -134,6 +134,19 @@
def issue_notify_pull_request(self, pull:github.PullRequest.PullRequest) -> None:
self.issue.create_comment('/pull-request {}#{}'.format(self.branch_repo_name, pull.number))
+ def make_ignore_comment(self, comment: str) -> str:
+ """
+ Returns the comment string with a prefix that will cause
+ a Github workflow to skip parsing this comment.
+
+ :param str comment: The comment to ignore
+ """
+ return "<!--IGNORE-->\n"+comment
+
+ def issue_notify_no_milestone(self, comment:List[str]) -> None:
+ message = "{}\n\nError: Command failed due to missing milestone.".format(''.join(['>' + line for line in comment]))
+ self.issue.create_comment(self.make_ignore_comment(message))
+
@property
def action_url(self) -> str:
if os.getenv('CI'):
@@ -141,7 +154,7 @@
return ""
def issue_notify_cherry_pick_failure(self, commit:str) -> github.IssueComment.IssueComment:
- message = "<!--IGNORE-->\nFailed to cherry-pick: {}\n\n".format(commit)
+ message = self.make_ignore_comment("Failed to cherry-pick: {}\n\n".format(commit))
action_url = self.action_url
if action_url:
message += action_url + "\n\n"
@@ -295,6 +308,9 @@
release_workflow = ReleaseWorkflow(args.token, args.repo, args.issue_number,
args.branch_repo, args.branch_repo_token,
args.llvm_project_dir)
+ if not release_workflow.release_branch_for_issue:
+ release_workflow.issue_notify_no_milestone(sys.stdin.readlines())
+ sys.exit(1)
if args.sub_command == 'print-release-branch':
release_workflow.print_release_branch()
else:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125744.445046.patch
Type: text/x-patch
Size: 1976 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220715/f8a19573/attachment.bin>
More information about the llvm-commits
mailing list