• Home
  • Raw
  • Download

Lines Matching +full:get +full:- +full:conclusion

3 # NB: the following functions are used in Meta-internal workflows
134 conclusion
145 conclusion
328 conclusion
377 # This query needs read-org permission
442 RE_GHSTACK_HEAD_REF = re.compile(r"^(gh/[^/]+/[0-9]+/)head$")
446 r"https://github.com/(?P<owner>[^/]+)/(?P<repo>[^/]+)/pull/(?P<number>[0-9]+)",
450 RE_DIFF_REV = re.compile(r"^Differential Revision:.+?(D[0-9]+)", re.MULTILINE)
458 INTERNAL_CHANGES_CHECKRUN_NAME = "Meta Internal-Only Changes Check"
462 # This could be set to -1 to ignore all flaky and broken trunk failures. On the
467 def gh_get_pr_info(org: str, proj: str, pr_no: int) -> Any:
473 def gh_get_team_members(org: str, name: str) -> List[str]:
487 warn(f"Requested non-existing team {org}/{name}")
494 def get_check_run_name_prefix(workflow_run: Any) -> str:
501 def is_passing_status(status: Optional[str]) -> bool:
509 ) -> JobNameToStateDict:
513 # workflow -> job -> job info
519 def add_conclusions(edges: Any) -> None:
534 workflow_conclusion = node["conclusion"]
559 existing_checkrun = workflow_obj.jobs.get(checkrun_name)
566 checkrun_node["conclusion"],
608 def parse_args() -> Any:
612 parser.add_argument("--dry-run", action="store_true")
613 parser.add_argument("--revert", action="store_true")
614 parser.add_argument("--force", action="store_true")
615 parser.add_argument("--ignore-current", action="store_true")
616 parser.add_argument("--check-mergeability", action="store_true")
617 parser.add_argument("--comment-id", type=int)
618 parser.add_argument("--reason", type=str)
623 def can_skip_internal_checks(pr: "GitHubPR", comment_id: Optional[int] = None) -> bool:
629 return comment.author_login == "facebook-github-bot"
637 ) -> List[Tuple["GitHubPR", str]]:
644 f"Could not find PR-resolved string in {msg} of ghstacked PR {pr.pr_num}"
660 ) -> List[Tuple["GitHubPR", str]]:
662Get the PRs in the stack that are below this PR (inclusive). Throws error if any of the open PRs …
665 # For ghstack, cherry-pick commits based from origin
669 def skip_func(idx: int, candidate: "GitHubPR") -> bool:
699 def __init__(self, org: str, project: str, pr_num: int) -> None:
714 def is_closed(self) -> bool:
717 def is_cross_repo(self) -> bool:
720 def base_ref(self) -> str:
723 def default_branch(self) -> str:
726 def head_ref(self) -> str:
729 def is_ghstack_pr(self) -> bool:
732 def get_ghstack_orig_ref(self) -> str:
736 def is_base_repo_private(self) -> bool:
739 def get_changed_files_count(self) -> int:
742 def last_commit(self) -> Any:
743 return self.info["commits"]["nodes"][-1]["commit"]
745 def get_merge_base(self) -> str:
767 def get_changed_files(self) -> List[str]:
790 def get_submodules(self) -> List[str]:
797 def get_changed_submodules(self) -> List[str]:
801 def has_invalid_submodule_updates(self) -> bool:
813 def _get_reviews(self) -> List[Tuple[str, str]]:
838 def get_approved_by(self) -> List[str]:
841 def get_commit_count(self) -> int:
844 def get_pr_creator_login(self) -> str:
847 def _fetch_authors(self) -> List[Tuple[str, str]]:
852 def add_authors(info: Dict[str, Any]) -> None:
879 def get_committer_login(self, num: int = 0) -> str:
882 def get_committer_author(self, num: int = 0) -> str:
885 def get_labels(self) -> List[str]:
896 def get_checkrun_conclusions(self) -> JobNameToStateDict:
897 """Returns dict of checkrun -> [conclusion, url]"""
904 ) -> Any:
910 cs_cursor=edges[edge_idx - 1]["cursor"] if edge_idx > 0 else None,
914 -1
916 checkruns = last_commit["checkSuites"]["nodes"][-1]["checkRuns"]
919 def get_pr_next_checksuites(checksuites: Any) -> Any:
925 cursor=checksuites["edges"][-1]["cursor"],
928 last_commit = info["commits"]["nodes"][-1]["commit"]
955 def get_authors(self) -> Dict[str, str]:
962 def get_author(self) -> str:
973 def get_title(self) -> str:
976 def get_body(self) -> str:
979 def get_merge_commit(self) -> Optional[str]:
983 def get_pr_url(self) -> str:
987 def _comment_from_node(node: Any) -> GitHubComment:
999 def get_comments(self) -> List[GitHubComment]:
1021 def get_last_comment(self) -> GitHubComment:
1022 return self._comment_from_node(self.info["comments"]["nodes"][-1])
1024 def get_comment_by_id(self, database_id: int) -> GitHubComment:
1026 # Fastpath - try searching in partial prefetched comments
1047 def get_diff_revision(self) -> Optional[str]:
1051 def has_internal_changes(self) -> bool:
1060 def has_no_connected_diff(self) -> bool:
1073 ) -> List["GitHubPR"]:
1104 ) -> str:
1124 # Mention PR co-authors, which should be at the end of the message
1131 msg += f"\nCo-authored-by: {author_name}"
1135 def add_numbered_label(self, label_base: str, dry_run: bool) -> None:
1153 ) -> None:
1192 ignore_current_checks=ignorable_checks.get("IGNORE_CURRENT_CHECK", []),
1193 broken_trunk_checks=ignorable_checks.get("BROKEN_TRUNK", []),
1194 flaky_checks=ignorable_checks.get("FLAKY", []),
1195 unstable_checks=ignorable_checks.get("UNSTABLE", []),
1196 last_commit_sha=self.last_commit().get("oid", ""),
1213 ) -> List["GitHubPR"]:
1215 … :param skip_all_rule_checks: If true, skips all rule checks, useful for dry-running merge locally
1222 pr_branch_name = f"__pull-request-{self.pr_num}__init__"
1224 repo._run_git("merge", "--squash", pr_branch_name)
1225 repo._run_git("commit", f'--author="{self.get_author()}"', "-m", msg)
1237 def __init__(self, message: str, rule: Optional["MergeRule"] = None) -> None:
1260 org: str, project: str, labels: List[str], template: str = "bug-report.yml"
1261 ) -> str:
1272 ) -> List[MergeRule]:
1275 NB: this function is used in Meta-internal workflows, see the comment
1303 ) -> Tuple[
1313 NB: this function is used in Meta-internal workflows, see the comment at the top of
1350 # Score 0 to 10K - how many files rule matched
1351 # Score 10K - matched all files, but no overlapping approvers
1352 # Score 20K - matched all files and approvers, but mandatory checks are pending
1353 # Score 30k - Matched all files and approvers, but mandatory checks failed
1365 num_matching_files = len(changed_files) - len(non_matching_files)
1371 … f"{num_matching_files} files matched, but there are still non-matching files:",
1403 … f"- {name} ({', '.join(approved_by[:5])}{', ...' if len(approved_by) > 5 else ''})"
1494 def checks_to_str(checks: List[Tuple[str, Optional[str]]]) -> str:
1500 ) -> List[str]:
1502 f"- [{c[0]}]({c[1]})" if c[1] is not None else f"- {c[0]}" for c in checks[:5]
1526 ) -> None:
1554 "_id": f"{project}-{pr_num}-{comment_id}-{os.environ.get('GITHUB_RUN_ID')}",
1564 def get_rockset_results(head_sha: str, merge_base: str) -> List[Dict[str, Any]]:
1570 j.conclusion,
1594 def get_drci_classifications(pr_num: int, project: str = "pytorch") -> Any:
1611 return failures.get(str(pr_num), {}) if failures else {}
1614 REMOVE_JOB_NAME_SUFFIX_REGEX = re.compile(r", [0-9]+, [0-9]+, .+\)$")
1617 def remove_job_name_suffix(name: str, replacement: str = ")") -> str:
1624 ) -> bool:
1634 for broken_trunk in drci_classifications.get("BROKEN_TRUNK", [])
1641 ) -> bool:
1656 for unstable in drci_classifications.get("UNSTABLE", [])
1663 ) -> bool:
1673 for flaky in drci_classifications.get("FLAKY", [])
1679 conclusion: Optional[str],
1681 ) -> bool:
1683 After https://github.com/pytorch/test-infra/pull/4579, invalid cancelled
1690 or not conclusion
1691 or conclusion.upper() != "CANCELLED"
1698 name != failure["name"] for failure in drci_classifications.get("FAILED", [])
1707 ) -> Dict[str, JobCheckState]:
1708 # Get the failure classification from Dr.CI, which is the source of truth
1710 # to get the latest results as well as update Dr.CI PR comment
1713 def get_readable_drci_results(drci_classifications: Any) -> str:
1816 ) -> List[JobCheckState]:
1820 def get_pr_commit_sha(repo: GitRepo, pr: GitHubPR) -> str:
1832 ) -> Tuple[str, str]:
1862 ) -> List[Tuple[str, GitHubPR]]:
1864 Get the PRs in the stack that are above this PR (inclusive).
1874 skip_len = len(rev_list) - 1
1880 # Validate that candidate always ends rev-list
1881 if rev_list[-len(candidate) :] != candidate:
1887 rev_list = rev_list[:-skip_len]
1907 ) -> None:
1932 revert_message += "\ncc: @pytorch/pytorch-dev-infra"
1950 ) -> None:
1984 def prefix_with_github_url(suffix_str: str) -> str:
1988 def check_for_sev(org: str, project: str, skip_mandatory_checks: bool) -> None:
2009 def has_label(labels: List[str], pattern: Pattern[str] = CIFLOW_LABEL) -> bool:
2017 ) -> Tuple[
2102 ) -> None:
2120 # ignored and is toggled by the --ignore-current flag
2175 elapsed_time = current_time - start_time
2255 gh_add_labels(pr.org, pr.project, pr.pr_num, ["land-failed"], dry_run)
2259 def main() -> None:
2265 def handle_exception(e: Exception, title: str = "Merge failed") -> None:
2329 "Cross-repo ghstack merges are not supported",
2388 last_commit_sha=pr.last_commit().get("oid", ""),