Skip to content

Contributor Stats: count only merged PRs#13

Merged
tisto merged 26 commits intomainfrom
gh-contributions-merged-prs-only
Mar 16, 2026
Merged

Contributor Stats: count only merged PRs#13
tisto merged 26 commits intomainfrom
gh-contributions-merged-prs-only

Conversation

@tisto
Copy link
Member

@tisto tisto commented Mar 14, 2026

  • I signed and returned the Plone Contributor Agreement, and received and accepted an invitation to join a team in the Plone GitHub organization.
  • I verified there aren't any other open pull requests for the same change.
  • I followed the guidelines in Contributing to Plone.
  • I successfully ran code quality checks on my changes locally.
  • I successfully ran tests on my changes locally.
  • If needed, I added new tests for my changes.
  • If needed, I added documentation for my changes.
  • I included a change log entry in my commits.

If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.

Closes #

@tisto tisto requested review from erral and stevepiercy March 14, 2026 19:52
Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

A few questions and documentation tweaks.

@@ -19,48 +19,48 @@ This report shows the top contributors and organizations in the Plone ecosystem
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused between the factors that define individual versus organization.

I expected Victor appear in the top 10, but he doesn't appear.

I also don't know whether I'm counted as an organization or an individual.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right. The way it is right now is confusing. I simplified the report so that we only look at the number of merged PRs and we look at individual contributors and organisation contributors.

You are currently counted both as an individual and an organisation. One-person organisations are an edge case and I understood your previous comments that you want it that way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Pushed. Pls double-check.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that one-person organizations should be allowed to choose whether to have their reported data counted under either their organization or their name, but not both. For me, I prefer my organization name.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what I'm double checking? I still see myself reported as GitHub user stevepiercy, name Steve Piercy, and organization Steve Piercy - Website Builder.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. Anyone can choose whatever they want in that regard. I will double-check the assignment. I also found a problem in the way we retrieve the core contribution stats. There seems to be a caching issue with the github api. Will provide a fix soon.

Copy link
Member Author

Choose a reason for hiding this comment

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

I fixed the issue and from now on we will only count commits to the default branch and commits in PRs that have been merged. I have to re-run all the statistics. This will take a while...

| 3 | stevepiercy | 1,935 | 655 | 2,590 | 34 |
| 4 | petschki | 1,575 | 436 | 2,011 | 55 |
| 5 | davisagli | 1,120 | 296 | 1,416 | 75 |
| 6 | sneridagh | 717 | 964 | 1,681 | 21 |
Copy link
Contributor

Choose a reason for hiding this comment

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

And here is Victor in the top 10 for past 3 years, but not in the top ten for last year only. That's unexpected.

| 8 | petschki | 2,974 | 808 | 3,782 | 87 |
| 9 | pbauer | 2,663 | 556 | 3,219 | 135 |
| 10 | thet | 2,630 | 787 | 3,417 | 105 |
| 1 | mauritsvanrees | 14,415 | 1,540 | 15,955 | 178 |
Copy link
Contributor

Choose a reason for hiding this comment

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

Respect.

tisto and others added 7 commits March 15, 2026 09:19
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

This corrects my earlier mistake.

volto_stats.py Outdated
Fetches data from GitHub API for all contributors.

Statistics include:
- Merged pull requests (excluding open or closed or rejected pull requests)
Copy link
Contributor

Choose a reason for hiding this comment

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

Oops, I didn't check how that expanded. This version is consistent with intent of the function.

Suggested change
- Merged pull requests (excluding open or closed or rejected pull requests)
- Merged pull requests (excludes both open and rejected pull requests)

@tisto
Copy link
Member Author

tisto commented Mar 15, 2026

@stevepiercy ready for another review.

@stevepiercy
Copy link
Contributor

@tisto I'm still listed as an individual in the GitHub stats report, not an organization. I prefer to be listed as the latter.

@tisto
Copy link
Member Author

tisto commented Mar 16, 2026

@stevepiercy I found the issue. However, I need to re-generate the full set of data and I would like to refactor the code so that we do not have to retrieve data over and over again if the organisation mapping changes. Are you ok to merge this PR as it is? Otherwise, this will become a Frankenstein PR. I will fix your issue afterwards.

@stevepiercy
Copy link
Contributor

@tisto let's merge. I'm also losing track of things, and having a base to work upon would help clarify.

For me, my only outstanding question is, for one-person organizations, should they be listed only as a GitHub user, only as their organization name, or as both? Short answer, it depends on the context and available data. As I understand it, is this correct?

for organization listings

  • If a person does not map to an organization, then they're listed under organizations as "Independent".
  • If they do map, then they're listed under organizations as "My Organization Name", as specified in organisations.csv.
  • An organization or person may request a mapping or update an organization's users by submitting a PR to update organisations.csv.

for individual listings

  • If a GitHub user does not map to an individual's name, then they're listed under individuals as "github_username".
  • If they do map, then they're listed under individuals as "FirstName LastName".

I didn't see an obvious file to map GitHub usernames to real names, but I imagine that is probably not manageable. This file appears to be an aborted attempt, and was superseded by a Python script.

@tisto
Copy link
Member Author

tisto commented Mar 16, 2026

@stevepiercy I fixed your numbers and the report. Both the individual contributor data and the organisation data now match: https://github.com/plone/plone-contributor-statistics/blob/a8e7b19ca67eeab0983befcb26e9dc287636d602/reports/github-contributor-report.md

@tisto
Copy link
Member Author

tisto commented Mar 16, 2026

@stevepiercy

If a person does not map to an organization, then they're listed under organizations as "Independent".

yes

If they do map, then they're listed under organizations as "My Organization Name", as specified in organisations.csv.

yes

An organization or person may request a mapping or update an organization's users by submitting a PR to update organisations.csv.
for individual listings

yes

If a GitHub user does not map to an individual's name, then they're listed under individuals as "github_username".
If they do map, then they're listed under individuals as "FirstName LastName".

We currently do not map github usernames to their fullname. We could do this.

I didn't see an obvious file to map GitHub usernames to real names, but I imagine that is probably not manageable. This file appears to be an aborted attempt, and was superseded by a Python script.

I indeed started to write a script for this when I needed some mappings. I did not pursue this further, though.

@tisto tisto merged commit 480015f into main Mar 16, 2026
@tisto tisto deleted the gh-contributions-merged-prs-only branch March 16, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants