From 0c909b7e782d859b28e59faca958f8037c921852 Mon Sep 17 00:00:00 2001 From: Carly Gundy Date: Mon, 2 Dec 2024 10:31:04 +0100 Subject: [PATCH 1/2] chore(IDX): update cla issue --- reusable_workflows/check_cla/check_cla_pr.py | 6 +++--- reusable_workflows/shared/messages.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/reusable_workflows/check_cla/check_cla_pr.py b/reusable_workflows/check_cla/check_cla_pr.py index efc2752..f2ca6b3 100644 --- a/reusable_workflows/check_cla/check_cla_pr.py +++ b/reusable_workflows/check_cla/check_cla_pr.py @@ -64,12 +64,12 @@ def get_cla_issue(self, user: str) -> Optional[GHIssue]: print(f"No CLA issue for {user}") return None # to make linter happy - def create_cla_issue(self, user: str) -> GHIssue: + def create_cla_issue(self, user: str, pr_url: str) -> GHIssue: user_agreement_message = messages.USER_AGREEMENT_MESSAGE.format(user) issue = self.cla_repo.create_issue( f"cla: @{user}", body=messages.CLA_AGREEMENT_MESSAGE.format( - user, self.cla_link, user_agreement_message + user, self.cla_link, user_agreement_message, pr_url ), ) issue.add_labels(PENDING_LABEL) @@ -109,7 +109,7 @@ def main() -> None: issue = cla.get_cla_issue(user) if not issue: - issue = cla.create_cla_issue(user) + issue = cla.create_cla_issue(user, pr.html_url) cla_signed = cla.check_if_cla_signed(issue, user) if cla_signed: diff --git a/reusable_workflows/shared/messages.py b/reusable_workflows/shared/messages.py index 1c8e028..247ce3f 100644 --- a/reusable_workflows/shared/messages.py +++ b/reusable_workflows/shared/messages.py @@ -16,7 +16,9 @@ If you decide to agree with it, please reply with the following message: > {} -— The DFINITY Foundation""" +— The DFINITY Foundation + +[PR link]({})""" AGREED_MESSAGE = """Dear @{}, From 5ec1fc3d22144fa131a5b1326e42ba1c787c4b45 Mon Sep 17 00:00:00 2001 From: Carly Gundy Date: Mon, 2 Dec 2024 10:46:16 +0100 Subject: [PATCH 2/2] update test --- reusable_workflows/tests/test_cla_pr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reusable_workflows/tests/test_cla_pr.py b/reusable_workflows/tests/test_cla_pr.py index a6a0529..dcf02e6 100644 --- a/reusable_workflows/tests/test_cla_pr.py +++ b/reusable_workflows/tests/test_cla_pr.py @@ -132,10 +132,10 @@ def test_create_cla_issue(): cla.cla_link = "cla_repo_link" user_agreement_message = USER_AGREEMENT_MESSAGE.format("username") cla_agreement_message = CLA_AGREEMENT_MESSAGE.format( - "username", cla.cla_link, user_agreement_message + "username", cla.cla_link, user_agreement_message, "pr_url" ) - new_issue = cla.create_cla_issue("username") + new_issue = cla.create_cla_issue("username", "pr_url") assert new_issue == issue cla_repo.create_issue.assert_called_with(