Repository navigation
Description
Split off #4970 (its option 4), as the triage of that issue decided (TALE-199).
Problem
tools/cli/scripts/release-notes.ts checks only the shape of .github/release-notes/vX.Y.Z.md:
- one
## Highlightsand one## Upgrade notes; - authored text in both, with no TODO or TBD;
- Highlights first.
It never reads what the release contains, so notes that contradict the release pass:
- docs(release): the v0.5.89 notes claim no migration or configuration change and leave out that coding-agent sign-in is now on by default #4970: the v0.5.89 notes said "no database migration or manual configuration change is needed". Yet
v0.5.88..v0.5.89addsservices/platform/backend/db/migrations/0204_usage_ledger_provider.sqland movesAPI_CONTRACT_VERSIONfrom3.43.0to3.44.0. - docs(release): published v0.5.83 notes name the wrong migrations, re-announce #4608 and describe the internal agent fleet #4785: the v0.5.83 notes name migrations
0168and0194. Yet0168already shipped in v0.5.82, and v0.5.83 adds twelve others.
The "Guard" section of #4785 asks for this migration comparison. This issue carries it, plus the contract version. That guard's other check, refusing a cited pull request already in the previous tag, stays with #4785.
What the check does
Given the previous release tag and the candidate commit:
-
List the migration files added between the two (
git diff --name-only --diff-filter=A <previous> <candidate> -- services/platform/backend/db/migrations). -
Read
API_CONTRACT_VERSIONfromservices/platform/lib/shared/constants/api-contract.tsat both commits. -
Refuse the notes when
## Upgrade notesleaves out either of these:- an added migration, named by its file name;
- the candidate's contract version, when it changed.
Naming a migration of an earlier release is not an error by itself: the v0.5.88 notes do so to correct the v0.5.87 notes.
-
Name what is missing in the error, for example
Upgrade notes do not name migration 0204_usage_ledger_provider.sql, added since v0.5.88.
Constraints
- It has to refuse before the tag. A refusal after the tag costs the version.
.github/RELEASING.md("Release-note validation fails") keeps a tag pushed without valid notes and releases the corrected notes under the next version. - Where it runs.
- Maintainers check the notes before tagging with
bun tools/cli/scripts/release-notes.ts --version vX.Y.Zon the candidate checkout (.github/RELEASING.md), so the comparison belongs in that run. It could take a--previous-tagoption, or find the previous tag withgit describe --tags --abbrev=0 <candidate>^asrelease.yml's "Describe API contract changes" step does. - Prepare checks the notes again with a sparse checkout that has no history ("Checkout release notes", "Validate authored release notes before building"). Follow-ups from the #4134 review: publish-packages pins package tags for a version whose Release fails the notes gate, and Prepare's 3-minute full checkout #4153 removed its slow full checkout, so do not bring it back. If Prepare runs the comparison too, it fetches only the two commits the comparison needs.
- Maintainers check the notes before tagging with
publish-packages.ymlruns the validator with--source-root, and that must keep working.- Keep
validateReleaseNotesas it is. Add the comparison as its own exported function, tested intools/cli/scripts/release-notes.test.ts. - Published notes are history: the check applies to the candidate's own notes only.
Done when
- The validator refuses a candidate whose Upgrade notes leave out a migration added since the previous tag or a changed contract version, and its error names what is missing.
- It accepts the corrected
.github/release-notes/v0.5.89.md(TALE-199) againstv0.5.88. - Tests cover:
- no migration;
- a migration that is named;
- a migration that is missing;
- an earlier release's migration that is named;
- an unchanged contract;
- a changed contract, both named and not named.
.github/RELEASING.mdand.github/release-notes/README.mdsay what the check enforces.
Activity
fix: refuse release notes that leave out a migration or contract bump