From 27ff9d1fc71beb94332e431c5ed9e9123e31d73d Mon Sep 17 00:00:00 2001 From: alesapin Date: Thu, 25 Nov 2021 11:19:22 +0300 Subject: [PATCH] Trying to fix pr info for backport (cherry picked from commit 811e0be749bba7239f3c56474910db4026060181) --- tests/ci/pr_info.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ci/pr_info.py b/tests/ci/pr_info.py index 84cbfec9474..3bbff378e9f 100644 --- a/tests/ci/pr_info.py +++ b/tests/ci/pr_info.py @@ -101,7 +101,11 @@ class PRInfo: else: self.changed_files = set([]) else: - diff_url = pull_request['diff_url'] + if 'pr-backport' in self.labels: + diff_url = f"https://github.com/{os.getenv('GITHUB_REPOSITORY')}/compare/master...{self.head_ref}.diff" + else: + diff_url = pull_request['diff_url'] + diff = urllib.request.urlopen(diff_url) diff_object = PatchSet(diff, diff.headers.get_charsets()[0]) self.changed_files = { f.path for f in diff_object }