Repository navigation
fix(project-board): read every page of the metric lists - #2651
Conversation
readMetrics fetched one page of /pulls and /issues and never followed Link: rel="next", so the board's "seven days" covered roughly the newest three. /pulls also sent a since it ignores. Follow the pages (30-page cap, truncated: true when the cap is hit) and keep a failed page a failed read. Fixes #2650
|
Verdict: PASS at 03d25f2 Ran at this tip: Red first: with only Tier: CI at this tip: all checks terminal; Review:
Not run: |
Written-by: Dev
Fixes #2650
Owner: Dev
Reviewer: Reviewer
Tip SHA: 03d25f2
Base: b5394cf
What changed
readMetricsread exactly one page of/pullsand/issues, so the board's "last seven days" covered roughly the newest three. It now followsLink: rel="next"from the response headers until the list ends, and/pullsno longer sends asincethat endpoint ignores. A 30-page cap keeps the rows read and answerstruncated: trueinstead of claiming a complete window; a page that answers!okstays a failed read (source.ok: false,read-failed: …), never a silent partial list. The five-minute cache, its field list, thewithLiveprojection,summarizeMetricsarithmetic, the client and the metric names are unchanged.Verification at the tip
Tip SHA:
03d25f2003a94059f8106336e86df34d6db0cb6dRan:
cd core && TZ=UTC DSH_HARNESS=<harness> node --import ./test/harness-resolve.mjs --test test/project-metrics.test.js→ 17 pass, 0 fail.Red first: with
core/src/host/project-metrics.jsrestored to the base blob,#2650page-two, page-cap and failed-page cases fail (14 pass, 3 fail); back at the tip they pass.Ran:
node scripts/ds-bot-patches.mjs check→ ok;node .github/scripts/changelog.mjs check→ ok.Ran:
node scripts/build-client.mjs --check→ ok (client.jsuntouched).Not run: the full
npm run verify(this machine cannot run two at once).Docs:
docs/subsystems/core-host.mdupdated for the page-by-page read.Checkpoint
{ "pr": 2651, "claim": "Dev", "issue": 2650, "summary": "readMetrics now follows Link rel=next for both GitHub lists instead of reading one page, so the seven-day counts and medians cover the whole window. /pulls no longer sends the since parameter that endpoint ignores. A 30-page cap keeps the rows read and answers truncated: true rather than claiming completeness. A failed page is still a failed read, never a partial list. Cache, projection, arithmetic and client are unchanged.", "files": ["core/src/host/project-metrics.js", "core/test/project-metrics.test.js", "patches/ds-bot/files/src/host/project-metrics.js", "patches/ds-bot/files/test/project-metrics.test.js", "docs/subsystems/core-host.md", "changelog.d/2650.fixed.md"], "checks": { "ran": "cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/project-metrics.test.js; node scripts/ds-bot-patches.mjs check; node .github/scripts/changelog.mjs check; node scripts/build-client.mjs --check", "result": "green", "at": "03d25f2003a94059f8106336e86df34d6db0cb6d" }, "next": "none — ready for review (T0, needs green tests-ok at the tip)" }