From 025357edd98ee83ff84781ca7620191cf33d0b2e Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Mon, 1 Jul 2024 15:04:12 -0700 Subject: [PATCH 1/3] Update update_checkout.py to support swiftlang and apple org repos --- utils/update_checkout/update_checkout/update_checkout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/update_checkout/update_checkout/update_checkout.py b/utils/update_checkout/update_checkout/update_checkout.py index 8ea523a64dde7..1f078b9c005a7 100755 --- a/utils/update_checkout/update_checkout/update_checkout.py +++ b/utils/update_checkout/update_checkout/update_checkout.py @@ -700,7 +700,7 @@ 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+|apple/[-a-zA-Z0-9_]+#\d+|swiftlang/[-a-zA-Z0-9_]+/pull/\d+|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] From f57030277d9e502d8fc31c8f88fdcd6167016e77 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Mon, 1 Jul 2024 15:24:46 -0700 Subject: [PATCH 2/3] Split the regex into multiple line to clean up lint error --- utils/update_checkout/update_checkout/update_checkout.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/update_checkout/update_checkout/update_checkout.py b/utils/update_checkout/update_checkout/update_checkout.py index 1f078b9c005a7..6dbb5ce6c4b28 100755 --- a/utils/update_checkout/update_checkout/update_checkout.py +++ b/utils/update_checkout/update_checkout/update_checkout.py @@ -700,7 +700,10 @@ def main(): cross_repos_pr = {} if github_comment: - regex_pr = r'(apple/[-a-zA-Z0-9_]+/pull/\d+|apple/[-a-zA-Z0-9_]+#\d+|swiftlang/[-a-zA-Z0-9_]+/pull/\d+|swiftlang/[-a-zA-Z0-9_]+#\d+)' + regex_pr = r'(apple/[-a-zA-Z0-9_]+/pull/\d+'\ + '|apple/[-a-zA-Z0-9_]+#\d+'\ + '|swiftlang/[-a-zA-Z0-9_]+/pull/\d+'\ + '|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] From 40ecb090c3828ed8e5db50816e2afca8f2a54f67 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Mon, 1 Jul 2024 17:04:47 -0700 Subject: [PATCH 3/3] Fix the lint issue --- utils/update_checkout/update_checkout/update_checkout.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/update_checkout/update_checkout/update_checkout.py b/utils/update_checkout/update_checkout/update_checkout.py index 6dbb5ce6c4b28..17dc04abdcaff 100755 --- a/utils/update_checkout/update_checkout/update_checkout.py +++ b/utils/update_checkout/update_checkout/update_checkout.py @@ -701,9 +701,9 @@ def main(): cross_repos_pr = {} if github_comment: regex_pr = r'(apple/[-a-zA-Z0-9_]+/pull/\d+'\ - '|apple/[-a-zA-Z0-9_]+#\d+'\ - '|swiftlang/[-a-zA-Z0-9_]+/pull/\d+'\ - '|swiftlang/[-a-zA-Z0-9_]+#\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]