Skip to content

tools: scripts to evaluate contributions - #14509

Open
shwstppr wants to merge 3 commits into
apache:mainfrom
shwstppr:contribution-evaluation-script
Open

shwstppr wants to merge 3 commits into
apache:mainfrom
shwstppr:contribution-evaluation-script

Conversation

@shwstppr

Copy link
Copy Markdown
Contributor

Description

Count PRs/issues/reviews in apache/cloudstack* repos and name mentions on lists.apache.org

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

Count PRs/issues/reviews in apache/cloudstack* repos and name mentions on lists.apache.org

Signed-off-by: Abhishek Kumar <[email protected]>
@boring-cyborg boring-cyborg Bot added the Python Warning... Python code Ahead! label Oct 28, 2026
@shwstppr
shwstppr marked this pull request as ready for review October 28, 2026 09:17
Copilot AI balanced review requested due to automatic review settings October 28, 2026 09:17
@DaanHoogland

Copy link
Copy Markdown
Contributor

Thanks @shwstppr , I'll give these a go soon.

@DaanHoogland DaanHoogland added this to the 24.0 milestone Oct 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

6 open issues
What changed in this PR

Adds tooling to quantify contributor activity across GitHub and Apache mailing lists to support committer/PMC nomination discussions.

Changes:

  • Add a GitHub GraphQL script to count PRs/issues/reviews per user within org repos matching a pattern.
  • Add a lists.apache.org mbox-based script to count name/alias mentions with local caching.
  • Add documentation describing usage, options, and caveats for both scripts.
File Description
tools/​contribution/​github_org_contributions.py New CLI to query GitHub GraphQL and aggregate per-user contribution counters over a date window.
tools/​contribution/​apache_list_mentions.py New CLI to download/cache mbox archives and count name mentions in message bodies.
tools/​contribution/​README.md New README documenting required setup and usage for the contribution evaluation scripts.

Review effort: Lite

Comment thread tools/contribution/apache_list_mentions.py Outdated
Comment thread tools/contribution/apache_list_mentions.py Outdated
Comment thread tools/contribution/apache_list_mentions.py Outdated
Comment thread tools/contribution/github_org_contributions.py Outdated
Comment thread tools/contribution/apache_list_mentions.py Outdated
Comment thread tools/contribution/github_org_contributions.py Outdated
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.69%. Comparing base (510d0ec) to head (c20c84d).
⚠️ Report is 79 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14509      +/-   ##
============================================
+ Coverage     19.91%   20.69%   +0.78%     
- Complexity    20194    21770    +1576     
============================================
  Files          6373     6492     +119     
  Lines        577230   590805   +13575     
  Branches      70696    72461    +1765     
============================================
+ Hits         114942   122262    +7320     
- Misses       449722   455263    +5541     
- Partials      12566    13280     +714     
Flag Coverage Δ
uitests 3.88% <ø> (+0.17%) ⬆️
unittests 21.99% <ø> (+0.81%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Abhishek Kumar <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 11:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

- Dates without a time are in UTC; `--from` starts at the beginning of that day
and `--to` includes the whole day.
- GitHub limits a query to one year, so longer windows are split into yearly
chunks and summed.
Comment on lines +212 to +213
ordered.append(canon)
aliases_map[canon] = variants
Comment on lines +281 to +282
for canon in ordered_names:
mentions[canon] += len(mention_rx[canon].findall(body))
return " ".join(("" if r[h] is None else str(r[h])).ljust(colw[h]) for h in headers).rstrip()

print(f"Org: {org['login']} (repos matching: {args.repo_pattern})")
print(f"Window (UTC): {from_dt.isoformat()} -> {to_dt.isoformat()}")
cc = user["contributionsCollection"]
for key, field in COUNTERS.items():
entries = cc[field]
if len(entries) >= MAX_REPOSITORIES:
Signed-off-by: Abhishek Kumar <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 12:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

16 open issues

Review effort: Lite

"""
Download a single YYYY-MM mbox archive from lists.apache.org and save to out_dir.
"""
url = MBOX_API.format(list=list_name, domain=domain, ym=ym)
Comment on lines +86 to +87
headers = {"User-Agent": "apache-list-mentions/1.0"}
with requests.get(url, headers=headers, timeout=120, stream=True) as r:
Comment on lines +212 to +213
ordered.append(canon)
aliases_map[canon] = variants
Comment on lines +281 to +282
for canon in ordered_names:
mentions[canon] += len(mention_rx[canon].findall(body))
return " ".join(("" if r[h] is None else str(r[h])).ljust(colw[h]) for h in headers).rstrip()

print(f"Org: {org['login']} (repos matching: {args.repo_pattern})")
print(f"Window (UTC): {from_dt.isoformat()} -> {to_dt.isoformat()}")

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Python Warning... Python code Ahead!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants