Skip to content

Revert "[CI] Use repo_name as cross-PR lookup rather than id" #74947

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

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions utils/update_checkout/update_checkout/update_checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ def get_branch_for_repo(config, repo_name, scheme_name, scheme_map,
if scheme_map:
scheme_branch = scheme_map[repo_name]
repo_branch = scheme_branch
if repo_name in cross_repos_pr:
remote_repo_id = config['repos'][repo_name]['remote']['id']
if remote_repo_id in cross_repos_pr:
cross_repo = True
pr_id = cross_repos_pr[repo_name]
pr_id = cross_repos_pr[remote_repo_id]
repo_branch = "ci_pr_{0}".format(pr_id)
shell.run(["git", "checkout", scheme_branch],
echo=True)
Expand Down Expand Up @@ -699,7 +700,10 @@ def main():

cross_repos_pr = {}
if github_comment:
regex_pr = r'(?:apple/|swiftlang/)([-a-zA-Z0-9_]+/pull/\d+|[-a-zA-Z0-9_]+#\d+)'
regex_pr = r'(apple/[-a-zA-Z0-9_]+/pull/\d+'\
r'|apple/[-a-zA-Z0-9_]+#\d+'\
r'|swiftlang/[-a-zA-Z0-9_]+/pull/\d+'\
r'|swiftlang/[-a-zA-Z0-9_]+#\d+)'
repos_with_pr = re.findall(regex_pr, github_comment)
print("Found related pull requests:", str(repos_with_pr))
repos_with_pr = [pr.replace('/pull/', '#') for pr in repos_with_pr]
Expand Down