Skip to content

Commit

Permalink
Merge pull request #66 from dfinity/update-cla-issue
Browse files Browse the repository at this point in the history
chore(IDX): update cla issue
  • Loading branch information
cgundy authored Dec 2, 2024
2 parents 97eb381 + 79cee09 commit 94ca7ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions reusable_workflows/check_cla/check_cla_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,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)
Expand Down Expand Up @@ -106,7 +106,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:
Expand Down
4 changes: 3 additions & 1 deletion reusable_workflows/shared/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 @{},
Expand Down
4 changes: 2 additions & 2 deletions reusable_workflows/tests/test_cla_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 94ca7ef

Please sign in to comment.