Skip to content

Commit 268a785

Browse files
authored
Merge pull request swiftlang#74947 from swiftlang/revert-74884-change-cross-pr-handling
Revert "[CI] Use repo_name as cross-PR lookup rather than id"
2 parents 37e5b22 + 8fba108 commit 268a785

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

utils/update_checkout/update_checkout/update_checkout.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ def get_branch_for_repo(config, repo_name, scheme_name, scheme_map,
131131
if scheme_map:
132132
scheme_branch = scheme_map[repo_name]
133133
repo_branch = scheme_branch
134-
if repo_name in cross_repos_pr:
134+
remote_repo_id = config['repos'][repo_name]['remote']['id']
135+
if remote_repo_id in cross_repos_pr:
135136
cross_repo = True
136-
pr_id = cross_repos_pr[repo_name]
137+
pr_id = cross_repos_pr[remote_repo_id]
137138
repo_branch = "ci_pr_{0}".format(pr_id)
138139
shell.run(["git", "checkout", scheme_branch],
139140
echo=True)
@@ -699,7 +700,10 @@ def main():
699700

700701
cross_repos_pr = {}
701702
if github_comment:
702-
regex_pr = r'(?:apple/|swiftlang/)([-a-zA-Z0-9_]+/pull/\d+|[-a-zA-Z0-9_]+#\d+)'
703+
regex_pr = r'(apple/[-a-zA-Z0-9_]+/pull/\d+'\
704+
r'|apple/[-a-zA-Z0-9_]+#\d+'\
705+
r'|swiftlang/[-a-zA-Z0-9_]+/pull/\d+'\
706+
r'|swiftlang/[-a-zA-Z0-9_]+#\d+)'
703707
repos_with_pr = re.findall(regex_pr, github_comment)
704708
print("Found related pull requests:", str(repos_with_pr))
705709
repos_with_pr = [pr.replace('/pull/', '#') for pr in repos_with_pr]

0 commit comments

Comments
 (0)