Lines Matching +full:- +full:- +full:issue +full:- +full:number

3 # ======- github-automation - LLVM GitHub Automation Routines--*- python -*--==#
7 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
9 # ==-------------------------------------------------------------------------==#
26 This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
28 1. Check that no other contributor has already been assigned to this issue. If you believe that no one is actually working on it despite an assignment, ping the person. After one week without a response, the assignee may be changed.
29 1. In the comments of this issue, request for it to be assigned to you, or just create a [pull request](https://github.com/llvm/llvm-project/pulls) after following the steps below. [Mention](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this issue in the description of the pull request.
30 1. Fix the issue locally.
31 1. [Run the test suite](https://llvm.org/docs/TestingGuide.html#unit-and-regression-tests) locally. Remember that the subdirectories under `test/` create fine-grained testing targets, so you can e.g. use `make check-clang-ast` to only run Clang's AST tests.
33 1. Run [`git clang-format HEAD~1`](https://clang.llvm.org/docs/ClangFormat.html#git-integration) to format your changes.
34 1. Open a [pull request](https://github.com/llvm/llvm-project/pulls) to the [upstream repository](https://github.com/llvm/llvm-project) on GitHub. Detailed instructions can be found [in GitHub's documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). [Mention](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this issue in the description of the pull request.
36 If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.
40 def _get_current_team(team_name, teams) -> Optional[github.Team.Team]:
48 # If the description of an issue/pull request is empty, the Github API
53 # https://github.com/github/markup/issues/1168#issuecomment-494946168
56 str = re.sub("@(?=\w)", "@<!-- -->", str)
57 # '#' followed by digits is considered an issue number
58 str = re.sub("#(?=\d)", "#<!-- -->", str)
64 def team_name(self) -> str:
70 self.issue = self.repo.get_issue(issue_number)
71 self._team_name = "issue-subscribers-{}".format(label_name).lower()
73 def run(self) -> bool:
80 if team.slug == "issue-subscribers-good-first-issue":
82 self.issue.create_comment(comment)
84 body = escape_description(self.issue.body)
88 Author: {self.issue.user.name} ({self.issue.user.login})
95 self.issue.create_comment(comment)
109 def team_name(self) -> str:
116 self._team_name = "pr-subscribers-{}".format(
119 self.COMMENT_TAG = "<!--LLVM PR SUMMARY COMMENT-->\n"
121 def get_summary_comment(self) -> github.IssueComment.IssueComment:
127 def run(self) -> bool:
142 diff_stats += f"- ({file.status}) {file.filename} ("
146 diff_stats += f"-{file.deletions}"
180 ---
205 def _get_current_team(self) -> Optional[github.Team.Team]:
213 COMMENT_TAG = "<!--LLVM NEW CONTRIBUTOR COMMENT-->\n"
219 def run(self) -> bool:
245 COMMENT_TAG = "<!--LLVM BUILDBOT INFORMATION COMMENT-->\n"
252 def should_comment(self) -> bool:
261 # When an issue is reopened, then closed as merged again, we should not
268 def run(self) -> bool:
283 How to do this, and the rest of the post-merge process, is covered in detail [here](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr).
285 If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of [LLVM development](https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy). You can fix your changes and open a new PR to merge them again.
309 https://github.com/llvm/llvm-project/commit/2832d7941f4207f1fcf813b27cf08cecc3086959
311 github_prefix = "https://github.com/llvm/llvm-project/commit/"
318 CHERRY_PICK_FAILED_LABEL = "release:cherry-pick-failed"
321 This class implements the sub-commands for the release-workflow command.
322 The current sub-commands are:
323 * create-branch
324 * create-pull-request
326 The execute_command method will automatically choose the correct sub-command
339 ) -> None:
352 def token(self) -> str:
356 def repo_name(self) -> str:
360 def issue_number(self) -> int:
364 def branch_repo_owner(self) -> str:
368 def branch_repo_name(self) -> str:
372 def branch_repo_token(self) -> str:
376 def llvm_project_dir(self) -> str:
380 def requested_by(self) -> str:
384 def repo(self) -> github.Repository.Repository:
388 def issue(self) -> github.Issue.Issue:
392 def push_url(self) -> str:
398 def branch_name(self) -> str:
399 return "issue{}".format(self.issue_number)
402 def release_branch_for_issue(self) -> Optional[str]:
403 issue = self.issue
404 milestone = issue.milestone
412 def print_release_branch(self) -> None:
415 def issue_notify_branch(self) -> None:
416 self.issue.create_comment(
420 def issue_notify_pull_request(self, pull: github.PullRequest.PullRequest) -> None:
421 self.issue.create_comment(
422 "/pull-request {}#{}".format(self.repo_name, pull.number)
425 def make_ignore_comment(self, comment: str) -> str:
432 return "<!--IGNORE-->\n" + comment
434 def issue_notify_no_milestone(self, comment: List[str]) -> None:
438 self.issue.create_comment(self.make_ignore_comment(message))
441 def action_url(self) -> str:
450 ) -> github.IssueComment.IssueComment:
452 "Failed to cherry-pick: {}\n\n".format(commit)
457 message += "Please manually backport the fix and push it to your github fork. Once this is done, please create a [pull request](https://github.com/llvm/llvm-project/compare)"
458 issue = self.issue
459 comment = issue.create_comment(message)
460 issue.add_to_labels(self.CHERRY_PICK_FAILED_LABEL)
465 ) -> github.IssueComment.IssueComment:
468 return self.issue.create_comment(message)
471 if self.CHERRY_PICK_FAILED_LABEL in [l.name for l in self.issue.labels]:
472 self.issue.remove_from_labels(self.CHERRY_PICK_FAILED_LABEL)
474 def get_main_commit(self, cherry_pick_sha: str) -> github.Commit.Commit:
477 m = re.search("\(cherry picked from commit ([0-9a-f]+)\)", message)
508 def create_branch(self, commits: List[str]) -> bool:
514 a comment is added to the issue saying that the cherry-pick failed.
516 :param list commits: List of commits to cherry-pick.
519 print("cherry-picking", commits)
526 local_repo.git.cherry_pick("-x", c)
542 ) -> bool:
548 ) -> bool:
552 the issue represented by `self.issue_number` For example if the milestone
555 https://docs.github.com/en/get-started/quickstart/github-glossary#base-branch
556 https://docs.github.com/en/get-started/quickstart/github-glossary#compare-branch
570 commit_message = repo.get_commit(commits[-1]).commit.message
584 pull.as_issue().edit(milestone=self.issue.milestone)
587 # issue that was used to request the cherry-pick
588 self.issue.edit(state="closed", state_reason="completed")
608 def execute_command(self) -> bool:
612 /cherry-pick< ><:> commit0 <commit1> <commit2> <...>
616 m = re.search(r"/cherry-pick\s*:? *(.*)", line)
658 "--token", type=str, required=True, help="GitHub authentication token"
661 "--repo",
663 default=os.getenv("GITHUB_REPOSITORY", "llvm/llvm-project"),
664 help="The GitHub repository that we are working with in the form of <owner>/<repo> (e.g. llvm/llvm-project)",
668 issue_subscriber_parser = subparsers.add_parser("issue-subscriber")
669 issue_subscriber_parser.add_argument("--label-name", type=str, required=True)
670 issue_subscriber_parser.add_argument("--issue-number", type=int, required=True)
672 pr_subscriber_parser = subparsers.add_parser("pr-subscriber")
673 pr_subscriber_parser.add_argument("--label-name", type=str, required=True)
674 pr_subscriber_parser.add_argument("--issue-number", type=int, required=True)
676 pr_greeter_parser = subparsers.add_parser("pr-greeter")
677 pr_greeter_parser.add_argument("--issue-number", type=int, required=True)
679 pr_buildbot_information_parser = subparsers.add_parser("pr-buildbot-information")
680 pr_buildbot_information_parser.add_argument("--issue-number", type=int, required=True)
681 pr_buildbot_information_parser.add_argument("--author", type=str, required=True)
683 release_workflow_parser = subparsers.add_parser("release-workflow")
685 "--llvm-project-dir",
688 help="directory containing the llvm-project checkout",
691 "--issue-number", type=int, required=True, help="The issue number to update"
694 "--branch-repo-token",
699 "--branch-repo",
701 default="llvmbot/llvm-project",
702 help="The name of the repo where new branches will be pushed (e.g. llvm/llvm-project)",
707 choices=["print-release-branch", "auto"],
712 "setup-llvmbot-git",
716 "--requested-by",
723 "request-release-note",
727 "--pr-number",
736 if args.command == "issue-subscriber":
741 elif args.command == "pr-subscriber":
746 elif args.command == "pr-greeter":
749 elif args.command == "pr-buildbot-information":
754 elif args.command == "release-workflow":
767 if args.sub_command == "print-release-branch":
772 elif args.command == "setup-llvmbot-git":
774 elif args.command == "request-release-note":