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

utils/github: Fix double counting of author/committer numbers #14889

Merged

Conversation

issyl0
Copy link
Member

@issyl0 issyl0 commented Mar 5, 2023

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

  • The usage of this in brew contributions wasn't correct for a user with 5 authored commits to homebrew/cask that had been committed by other people, the numbers would turn out as 5 authored, 5 committed when they should be 5 authored, 0 committed.
  • I decided to do this properly by getting the SHAs for author and committer and determine the differences between the two arrays. This also accounts for when authored commits are 0, or committed commits, or both.
  • Add tests, because I don't want to fix this a third time!

Before:

issyl0 at pictor in /opt/homebrew on master
❯ brew contributions --user=issyl0 --csv
issyl0 contributed 1688 times in all time.
user,repo,author,committer,coauthorships,reviews,total
issyl0,brew,402,149,13,144,708
issyl0,core,473,73,24,357,927
issyl0,cask,4,4,0,1,9
issyl0,aliases,0,0,0,0,0
issyl0,autoupdate,1,1,0,0,2
issyl0,bundle,17,4,2,0,23
issyl0,command-not-found,1,1,0,0,2
issyl0,test-bot,3,1,0,0,4
issyl0,services,9,2,0,2,13
issyl0,cask-drivers,0,0,0,0,0
issyl0,cask-fonts,0,0,0,0,0
issyl0,cask-versions,0,0,0,0,0
issyl0,all,910,235,39,504,1688

After:

❯ brew contributions --user=issyl0 --csv  
issyl0 contributed 1660 times in all time.
user,repo,author,committer,coauthorships,reviews,total
issyl0,brew,402,3,13,144,562
issyl0,core,473,204,24,357,1058
issyl0,cask,4,0,0,1,5
issyl0,aliases,0,0,0,0,0
issyl0,autoupdate,1,0,0,0,1
issyl0,bundle,17,0,2,0,19
issyl0,command-not-found,1,0,0,0,1
issyl0,test-bot,3,0,0,0,3
issyl0,services,9,0,0,2,11
issyl0,cask-drivers,0,0,0,0,0
issyl0,cask-fonts,0,0,0,0,0
issyl0,cask-versions,0,0,0,0,0
issyl0,all,910,207,39,504,1660

- The usage of this in `brew contributions` wasn't correct for a user
  with 5 authored commits to homebrew/cask that had been committed by
  other people, the numbers would turn out as 5 authored, 5 committed.
- I decided to do this properly by getting the SHAs for author and
  committer and determine the differences between the two arrays.
  This also accounts for when authored commits are 0, or committed
  commits, or both.
- Add tests, because I don't want to fix this a third time!
@BrewTestBot
Copy link
Member

Review period will end on 2023-03-07 at 00:00:00 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Mar 5, 2023
Copy link
Member

@nandahkrishna nandahkrishna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The math looks good to me this time, thanks @issyl0!

@issyl0 issyl0 added the critical Critical change which should be shipped as soon as possible. label Mar 5, 2023
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Mar 5, 2023
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

@issyl0 issyl0 merged commit b1ef41c into Homebrew:master Mar 5, 2023
@issyl0 issyl0 deleted the contributions-improve-committers-dedup branch March 5, 2023 16:11
@github-actions github-actions bot added the outdated PR was locked due to age label Apr 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants