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

Wrong contributor list/mentions #2245

Closed
stefan6419846 opened this issue Oct 8, 2023 · 6 comments · Fixed by #2246
Closed

Wrong contributor list/mentions #2245

stefan6419846 opened this issue Oct 8, 2023 · 6 comments · Fixed by #2246
Labels

Comments

@stefan6419846
Copy link
Collaborator

The contributor list of tagged releases is wrong when the display name and username do not match.

Let's take https://github.com/py-pdf/pypdf/releases/tag/3.16.3 for example:

I think this is undesired as it attributes the wrong persons and might even notify the wrong users for stuff they did never touch.

When using the GitHub website, an automated/corrected changelog would probably be generated (there is a button for auto-generating it).

@MartinThoma
Copy link
Member

I'm sorry. I fixed it manually. However, we need to make sure its automatically correct.

@MartinThoma
Copy link
Member

The problem is that I'm interpreting that line as the author: https://github.com/py-pdf/pypdf/blob/main/make_release.py#L286

@MartinThoma
Copy link
Member

For you @stefan6419846 it is Stefan <96178532+stefan6419846@users.noreply.github.com> /pull/2241.patch ). I don't know where the Stefan comes from. Can you check the git config --list (probably user.name)?

If you adjust that to stefan6419846 you would automatically get the right result.

It would still be desirable that we connect the right users with their contributions, even if their git config doesn't match with their GitHub username.

@stefan6419846
Copy link
Collaborator Author

I did most of my changes on GitHub directly through their UI, as you can see on the commits of #2241 ("Verified" badges, clicking on them states "This commit was created on GitHub.com and signed with GitHub’s verified signature.") "Stefan" is the full/nice name I have set for display on GitHub itself.

@MartinThoma
Copy link
Member

I guess then there is no way around using the Github API. As I don't know when I have the time to do so, I will likely add a work-around for you before (as you're contributing regularly).

@stefan6419846
Copy link
Collaborator Author

Using the GitHub API for this is rather easy in theory, but especially the rate limits might be something to care about.

The easiest way would be to call https://api.github.com/repos/py-pdf/pypdf/commits/552c8e0 for each commit hash and retrieve the value result["author"]["login"]. Unfortunately, this would only allow 60 commits per release due to the rate limits. Thus, I would probably rather settle with https://api.github.com/repos/py-pdf/pypdf/commits (maybe even with the maximum of 100 results per page instead of the default 30) and match the commit hashes manually. This reduces the number of queries and avoids hitting the rate limit too quickly.

If desired, I might submit a corresponding PR for updating the make_release.py script accordingly.

MartinThoma pushed a commit that referenced this issue Oct 14, 2023
Retrieve the user logins for all commits from the GitHub API to correctly attribute each user, while trying to keep the number of API requests low to not hit the rate limits

Fixes #2245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants