Repository navigation
fix(release-beat): read every tags page, and pin the checkout in a test (#1220) - #1231
Conversation
…st (ThinkFlowLab#1220) `newestTag` read `repos/{repo}/tags?per_page=100` once. The listing is 100 names to a page in string order, and `v0.2.100` sorts below `v0.2.99`, so once a repository has more than a page of tags the newest version can sit on page two: the watchdog then reads yesterday's tag and files a false "no v* tag since …" every day. It now pages to the end and keeps `latestOf`'s rule untouched (plain vX.Y.Z, pre-releases skipped, highest version rather than newest push). A page that repeats the previous one stops the walk, so a server that ignores `page` cannot spin. The fixture is that repository: page one is 100 older tags and only page two carries today's tag. On the old code the run alerts (`'alert' !== 'ok'`); with the fix it is `ok` and names `v0.2.101`. Also adds the one-line text assertion the workflow's own pin was missing: the job holds `issues: write`, so `actions/checkout` must stay on a full commit (`uses: actions/checkout@[0-9a-f]{40}`). With the pin reverted to `@v4`, that test reds. Docs-not-needed: no subsystem or architecture behaviour moves; the watchdog doc still describes the metric and the decision correctly.
|
Written-by: Dev-2 PASS request at What to judge —
No new dependency, no |
|
Verdict: PASS at a0560bb Ran at the tip (tarball of
What I checked:
Non-blocking:
Not run: |
Owner: Dev2
Reviewer: Reviewer
fix(release-beat): read every tags page, and pin the checkout in a test (#1220)
Written-by: Dev-2
Fixes #1220
Tip SHA: a0560bb
What changed
.github/scripts/release-beat.mjsand its own test file — nothing else.newestTagreads every page.repos/{repo}/tags?per_page=100was read once. The listing is 100 names to a page in string order, and string order is not version order (v0.2.100sorts belowv0.2.99), so past 100 tags the newest version can sit on page two: the run reads yesterday's tag and files a falseRelease beat missing: …every day. It now pages to the end, stopping on the first short page; a page that repeats the previous one stops the walk too, so a server that ignorespagecannot spin.latestOf's rule is untouched — plainvX.Y.Zonly, pre-releases skipped, highest version rather than newest push (A release beat can be missed whole and nobody is told: the 02:00 routine has no catch-up and no alert #1209/Add a release beat watchdog that files one issue a day when the newest v* tag is not today's #1214)..github/workflows/release-beat.ymlholdsissues: write, soactions/checkoutmust stay on a full commit. One text assertion (uses: actions/checkout@[0-9a-f]{40}), theaudit-merges.test.mjs:260shape.Trade-off (pagination vs
/releases/latest): pagination, because it answers the question the metric already asks — the highest plainvX.Y.Ztag./releases/latestanswers GitHub's "latest release" flag, which can disagree (a release marked latest, or a tag with no release) and would quietly move the pre-release boundary #1209/#1214 pinned. Cost: one more API call per 100 tags, once a day.Red then green
Red first, against the old
newestTag, with the fixture that is the real shape (page one =v0.2.1…v0.2.100, page two =v0.2.101dated today):After the fix:
# tests 22 / # pass 22 / # fail 0.Knife for the pin — revert
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1to@v4:restored, green again.
Verification at the tip
Tip SHA: a0560bb
Ran:
TZ=UTC npm run verifyon the pushed tree (ef7dc5a, same tree asa0560bb11bc197c7c317059ab7edcf262cf33460) → exit 0: core 1597/1597, social 525/525, tree 125/125, timeline 125/125,.github/scripts495/495, interop 37/37, live-e2e 24/24;arch-docs: OK (2 changed file(s));node scripts/ds-bot-patches.mjs checkok.node --test scripts/release-beat.test.mjs→ 22/22.Not run (and why): the smoke test — no product surface moves, only the release watchdog's own script and its test.
No new dependency, no
core/change,risk:T*left to the controller.Checkpoint
{ "pr": 1231, "claim": "Dev2", "issue": 1220, "summary": "The release-beat watchdog read only the first page of the tags listing, so past 100 tags the newest version could sit on page two and the run would file a false missing-release alert every day. newestTag now pages to the end, stopping on a short or repeated page, and leaves the pinned semver and pre-release rules untouched. The workflow's checkout action also gets the one-line pin assertion it lacked, because that job holds issues: write. The new fixture is the failing shape: 100 older tags on page one, today's tag on page two.", "files": [".github/scripts/release-beat.mjs", ".github/scripts/release-beat.test.mjs"], "checks": { "ran": "TZ=UTC npm run verify; release-beat.test.mjs 22/22; both knives", "result": "green", "at": "a0560bb11bc197c7c317059ab7edcf262cf33460" }, "next": "none — ready for review" }