You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to get some rough statistics on the number of people contributing to Threadbare in various ways. The easiest way I found to get the numbers I wanted was to use the gh command-line tool to query issues; tell it to present the result in JSON format; and tell it to run that JSON through a jq program.
I want to exclude people who work for Endless Access from these numbers. Unfortunately the query language that GitHub provides for issues and pull requests doesn't support saying "exclude issues assigned to members of this team". So I resorted to a cut-off date (before which more people from Endless Access and our partners were committing actively) plus a list of "except this person" rules that I wrote by hand.
GitHub Issues can be closed with two reasons: "completed" and "not planned". We only want to count completed issues. Unfortunately when you convert an issue into a Discussion, it is also apparently considered completed. To exclude these I used has:assignee to only select issues that were assigned to someone.
I can't remember why I had to say -s all rather than -s closed here.
Some issues are resolved by providing an asset, sketched level design, concept art, etc.: integrating these is tracked separately.
A pull request can have contributions from more than one person, but it is not easy to access this data:
PRs can only have one creator
PRs do have an Assignees field (like Issues) but only maintainers can assign people to a PR; and even then only people who have commented on the PR; and this is manual
You can dig down into the commits to find their (potentially multiple) authors but we can't quickly do this with gh
Contributors assigned to open issues
You'd think this would be easy, but it's not: has:assignee does not seem to work in gh's --search argument. However you can just look at this on the web:
Many of our issues are tagged with an amount of XP earned by completing them. This is input into another system that we haven't built yet, but we want to take a look at the average so far. So with this jq program saved as xp.jq:
# Parse XP out of comment bodiesmap({assignees: .assignees|map(.login), "xp": .body|capture("XP Summary \\(total (?<xp>\\d+)\\)") |.xp}) |# Explode multiple assignees to one row per assigneemap(
.xpas$xp|.assignees[] |
{assignee: ., xp: ($xp|tonumber)}
) |# Group by assignee and get the total per assigneegroup_by(.assignee) |map({assignee: .[0].assignee, total_xp: map(.xp) |add}) |# Now average thatmap(.total_xp) |add/length
We can then filter the output of a query through it:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to get some rough statistics on the number of people contributing to Threadbare in various ways. The easiest way I found to get the numbers I wanted was to use the
ghcommand-line tool to query issues; tell it to present the result in JSON format; and tell it to run that JSON through a jq program.I want to exclude people who work for Endless Access from these numbers. Unfortunately the query language that GitHub provides for issues and pull requests doesn't support saying "exclude issues assigned to members of this team". So I resorted to a cut-off date (before which more people from Endless Access and our partners were committing actively) plus a list of "except this person" rules that I wrote by hand.
Contributors assigned to resolved issues
Complications here:
has:assigneeto only select issues that were assigned to someone.-s allrather than-s closedhere.Authors of accepted pull requests
$ gh pr list --limit 1000 -s merged \ --search 'merged:>=2025-06-01 -author:cassidyjames -author:PlayMatters -author:hydrolet -author:wjt -author:manuq -author:app/dependabot -author:jgbourque' \ --json author \ --jq 'map(.author.login) | unique | length' # ⇒ 16This number is not the same as the number of contributors who resolved issues, because:
ghContributors assigned to open issues
You'd think this would be easy, but it's not:
has:assigneedoes not seem to work ingh's--searchargument. However you can just look at this on the web:https://github.com/endlessm/threadbare/issues?q=-assignee%3Acassidyjames%20-assignee%3Awjt%20-assignee%3Amanuq%20is%3Aopen%20is%3Aissue%20has%3Aassignee
Average XP earned
Many of our issues are tagged with an amount of XP earned by completing them. This is input into another system that we haven't built yet, but we want to take a look at the average so far. So with this jq program saved as
xp.jq:We can then filter the output of a query through it:
gh issue list --limit 1000 -s all \ --search '-assignee:cassidyjames -assignee:PlayMatters -assignee:wjt -assignee:manuq closed:>2025-06-01 reason:completed is:issue has:assignee' --json assignees,body | jq -f xp.jq # ⇒ 318Beta Was this translation helpful? Give feedback.
All reactions