Skip to content

Allow contributor resolution to identify github users from their noreply addresses#345

Open
MoralCode wants to merge 11 commits into
mainfrom
feat/resolution_shortcut_ghnoreply
Open

Allow contributor resolution to identify github users from their noreply addresses#345
MoralCode wants to merge 11 commits into
mainfrom
feat/resolution_shortcut_ghnoreply

Conversation

@MoralCode

Copy link
Copy Markdown
Contributor

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

  • Yes, I signed my commits.

MoralCode added 11 commits May 26, 2026 14:00
Signed-off-by: Adrian Edwards <[email protected]>
Signed-off-by: Adrian Edwards <[email protected]>
…er side

We are assuming we are working with a plain email

Signed-off-by: Adrian Edwards <[email protected]>
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 <[email protected]>
…ext either side of the @

Signed-off-by: Adrian Edwards <[email protected]>
Signed-off-by: Adrian Edwards <[email protected]>
@MoralCode MoralCode added the waiting This change is waiting for some other changes to land first label May 26, 2026

@pytest.mark.unit
def test_simple_valid_emails(self):
assert sanity_check_email("[email protected]") == "[email protected]"

#This is the primary real-world use case per the caller in facade_github.
result = sanity_check_email("[email protected]")
assert result == "[email protected]"

@pytest.mark.unit
def test_simple_valid_emails_with_padding(self):
assert sanity_check_email(" [email protected] ") == "[email protected]"

#This is the primary real-world use case per the caller in facade_github.
result = sanity_check_email(" [email protected] ")
assert result == "[email protected]"

@pytest.mark.unit
def test_email_with_plus_addressing(self):
assert sanity_check_email("[email protected]") == "[email protected]"

@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 [email protected] and more") == '[email protected]' No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting This change is waiting for some other changes to land first

Projects

Status: Paused/Background

Development

Successfully merging this pull request may close these issues.

facade: we can resolve contributors with github noreply addresses in 1 api call

2 participants