37138 autodetect previous tag - #37140
Conversation
|
Claude finished @sfreudenthaler's task in 1m 15s —— View job ReviewVerified the diff end-to-end: the New Issues
Notes (non-blocking)
Nice touch conditioning the skip on missing notes rather than on same-day date — the No blocking issues. · |
findPreviousTag returned tags[idx + 1] unconditionally. On a day with more than
one release attempt that preceding tag is another attempt at the same release,
whose pipeline died before writing notes -- so the generated changelog covered
one attempt instead of the whole release. On 26.08.19 that published "internal
maintenance only" for a release carrying 19 commits.
Three fixes in the same two functions:
- listStandardReleaseTags now returns {tag, hasNotes} and skips drafts.
listReleases returns drafts first regardless of date, corrupting the
newest-first ordering the docstring promises; 6 drafts currently match the
standard pattern and one duplicates v26.04.11-02.
- findPreviousTag walks back to the first release with notes, so an
undocumented attempt's commits stay inside the range instead of being
stranded behind its tag.
- findIndex on tag equality replaces indexOf, which returned the first match
for a duplicated tag.
A same-day attempt that DID publish notes is still a valid boundary -- the skip
is conditioned on missing notes, not on the date.
Closes: #37138
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EbgDBJuoBrpJxh5qLMPorL
release-qa-status carries a forked copy of listStandardReleaseTags and findPreviousTag with the identical bug, and cicd_6-release.yml calls it -- so on a multi-attempt day the QA status reported on one attempt while the changelog reported on another. Applies the same fix: skip drafts, carry hasNotes, walk back to the first documented release. Its eventual-consistency fallback (toTag not yet indexed) now also picks the newest *documented* tag rather than tags[0], which could otherwise be a failed earlier attempt. Adds a github.test.ts covering the same three cases as gather-release-data, so drift between the two copies fails a test instead of silently disagreeing. Found in review of #37140. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EbgDBJuoBrpJxh5qLMPorL
56b59c2 to
573f058
Compare
|
Addressed the duplicate-logic finding — it was a real bug, not just a consistency smell.
One thing beyond what the review flagged: that script's eventual-consistency fallback ( Rather than consolidate the two copies — separate npm packages, so sharing means new build wiring — I added On the non-blocking note about whitespace-only bodies: agreed, and it is intentional. Widening the range re-describes already-shipped commits, which is recoverable; narrowing it silently drops them, which is what shipped the wrong 26.08.19 changelog. Prefer the failure that is visible. |
Closes: #37138
Bottom of stack #37143. Independent of the two PRs above it.
Problem
findPreviousTag()returnedtags[idx + 1]unconditionally — the tag immediately preceding the target. On a day with more than one release attempt, that preceding tag is another attempt at the same release, whose pipeline died before writing notes. The changelog then covers one attempt instead of one release.This produced the 26.08.19-04 changelog: auto-detect resolved its predecessor to
v26.08.19-03, so the notes described 1 of 19 commits and published "contains internal maintenance only" for a release carrying Accessibility Studio, the Experiments portlet, three roles endpoints and nine fixes.Three fixes in the same two functions
listStandardReleaseTags()returns{ tag, hasNotes }and skips drafts.listReleasesreturns drafts first regardless of date, corrupting the newest-first ordering the docstring promises. Measured against the live API: 6 drafts currently matchSTANDARD_RELEASE_PATTERN, one duplicatesv26.04.11-02, and thev26.07.17-01/v26.07.27-01drafts shadow real releases.findPreviousTag()walks back to the first release with notes, so an undocumented attempt's commits stay inside the range instead of being stranded behind its tag.findIndexon tag equality replacesindexOf, which returned the first match for that duplicated tag.The skip is conditioned on missing notes, not on the date — a same-day attempt that did publish notes remains a valid boundary.
Verification
npx tsc --noEmitclean.npx jest35/35 passing, including three new cases: skips undocumented predecessors (the 26.08.19 shape), keeps a documented same-day attempt (26.08.12-02→26.08.12-01), and returns undefined when every predecessor is undocumented.Until this merges
Always pass
previous_tagexplicitly tocicd_ai-release-notes-backfill.yml. Never rely on auto-detect after a day with more than one attempt.🤖 Generated with Claude Code
https://claude.ai/code/session_01EbgDBJuoBrpJxh5qLMPorL
This PR fixes: #37138