From 5de5fb4a25f38765c98fed03a59fbf272caf8f07 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 29 Sep 2024 00:57:45 -0700 Subject: [PATCH] Rewrite unknown emails to account for emails on commits Closes #163. See also: - https://github.com/plone/documentation/pull/1722 - https://github.com/plone/documentation/issues/1716 --- src/mr.roboto/src/mr/roboto/subscriber.py | 25 +++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/mr.roboto/src/mr/roboto/subscriber.py b/src/mr.roboto/src/mr/roboto/subscriber.py index 99c8661..d823faa 100644 --- a/src/mr.roboto/src/mr/roboto/subscriber.py +++ b/src/mr.roboto/src/mr/roboto/subscriber.py @@ -218,6 +218,7 @@ def __init__(self, event): self.cla_url = "https://plone.org/foundation/contributors-agreement" # noqa self.cla_email = "agreements@plone.org" self.github_help_setup_email_url = "https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/adding-an-email-address-to-your-github-account" # noqa + self.github_help_commit_email = "https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address" self.status_context = "Plone Contributors Agreement verifier" super().__init__(event) @@ -269,18 +270,26 @@ def run(self): users = ", ".join(set(unknown)) self.log(f"{users} missing contributors agreement") msg = ( - f"{users} your emails are not known to GitHub and thus it " - f"is impossible to know if you have signed the Plone " - f"Contributor Agreement, which is required to merge this " - f"pull request.\n\n" + f"{users} the email address in your commit does not match an " + "email in your GitHub account. Thus it is impossible to " + "determine whether you have signed the Plone Contributor " + "Agreement, which is required to merge this pull request." + "\n\n" f"Learn about the Plone Contributor Agreement: {self.cla_url} " - f"How to add more emails to your GitHub account: " - f"{self.github_help_setup_email_url} " "\n\n" "If you have sent in your Plone Contributor Agreement, " "and received and accepted an invitation to join the " - "Plone GitHub organization, then you might need to add " - "the email address on your Agreement to your GitHub account." + "Plone GitHub organization, then you might need to either add " + "the email address on your Agreement to your GitHub account " + "or change the email address in your commits. If you need to " + "do the latter, then you should squash the commits with your " + "matching email and push them." + "\n\n" + "Add more emails to your GitHub account:\n" + f"{self.github_help_setup_email_url}" + "\n\n" + "Change the email address in your commits:\n" + f"{self.github_help_commit_email}" ) self.g_issue.create_comment(body=msg)