fix(release): generate release notes against an explicit previous tag - #587
Closed
dcalhoun wants to merge 1 commit into
Closed
fix(release): generate release notes against an explicit previous tag#587dcalhoun wants to merge 1 commit into
dcalhoun wants to merge 1 commit into
Conversation
Release notes have restated every PR back to v0.16.0 since v0.17.1. GitHub infers the notes base by walking tags newest-to-oldest and taking the first whose commit is an ancestor of the one being released. Our release tags never satisfy that: each points at a Package.swift rewrite committed on a local release/vX.Y.Z branch that is never pushed, so no release tag is reachable from any other. GitHub falls back to v0.16.0 — the last tag that does sit on trunk, created before this flow existed. Resolve the base explicitly instead. set_github_release cannot express previous_tag_name, so call the generate-notes endpoint directly and pass the result through as `description`. The base is the most recent stable release older than the version being published; prereleases are skipped as candidates, matching GitHub's default. Resolution is also run in `validate`, before anything is published, so a wrong base surfaces while a re-run is still free. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
Superseded by #588. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Generated release notes restated every PR back to
v0.16.0on every release sincev0.17.1. This makes the release lane pass an explicit previous tag instead of letting GitHub infer one.The already-published notes have been regenerated separately (see below), so this PR is what stops the next release from reintroducing the problem.
Why?
Every GitHub Release from
v0.17.1throughv0.20.0-alpha.0listed months of already-shipped work —v0.20.0-alpha.0showed 24 PRs where only 3 were new — and all of them reportedcompare/v0.16.0....GitHub picks the notes base by walking tags newest-to-oldest and taking the first whose commit is an ancestor of the one being released. Our release tags never satisfy that.
publish_release_to_githubtags aPackage.swiftrewrite committed on a localrelease/vX.Y.Zbranch that is never pushed, so no release tag is reachable from any other:GitHub falls back to
v0.16.0and re-lists everything since. Releases beforev0.17.1were unaffected — they predate this tagging flow, so the inference worked.The off-trunk tag placement is deliberate and documented — it's what lets the tag carry a
Package.swiftpointing at the prebuilt XCFramework whiletrunkkeeps.local. This PR leaves that design alone and fixes the notes instead.How?
set_github_releasecan't expressprevious_tag_name(it only forwards agenerate_release_notesboolean), sogenerated_release_notescalls thereleases/generate-notesendpoint directly and passes the result through asdescription.previous_release_tagresolves the base as the most recent stable release older than the version being published. Prereleases are skipped as candidates, matching GitHub's default — a stable release reports everything since the last stable release, including work already listed in its own alphas.It reads the Releases API rather than local tags: CI checkouts may not have fetched every tag, the API reports
prereleaseauthoritatively rather than us inferring it from the tag name, and it ignores stray tags never published as releases (vtest-s3-xcframework-*).Resolution fails loudly if no base is found. A silently wrong base looks like a successful release and is only caught by someone reading the release page later.
validatealso resolves and logs the base. That step runs before anything is published, so a wrong base surfaces while a re-run is still free. It recomputes rather than threading the value through, because Buildkite runsvalidateas a separate step — separate agent, separate process, no sharedlane_context.Testing Instructions
The release lanes hard-fail outside CI, so this can't be exercised end to end locally. The first real proof is the next release.
Confirm the cause still holds — release tags are unreachable from
trunk, which is why the inference fails:Confirm every published release now chains to its immediate predecessor, with no gaps or repeats:
This is also the check worth re-running after the next release publishes — it is the invariant this PR is meant to preserve.
Review focus:
previous_release_tag's filtering and semver comparison. Cases verified against the live release list —v0.20.0-alpha.0 → v0.19.0,v0.20.0 → v0.19.0,v0.19.0 → v0.18.1,v0.18.0 → v0.17.2,v0.17.1 → v0.16.0,v1.0.0 → v0.19.0, plus both nil paths (no prior releases, prereleases only).Already-published notes
Regenerated ahead of this PR, oldest first, so the history reads correctly today rather than waiting on a merge:
v0.17.1v0.16.0v0.17.2v0.16.0v0.17.1v0.18.0v0.16.0v0.17.2v0.18.1v0.16.0v0.18.0v0.19.0-alpha.0v0.16.0v0.18.1v0.19.0v0.16.0v0.18.1v0.20.0-alpha.0v0.16.0v0.19.0Only the release
bodychanged — tags, assets, checksums, and prerelease flags are untouched, so nothing SPM consumers resolve is affected.Two judgment calls worth surfacing:
v0.18.1is now empty. Its range holds three commits, but.github/release.ymlfilters all of them: build(deps): Bump fastlane-plugin-wpmreleasetoolkit from 14.6.0 to 14.10.0 in the ruby-minor-and-patch group across 1 directory #548 (dependencies) and Update the buildkite "New Build" link #550 ([Type] Build Tooling) are excluded by config, and fix: stamp required version keys into GutenbergKitResources framework Info.plist #551 is labeled such that it drops out too despite being a realfix:. Left as-is rather than relabeling fix: stamp required version keys into GutenbergKitResources framework Info.plist #551 after the fact.releaselane from running locally #517 asby @mokagio with @Copilotwhere the original saidby @Copilot. Cosmetic, and more accurate, but it is a change beyond the compare ranges.