Repository navigation
fix(analytics): show actual org-wide contributor participation - #1595
Conversation
Replace merged-PR process cards with deduplicated public contributor totals, cumulative growth, monthly participation, and non-code contribution kinds. Collect every public repository and all nested resource pages; preserve verified history on failures. Remove deprecated metric framing and speculative schemas. Assisted-by: GPT-6.1 Sol via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: GPT-6.1 Sol via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
HUMAN DECISION NEEDED — @castrojo confirm the two new read scopes (issues: read, discussions: read) granted to the scheduled workflow's token are intended.
Summary: This change replaces the old merged-pull-request statistics on the analytics page with a count of every GitHub account that has taken part in any public project repository. The collector, charts, docs and the daily refresh job were all rewritten together. The code reads cleanly and the offline tests pass, but the new refresh job will stop and publish a "data unavailable" flag whenever someone opens an issue or pull request while the scan is running, which could happen often on a busy project. The job also asks for two additional read-only permissions, which a maintainer should sign off on.
What I need from you: Confirm the new permissions, and consider the pagination relaxation below.
Reviewed at head f8d2b0b (dispatch cited 17f5824; the extra commit is test-only).
correctness
-
medium — Live activity during a scan fails the whole refresh.
connectionPagesrequirestotalCountto be identical across every page of a connection (scripts/fetch-contributor-metrics.js:214-215) and requires the finalcount === expected(:221). A single new issue, PR, discussion or comment landing on a repository while its connection is being paged changestotalCount, which throwsFAILURE_REASON, is caught per-repo (:535-539), and invalidates the complete run (:542). The output then becomes the retained snapshot withunavailable: true(:160-168), which the workflow commits and force-pushes over the pending data PR (.github/workflows/update-contributor-metrics.yml:77-91), andContributorMetricsCharts.tsx:158-160renders it with the unavailable banner. The test atscripts/fetch-contributor-metrics.test.js:505-507pins this as desired for dropped pages, but it also fires on ordinary growth of a live repository — unlike the REST commit path, which is bounded byuntil=asOf(:468). Suggested relaxation: allow the total to grow (new items are appended), still fail on shrinkage or short pages:--- a/scripts/fetch-contributor-metrics.js +++ b/scripts/fetch-contributor-metrics.js @@ async function connectionPages(load, visit, initial) { expected ??= connection.totalCount; - requireValue(expected === connection.totalCount); + // Items may be added mid-scan; they are appended and paged. Shrinkage still fails. + requireValue(connection.totalCount >= expected); + expected = connection.totalCount;
(The
count === expectedcheck at:221then compares against the latest total. Add a fixture where page 2 reportstotalCount + 1and an extra node, assertingunavailable: false.) -
low — Commit "changes" events pair the commit author identity with the committer date (
scripts/fetch-contributor-metrics.js:470-474). For rebased/squashed/imported history the committer date can be years after authorship, sofirstContributionAt(:84-96) and the "Contributors over time" curve reflect landing time, not first contribution. Usecommit.commit?.author?.dateif authorship time is the intent, or say "first landed" indocs/analytics.mdx:78-80.
security
- low — New token scopes
issues: readanddiscussions: read(.github/workflows/update-contributor-metrics.yml:15-16) alongside the existingcontents: write/pull-requests: write. Read-only on public data and needed by the GraphQL issue/discussion queries, so low risk, but a widened grant is a maintainer call. No new triggers,uses:changes, or secret references.
docs-currency
- low —
docs/analytics.mdxdrops the cross-links to the Factory metrics view and to Linux Foundation Insights (removed at old lines 75-77) without a replacement. Neither is DevStats framing; consider keeping them below the methodology if they are still valid destinations.
style
- low —
docs/skills/github-api-client.md:213-214cites "/websites/github_en_graphqlin Context7", a tool-specific library ID. Link the GitHub GraphQL docs URL instead so the reference works without that tool.
No findings from: intent-alignment.
Confidence: 3/5 (needs attention) — 1 medium finding; 1 perspective requires a human decision
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
f8d2b0b
ℹ️ Sentinel notice — informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @castrojo, head
Hive did not add the |
Require complete final page totals while allowing append-only activity during scans. Page issues and PRs chronologically and preserve the timestamp cutoff. Report sanitized source operation failures as Action warnings without leaking upstream messages or failing builds. Assisted-by: GPT-6.1 Sol via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d4ddb40
ℹ️ Sentinel notice — informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @castrojo, head
Hive did not add the |
There was a problem hiding this comment.
HUMAN DECISION NEEDED — @castrojo confirm the two new read-only token scopes (issues: read, discussions: read) granted to the daily metrics workflow.
Summary: This change replaces the old "merged pull requests" contributor numbers on the analytics page with a full count of everyone who has participated in any public Bluefin repository. I read the whole change and ran its offline tests; the collector, chart and docs hold together. Two small things: one known image-optimizing robot account is still counted as a person, and two useful links to other metrics pages were dropped from the analytics page. The automated workflow also asks for two extra read-only permissions, which a maintainer should sign off on.
What I need from you: Approve the two new read scopes; optionally apply the two suggestions below.
Reviewed head d4ddb40. Ran node --test scripts/fetch-contributor-metrics.test.js locally: 17/17 pass. contributor-charts.test.js not run here (needs npm ci; author reports it passing).
security
.github/workflows/update-contributor-metrics.yml:15-16newly grantsissues: readanddiscussions: readtoGITHUB_TOKEN. Read-only and consistent with whatscripts/fetch-contributor-metrics.js:333-434queries, so this looks justified — flagged only because any newly granted workflow scope is a human sign-off per hive policy. Everything else is a tightening (--force-with-leaseat line 87,github.ref == 'refs/heads/main'guard at line 79, fetch-depth 0 so the pending-branch ref exists for the retain step).
correctness
- Low —
static/data/contributor-metrics.jsonstill containsImgBotApp(idMDQ6VXNlcjMxNDI3ODUw, one contribution 2025-07-30). It's the imgbot.net service account, whichsrc/components/HiveFactoryDashboard.tsx:710andsrc/components/reports/ReportLeaderboard.tsx:31already treat as a bot, butscripts/lib/contributor-tracker.mjs:18-39BOT_PATTERNS(the "canonical bot policy" this PR relies on atscripts/fetch-contributor-metrics.js:66) has no entry for it, so the headline 456 is 455 humans + 1 bot. Fix, then regenerate with--force:(insert before the/^imgbot(app)?$/i, /\[bot\]$/i,/\[bot\]$/iline inscripts/lib/contributor-tracker.mjs).
docs-currency
- Low —
docs/analytics.mdx(diff hunk @65) removes the cross-link to the still-existing/factory/metricspage (src/pages/factory/metrics.tsx) and the only link in docs to the Linux Foundation Insights project page. Neither removal is mentioned in the PR body, and neither is DevStats framing. Suggest restoring after the new Sources paragraph:For development velocity across the factory repositories, see the [Factory metrics view](/factory/metrics). Upstream repository metrics for `projectbluefin/bluefin` are also tracked on [Linux Foundation Insights](https://insights.linuxfoundation.org/project/ublue-os-bluefin).
No findings from: intent-alignment, style.
Confidence: 3/5 (needs attention) — 1 perspective requires a human decision
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Correction
Replaces merged-PR process cards with an auditable community view: 456 linked GitHub contributor accounts across all 59 public repositories, 148 active in 90 days, and 40 repositories with recent participation.
Counts code/documentation changes, PR authors, issue authors, comments, submitted reviews and native discussions. Stable account IDs are unioned across every public repository, including archives and native fork activity. Known bots, unlinked authors and imported fork git history are excluded; limits are visible.
Integrity
Verified