Skip to content

fix(notes)!: validate version-output changelogs before mapping them - #759

Open
goosewobbler wants to merge 6 commits into
mainfrom
fix/620-notes-validate-version-output
Open

goosewobbler wants to merge 6 commits into
mainfrom
fix/620-notes-validate-version-output

Conversation

@goosewobbler

@goosewobbler goosewobbler commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

notes used to cast version-output JSON and throw a raw TypeError when a changelog was missing entries. It now validates the changelog array with the same Zod entry schema publish uses.

  • The schema lives in @releasekit/core/version-output-schema so publish and notes cannot drift.
  • Publish imports VersionOutputSchema from there. Notes validates changelogs only (the fields it reads) and raises InputValidationError (INPUT_VALIDATION_ERROR, exit code for bad input) with the field paths.
  • The standing-PR manifest schema in @releasekit/release imports VersionPackageChangelogSchema from there too, so @releasekit/publish no longer re-exports it (added in fix(release): read sync notes edits under the changelog key #761 for that one use).

Fixes #620

Breaking: releasekit notes rejects version output whose changelogs are missing required fields (entries, version, revisionRange, repoUrl, previousVersion) with INPUT_VALIDATION_ERROR and the input-error exit code, instead of failing with a TypeError. Output from version --json is unaffected.

Made with Cursor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the previous typed-caller issue is fixed.

Summary

Adds shared checks for version-output JSON before notes maps changelogs.

  • Notes checks changelogs before mapping them.

Reviews (3) · Last reviewed commit: "fix(notes): keep versionOutputToChangelo..." · Reviewed by Greptile

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Release Preview — v0.42.1 → v0.42.2

Note: Labels on this PR are advisory in standing-pr mode. Bumps come from conventional commits in the standing PR; override by editing labels on the standing PR itself. Add release:immediate to bypass the standing PR and release this PR directly.

Merging this PR will create a new release PR with the following changes:

Changelog

monorepo 0.42.1 → 0.42.2

Fixed

  • import the changelog schema from core (release)
  • pass validated changelogs without a cast (notes)
  • keep versionOutputToChangelogInput on VersionOutput (notes)
  • pass validated changelogs without a VersionOutput cast (notes)
  • validate version-output changelogs before mapping them (notes)

All packages → 0.42.2 (sync versioning)

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release

Updated automatically by ReleaseKit

@goosewobbler

Copy link
Copy Markdown
Owner Author

@greptile review

Co-authored-by: Cursor <cursoragent@cursor.com>
@goosewobbler

Copy link
Copy Markdown
Owner Author

@greptile review

Co-authored-by: Cursor <cursoragent@cursor.com>
@goosewobbler

Copy link
Copy Markdown
Owner Author

@greptile review

versionOutputToChangelogInput reads only `changelogs`, so it now takes
`Pick<VersionOutput, 'changelogs'>`. VersionOutput callers still type-check
and the validated data needs no `as unknown as` cast. The schema module
says why it's a separate entry point, and the notes error tests cover the
new error's code and exit code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@goosewobbler goosewobbler changed the title fix(notes): validate version-output changelogs before mapping them fix(notes)!: validate version-output changelogs before mapping them Oct 23, 2026
github-actions Bot and others added 2 commits October 24, 2026 05:12
…e-version-output

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#761 exported VersionPackageChangelogSchema from @releasekit/publish so
the standing-PR manifest schema could use it. This branch moves that
schema to @releasekit/core/version-output-schema, so release imports it
from there and publish no longer re-exports it. A publish re-export
would leave publish's bundled types pointing at the core subpath, which
isn't one of its dependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

notes: validate version-output input instead of casting it

1 participant