Skip to content

release: the notes validator accepts Upgrade notes that leave out a migration or the contract bump #5167

Closed

Description

@tale-code-bot

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 ## Highlights and 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:

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:

  1. List the migration files added between the two (git diff --name-only --diff-filter=A <previous> <candidate> -- services/platform/backend/db/migrations).

  2. Read API_CONTRACT_VERSION from services/platform/lib/shared/constants/api-contract.ts at both commits.

  3. Refuse the notes when ## Upgrade notes leaves 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.

  4. 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.Z on the candidate checkout (.github/RELEASING.md), so the comparison belongs in that run. It could take a --previous-tag option, or find the previous tag with git describe --tags --abbrev=0 <candidate>^ as release.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.
  • publish-packages.yml runs the validator with --source-root, and that must keep working.
  • Keep validateReleaseNotes as it is. Add the comparison as its own exported function, tested in tools/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) against v0.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.md and .github/release-notes/README.md say what the check enforces.

Refs #4970, #4785

Activity

  1. added
    agent-ready
    on Oct 30, 2026
  2. added a commit that references this issue on Oct 31, 2026
    08103ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions