Skip to content

Standing PR: edits to the release-notes region are discarded in sync releases without version.mainPackage #656

Closed

Description

@goosewobbler

Problem

With the preview-notes label on a standing PR, a human edit inside the notes region is meant to survive regeneration and become the GitHub Release text. In a sync release (the schema default) without version.mainPackage and without packageSpecificTags, it never does: every update regenerates the region over the edit, and publish ignores it. A side effect: because the edited region is never found, the LLM regenerates the notes on every update.

This repo runs exactly that configuration — #619's release-preview comment shows the changelog keyed monorepo beside the four packages.

Root cause (from reading the code)

The region is written and read back under different keys:

  1. Sync mode emits a single changelog keyed mainPkgName || 'monorepo' (packages/version/src/core/versionStrategies.ts:409-413).
  2. Notes key their output by changelog packageName (packages/notes/src/input/version-output.ts:30; packages/notes/src/core/pipeline.ts:573), so the region is rendered as <!-- releasekit-notes:monorepo --> (packages/release/src/standing-pr/standing-pr.ts:1416-1419 → renderNotesRegion).
  3. The update path reads edits back by the publishable package names — extractNotesRegions(liveBody, publishableUpdates(versionOutput).map((u) => u.packageName)) (standing-pr.ts:1337-1341) — which never include monorepo, so nothing is extracted and the fresh notes win. Publish reads edits the same way (standing-pr.ts:1851-1854).

Expected

An edit inside the sync release's notes region survives standing-pr update and is what publish puts in the GitHub Release — the same as for per-package regions.

Proposed fix

Read edits back under the keys the region was rendered with: derive the key set from the generated notes (or the version output's changelogs[].packageName) rather than publishableUpdates, on both the update and publish paths. Add a test with a sync VersionOutput whose changelog is keyed monorepo: an edited region survives an update and reaches the publish notes.

Workaround

None clean. Setting version.mainPackage re-keys the region to a publishable name, but it also narrows the sync changelog to commits that touch that package (versionStrategies.ts:161-166, commitParser.ts:195-201) while the bump still counts every commit — so release notes silently lose entries. Not recommended.

Found while reviewing #619, which documents the region.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions