From 786e031797c23c3c8daa090c081935e3e858a7b0 Mon Sep 17 00:00:00 2001 From: castrojo Date: Sat, 24 Oct 2026 15:57:42 -0400 Subject: [PATCH] fix(analytics): align contributor layout, methodology, and chart series - move Contributor Metrics directly below countme charts and deduplicate heading - update methodology copy to reflect org-wide merged PR and issue scope - trim Chart 2 and Chart 3 to active data streams (Merged PRs, Issues, PRs Opened) Assisted-by: Gemini 3.8 Flash via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/analytics.mdx | 16 ++-- scripts/contributor-charts.test.js | 6 +- .../analytics/ContributorMetricsCharts.tsx | 75 +++++-------------- 3 files changed, 27 insertions(+), 70 deletions(-) diff --git a/docs/analytics.mdx b/docs/analytics.mdx index f0d2eb7f..1dd5f130 100644 --- a/docs/analytics.mdx +++ b/docs/analytics.mdx @@ -9,6 +9,10 @@ import ContributorMetricsCharts from "@site/src/components/analytics/Contributor +## Contributor Metrics + + + ## Methodology, Privacy & Opt-Out ### Counting Methodology @@ -59,19 +63,13 @@ brew analytics off See the [Homebrew analytics documentation](https://docs.brew.sh/Analytics) for additional details. -## Contributor Metrics - -### Contributor Metrics - - - ### Contributor Metrics Methodology Contributor analytics adopt a CNCF DevStats and LFX-derived methodology: -- **4 summary metrics and 3 trend charts:** Tracking monthly active human contributors, first-time contributors, pull request merge rate, and median turnaround time alongside historical trends for contributor cohorts, activity breakdowns, and PR velocity. -- **Public GitHub dataset with automated bot and AI agent filtering:** Metrics are derived from public GitHub activity while strictly filtering automated bots, dependency managers, and autonomous AI agents to ensure counts represent real human open-source participation. -- **Activity Streams on Tier-1 repositories:** Activity streams track the 9 tier-1 repositories on a shared domain to provide clear visibility into development velocity across code and builds, code reviews, issues, and documentation. +- **4 summary metrics and 3 trend charts:** Tracking monthly active human contributors (merged PR authors), first-time contributors, pull request merge rate, and human throughput alongside historical trends for contributor cohorts, activity breakdowns, and PR velocity. +- **Public GitHub dataset with automated bot and AI agent filtering:** Metrics are derived from public GitHub activity across the entire `projectbluefin` organization while strictly filtering automated bots, dependency managers, and autonomous AI agents to ensure counts represent real human open-source participation. +- **Organization-wide activity streams:** Activity streams track merged pull requests and issues across all public repositories in `projectbluefin` on a shared domain. - **Community forum discussions:** Community discussions are hosted at [ublue-os/bluefin](https://github.com/ublue-os/bluefin/discussions). For real-time development and organizational velocity metrics across all 15 factory repositories, see the [Factory metrics view](/factory/metrics). diff --git a/scripts/contributor-charts.test.js b/scripts/contributor-charts.test.js index 67834f54..704351aa 100644 --- a/scripts/contributor-charts.test.js +++ b/scripts/contributor-charts.test.js @@ -226,7 +226,7 @@ test("renders full contributor analytics metrics and charts", () => { assert.ok(html.includes("93%")); // Latest merge rate (2026-09) assert.ok(html.includes("290")); // Latest human merged PRs (2026-09) assert.ok(html.includes("Active Human Contributors Trend")); - assert.ok(html.includes("Human Contribution Types Breakdown")); + assert.ok(html.includes("Contribution Activity Streams")); assert.ok( html.includes("PR Velocity & Merge Rate") || html.includes("PR Velocity & Merge Rate"), @@ -240,12 +240,12 @@ test("renders full contributor analytics metrics and charts", () => { ); assert.ok( html.includes( - "Activity breakdown by contribution stream across Tier-1 repositories", + "Monthly activity breakdown by contribution stream across projectbluefin", ), ); assert.ok( html.includes( - "Pull request opening velocity, merges, and median turnaround time", + "Monthly pull request velocity and merge efficiency across projectbluefin", ), ); }); diff --git a/src/components/analytics/ContributorMetricsCharts.tsx b/src/components/analytics/ContributorMetricsCharts.tsx index 6d7dac3e..8ed59f38 100644 --- a/src/components/analytics/ContributorMetricsCharts.tsx +++ b/src/components/analytics/ContributorMetricsCharts.tsx @@ -318,12 +318,7 @@ export default function ContributorMetricsCharts({ trigger: "axis", }, legend: { - data: [ - "Code & Builds", - "Code Reviews", - "Issues & Triage", - "Documentation", - ], + data: ["Merged PRs", "Issues & Triage"], right: 8, top: 6, textStyle: { fontSize: 12 }, @@ -341,19 +336,12 @@ export default function ContributorMetricsCharts({ }, series: [ { - name: "Code & Builds", + name: "Merged PRs", type: "line", lineStyle: { color: cat[0] ?? "#4285f4", width: 2 }, itemStyle: { color: cat[0] ?? "#4285f4" }, data: gapSafe(codeBuildsSeries), }, - { - name: "Code Reviews", - type: "line", - lineStyle: { color: cat[1] ?? "#22306b", width: 2 }, - itemStyle: { color: cat[1] ?? "#22306b" }, - data: gapSafe(codeReviewsSeries), - }, { name: "Issues & Triage", type: "line", @@ -361,23 +349,9 @@ export default function ContributorMetricsCharts({ itemStyle: { color: cat[2] ?? "#5c7bd1" }, data: gapSafe(issuesTriageSeries), }, - { - name: "Documentation", - type: "line", - lineStyle: { color: cat[3] ?? "#3f5aa4", width: 2 }, - itemStyle: { color: cat[3] ?? "#3f5aa4" }, - data: gapSafe(docsSeries), - }, ], }; - }, [ - theme, - monthLabels, - codeBuildsSeries, - codeReviewsSeries, - issuesTriageSeries, - docsSeries, - ]); + }, [theme, monthLabels, codeBuildsSeries, issuesTriageSeries]); // Series for Chart 3: PR Velocity & Merge Rate (Opened vs Merged, median days to merge) const prsOpenedSeries = useMemo(() => { @@ -414,12 +388,12 @@ export default function ContributorMetricsCharts({ trigger: "axis", }, legend: { - data: ["PRs Opened", "PRs Merged", "Median Days to Merge"], + data: ["PRs Opened", "PRs Merged"], right: 8, top: 6, textStyle: { fontSize: 12 }, }, - grid: { left: 48, right: 48, top: 40, bottom: 32, containLabel: true }, + grid: { left: 48, right: 24, top: 40, bottom: 32, containLabel: true }, xAxis: { type: "category", data: monthLabels, @@ -432,11 +406,6 @@ export default function ContributorMetricsCharts({ minInterval: 1, splitLine: { show: true }, }, - { - type: "value", - name: "Days", - splitLine: { show: false }, - }, ], series: [ { @@ -453,17 +422,9 @@ export default function ContributorMetricsCharts({ itemStyle: { color: cat[2] ?? "#5c7bd1" }, data: gapSafe(prsMergedSeries), }, - { - name: "Median Days to Merge", - type: "line", - yAxisIndex: 1, - lineStyle: { color: cat[4] ?? "#89a3f0", width: 2, type: "dashed" }, - itemStyle: { color: cat[4] ?? "#89a3f0" }, - data: gapSafe(medianDaysSeries), - }, ], }; - }, [theme, monthLabels, prsOpenedSeries, prsMergedSeries, medianDaysSeries]); + }, [theme, monthLabels, prsOpenedSeries, prsMergedSeries]); const currentMonthLabel = latestMeasuredMonth?.month ?? "current"; @@ -559,31 +520,29 @@ export default function ContributorMetricsCharts({
- Human Contribution Types Breakdown + Contribution Activity Streams

- {( - latestMeasuredMonth?.streams?.codeBuilds ?? - latestMeasuredMonth?.streams?.humanPrs ?? - 0 - ).toLocaleString("en-US")} + {(latestMeasuredMonth?.streams?.humanPrs ?? 0).toLocaleString( + "en-US", + )} {" "} - code contributions · {currentMonthLabel} + human merged PRs · {currentMonthLabel}

@@ -602,14 +561,14 @@ export default function ContributorMetricsCharts({ option={chart3Option} title="PR Velocity & Merge Rate" summary={ - mergeRate !== null - ? `${mergeRate}% PR merge rate in ${currentMonthLabel}.` + latestMeasuredMonth + ? `Pull request throughput for ${currentMonthLabel}: ${latestMeasuredMonth.streams?.prsOpened ?? 0} opened, ${latestMeasuredMonth.streams?.prsMerged ?? 0} merged.` : "accumulating data" } points={chart3PointsCount} minPoints={3} height={300} - tableCaption="Pull request opening velocity, merges, and median turnaround time" + tableCaption="Monthly pull request velocity and merge efficiency across projectbluefin" />