[quality] /resources/metrics publishes a commit count as "Reference architecture submissions" (28 on the chart, 8 on the card)
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- git, github-actions, javascript
Direzione di ricerca
Read architectureTimelineData() in scripts/collect-metrics.mjs and the fixture in tests/collect-metrics.test.mjs. Update the series to count each architecture directory once when its first file is added, adjust the expected timeline, and point its sourceUrl to the architecture directory page. Done when the test covers later edits or additions within an existing directory without increasing the submission count. A pull request is already open for this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Finding
/resources/metrics publishes a chart titled "Reference architecture submissions" whose values are a count of git commits, not submissions.
architectureTimelineData() in scripts/collect-metrics.mjs builds the series from git log --format=%aI -- content/en/architectures, which emits one line per commit, buckets those lines by month and publishes the running total:
const commits = execFileSync(
'git',
['-C', dir, 'log', '--format=%aI', '--', 'content/en/architectures'],
{ encoding: 'utf8' },
)
So every commit that touches an existing architecture — a typo fix, an image swap, a front-matter edit, a directory rename — adds one to the published "submissions" count.
What a visitor sees
On the same page, in data/metrics.json as committed today (generatedAt 2026-10-25, cncf/architecture revision 3ddf917facd0aea9694cc9c12c52e583fd2f86cb):
Element on /resources/metrics |
Value |
|---|---|
| "Reference architectures" stat card | 8 |
| "Reference architecture submissions" chart, last point (2026-07) | 28 |
Both are collected in the same run from the same upstream path. A reader cannot reconcile them, and the 28 is not a count of anything a reader would call a submission. /architectures separately reports "10 real-world architecture reports".
Reproduction
The behaviour is pinned by the committed fixture. tests/collect-metrics.test.mjs builds an upstream repo with two architecture directories (acme-platform, globex-edge) and three commit dates, where the third commit only edits an existing page, and asserts:
assert.deepEqual(data.series.referenceArchitectures.values, [
{ date: '2024-01', value: 2 },
{ date: '2024-03', value: 3 },
]);
Two architectures, a published "submissions" total of three.
Recommendation
Count each architecture directory once, at the commit that first added a file under it. Replace architectureTimelineData() in scripts/collect-metrics.mjs with:
// One cumulative point per month, counting each architecture directory once at
// the commit that first added a file under it. `git log --format=%aI` alone
// counts commits, so an edit to an existing architecture used to register as a
// new submission.
function architectureTimelineData(dir) {
const log = execFileSync(
'git',
[
'-C',
dir,
'log',
'--reverse',
'--format=%aI',
'--name-only',
'--diff-filter=A',
'--',
'content/en/architectures',
],
{ encoding: 'utf8' },
);
// --reverse walks oldest-first, so the first commit a directory appears
// under is the one that introduced it.
const added = new Map();
let month = null;
for (const line of log.split('\n')) {
if (!line) continue;
if (/^\d{4}-\d{2}-\d{2}T/.test(line)) {
month = line.slice(0, 7);
continue;
}
// content/en/architectures/<id>/<rest>: a path with no <rest> is a loose
// file in the root, not an architecture, and the stat card does not count
// it either.
const parts = line.split('/');
if (parts.length < 5) continue;
if (added.has(parts[3])) continue;
added.set(parts[3], month);
}
const months = {};
for (const value of added.values()) months[value] = (months[value] || 0) + 1;
let total = 0;
return Object.entries(months)
.sort(([a], [b]) => a.localeCompare(b))
.map(([date, value]) => ({ date, value: (total += value) }));
}
Verified against a local git repository built to match the test fixture exactly (two architecture directories; commits dated 2024-01-10, 2024-01-20 and a 2024-03-05 edit to an existing page):
current : [{"date":"2024-01","value":2},{"date":"2024-03","value":3}]
proposed: [{"date":"2024-01","value":2}]
The same deliverable also needs:
tests/collect-metrics.test.mjs— the pinned expectation becomes[{ date: '2024-01', value: 2 }], and the test name should say the series counts architectures added, not commits. Worth adding a case where a directory is added in two commits (page, then images) to show it is counted once.scripts/collect-metrics.mjs— the seriessourceUrlcurrently points athttps://github.com/cncf/architecture/commits/main/content/en/architectures, the commit list. Once the series counts directories, point it athttps://github.com/cncf/architecture/tree/main/content/en/architectures, the same URL the stat card uses.data/metrics.jsonis regenerated by the weekly Refresh metrics lane (.github/workflows/refresh-metrics.yml), so no hand edit is needed; the published figure corrects itself on the next run after the script change merges.
Scope
One deliverable, one PR: scripts/collect-metrics.mjs plus its test. No workflow file is involved.
The quality lane is testing-only and does not open PRs that change production scripts, so this needs a maintainer or another lane to land.
Priority
- Impact: high — a wrong number is published on a page whose stated purpose is "a transparent snapshot", and it contradicts another number on the same page
- Effort: low
Remit: corrects a figure an end user reads on /resources/metrics.
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: e7ac6e8
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88
- Lingua principale
- JavaScript
- Stelle
- 0
- Fork
- 3
- Merge medio
- 7h 8m
- PR unite (30g)
- 565
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cncf/endusers
-
agent/quality bug ci stage/010-actionable
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
a11y: search button accessible name does not contain its visible label (WCAG 2.5.3)Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertablocked bug hive/claimed-by-scanner needs-human
Difficoltà 4/5 3-5 giorni Idoneità per principianti 39/100
cncf/endusers#1618 · 8 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
🐝 Hive Advisory ReportForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertahive/advisory
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
cncf/endusers#23 · 8 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cncf/endusers
Issue simili
-
step.duration reflects only the last retry attempt (HelperStep.run() overwrites startTime)Forse già presa @mirao l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
codeceptjs/CodeceptJS#5774 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Status: Unconfirmed
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
AllTheMods/ATM10-Aeronautics#151 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
feimacode/open-design-agent-kit#66 ·
I maintainer di solito rispondono entro 1 giorno