Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[changelog] Contributor username lookup #1112

Closed
2 of 4 tasks
manikmagar opened this issue Dec 15, 2022 · 3 comments · Fixed by #1113
Closed
2 of 4 tasks

[changelog] Contributor username lookup #1112

manikmagar opened this issue Dec 15, 2022 · 3 comments · Fixed by #1113
Assignees
Labels
bug Something isn't working good first issue Good for newcomers released Issue has been released
Milestone

Comments

@manikmagar
Copy link
Contributor

Discussed in #1111

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem (link to git repository is ideal)
  • Full description of the issue provided (see below)

Steps to Reproduce

Find a user who -

  1. Doesn't have a public email On Github profile
  2. Display name (eg. Manik Magar) has more than one profile on Github.

If that user has a commit on the repo, observe his entry in the change log.

Expected Behaviour

When generating the changelog, the contributor's correct username is added.

Actual Behaviour

Looks like it is searching by Author's name - 'Kevin King' (see web query here) and just picked up the first user found
https://github.com/jreleaser/jreleaser/blob/main/sdks/jreleaser-github-java-sdk/src/main/java/org/jreleaser/sdk/github/XGithub.java#L103-L111 -

But that's not the Kevin who committed the change :). This user also has a private github email id - ID+USERNAME@users.noreply.github.com. The API documentation states that users having "Public email" listed on their profile can only be searched using email and since there is no public email listed here, search by email id is not useful. Searching by names as seen below can result in unexpected results.

From the discussion -

Lookup should -

  1. check email, if private then extract username. done.
  2. search by email. If found use name.
  3. use name as extracted from commit message (this would need to be recorded as well. I think only the email is recorded at the moment.
@manikmagar manikmagar added the bug Something isn't working label Dec 15, 2022
@aalmiray aalmiray added the good first issue Good for newcomers label Dec 15, 2022
@aalmiray
Copy link
Member

The ChangelogGenerator.User class assumes the resolved user has an URL. But this may not be the case when the returned username is from a private email nor when the plain name is returned.

The code must check if username, name, and url are properly set before using their values. Return empty strings when that's not the case.

@manikmagar
Copy link
Contributor Author

Thanks for additional information. I'll take a first pass to add this.

@aalmiray
Copy link
Member

@aalmiray aalmiray added the released Issue has been released label Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers released Issue has been released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants