brew icon indicating copy to clipboard operation
brew copied to clipboard

Enhance `brew contributions`.

Open issyl0 opened this issue 1 year ago • 5 comments

Provide a detailed description of the proposed feature

In the review comments of https://github.com/Homebrew/brew/pull/13603, multiple things were suggested as future enhancements to this command. In no particular order:

  • Count both commit authors and commit committers.
  • Figure out a way to use the GitHub APIs rather than git log. There currently doesn't seem to be any support for Co-authored-by authorships in the API though.
  • Count "PRs reviewed ✅ or 🟥 by" (which implies write access).

What is the motivation for the feature?

Deal with the leftover feature requests that were too big for the initial MVP.

The third one in the list:

Count "PRs reviewed ✅ or 🟥 by" (which implies write access).

is the most important in my view. Currently, brew contributions only tracks code (co-)authored by a person. That fails to surface a large amount of what Homebrew maintainers do: community contributions, user support, PR reviews (I'm thinking particularly in Homebrew/homebrew-core). Without people reviewing PRs, we couldn't run this project.

How will the feature be relevant to at least 90% of Homebrew users?

It won't, but this is a development command useful for project leadership to gather stats on project momentum and maintainer engagement.

What alternatives to the feature have been considered?

Not implementing the features. It works adequately now, at a basic level, if all we care about is raw commits.

issyl0 avatar Aug 03 '22 18:08 issyl0

If nobody's taken a look at this I'd be interested in it! Think I have a thread to pull on grabbing the data requested via the graphql api, which should also be able to give us pr activity.

troymccabe avatar Sep 22 '22 02:09 troymccabe

Would something like the following be beneficial?

+------------------------------------------------------------------------------+
| Contributions for <user_or_email>                                            |
+------------------------+-----------------+-----------------+-----------------+
| Repository             | Commits         | Co-authorships  | Signoffs        |
+------------------------+-----------------+-----------------+-----------------+
| brew                   | 31              | 0               | 0               |
| core                   | 256             | 0               | 0               |
| cask                   | 2252            | 503             | 2035            |
| aliases                | 0               | 0               | 0               |
| autoupdate             | 0               | 0               | 0               |
| bundle                 | 0               | 0               | 0               |
| command-not-found      | 0               | 0               | 0               |
| test-bot               | 0               | 0               | 0               |
| services               | 0               | 0               | 0               |
| cask-drivers           | 217             | 29              | 0               |
| cask-fonts             | 472             | 12              | 0               |
| cask-versions          | 325             | 27              | 0               |
+------------------------+-----------------+-----------------+-----------------+
| Total                  | 3553            | 571             | 2035            |
+------------------------+-----------------+-----------------+-----------------+

troymccabe avatar Sep 22 '22 05:09 troymccabe

That looks awesome, @troymccabe! Really looking forward to your PR! 😄

issyl0 avatar Sep 22 '22 08:09 issyl0

@troymccabe Yeh this would be great 🎉

MikeMcQuaid avatar Sep 22 '22 09:09 MikeMcQuaid

Awesome! Looking for a way to get PR comments & rejections if those would be valuable as well

On Thu, Sep 22, 2022 at 4:12 AM Mike McQuaid @.***> wrote:

@troymccabe https://github.com/troymccabe Yeh this would be great 🎉

— Reply to this email directly, view it on GitHub https://github.com/Homebrew/brew/issues/13642#issuecomment-1254747426, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ5KHYZ4AJVNMTVOSGWCMLV7QPGRANCNFSM55PZK33A . You are receiving this because you were mentioned.Message ID: @.***>

troymccabe avatar Sep 22 '22 12:09 troymccabe

The latest desired features here:

  • [x] allow filtering to just the core repos (brew, homebrew-core, homebrew-cask) with --repositories=primary or something
    • https://github.com/Homebrew/brew/pull/14712
  • [x] if not already done: include merge commits for the person who did the merge
    • This is already in the original implementation by default with the --author query.
  • [ ] Figure out a way to use the GitHub APIs rather than git log. There currently doesn't seem to be any support for Co-authored-by authorships in the API though.
  • [x] allow outputting for all maintainers (we've got some code to scrape these from the README)
  • [x] order the maintainers based on their total contributions
  • [x] include PR approvals
  • [ ] allow ranking against all contributors in a repository
  • [x] count commit authors/commit committers separately
    • not currently available if we use the GitHub commits API

issyl0 avatar Feb 19 '23 18:02 issyl0

Closing this since the big items are completed. The remaining thing that uses git log is the coauthors data retrieval. When the GitHub APIs support that filter (I'm working on it) I'll use it.

issyl0 avatar Mar 03 '23 18:03 issyl0