Allow contributor resolution to identify github users from their noreply addresses#345
Open
MoralCode wants to merge 11 commits into
Open
Allow contributor resolution to identify github users from their noreply addresses#345MoralCode wants to merge 11 commits into
MoralCode wants to merge 11 commits into
Conversation
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…are found Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…er side We are assuming we are working with a plain email Signed-off-by: Adrian Edwards <adredwar@redhat.com>
This helps handle the edge case where there are other words besides an email, separated by a space, in the string. Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…ext either side of the @ Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
|
|
||
| @pytest.mark.unit | ||
| def test_simple_valid_emails(self): | ||
| assert sanity_check_email("user@example.com") == "user@example.com" |
|
|
||
| #This is the primary real-world use case per the caller in facade_github. | ||
| result = sanity_check_email("12345+username@users.noreply.github.com") | ||
| assert result == "12345+username@users.noreply.github.com" |
|
|
||
| @pytest.mark.unit | ||
| def test_simple_valid_emails_with_padding(self): | ||
| assert sanity_check_email(" user@example.com ") == "user@example.com" |
|
|
||
| #This is the primary real-world use case per the caller in facade_github. | ||
| result = sanity_check_email(" 12345+username@users.noreply.github.com ") | ||
| assert result == "12345+username@users.noreply.github.com" |
|
|
||
| @pytest.mark.unit | ||
| def test_email_with_plus_addressing(self): | ||
| assert sanity_check_email("user+tag@example.com") == "user+tag@example.com" |
|
|
||
| @pytest.mark.unit | ||
| def test_at_sign_only(self): | ||
| assert sanity_check_email("@") is None |
|
|
||
| @pytest.mark.unit | ||
| def test_at_sign_with_domain_no_local(self): | ||
| assert sanity_check_email("@example.com") is None |
|
|
||
| @pytest.mark.unit | ||
| def test_local_with_at_no_domain(self): | ||
| assert sanity_check_email("user@") is None |
|
|
||
| @pytest.mark.unit | ||
| def test_multiple_at_signs(self): | ||
| assert sanity_check_email("user@@example.com") is None |
| @pytest.mark.unit | ||
| def test_embedded_email_in_text_returns_email(self): | ||
| """This is intended to test cases where the user put their name and email in the same field, either before or after""" | ||
| assert extract_email("Name user@example.com and more") == 'user@example.com' No newline at end of file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR shows what an implementation might look like if we wanted to account for github noreply user emails in the contributor resolution process since this specific email format makes it easier to connect a user to their commits with fewer API calls.
It also includes unit tested helpers for extracting and validating email addresses.
This PR fixes #256
Notes for Reviewers
Not yet tested
Signed commits