Skip to content

Release publish gate#232

Merged
lookinway merged 2 commits into
mainfrom
release-publish-gate
May 22, 2026
Merged

Release publish gate#232
lookinway merged 2 commits into
mainfrom
release-publish-gate

Conversation

@lookinway

Copy link
Copy Markdown
Collaborator

No description provided.

lookinway added 2 commits May 22, 2026 20:34
Publishing of CLI, n8n and generator now goes through scripts/check-release.mjs:
publish only when the version declared in apps/docs/data/releases.json is not
yet on npm, the version matches the library's format rule (CLI = CalVer
YYYY.M.patch, others = semver), is strictly greater than the latest published
version, the package code changed, and (CLI/n8n) the version is in the package's
own changelog. Idempotent npm publish (skip if already published) — no more
auto-bump that silently re-released identical code (CLI 5.5/5.6, generator
1.1.3/1.1.4). SDK is unchanged: its version comes from typespec.tsp and its
publish was already idempotent.

Also reconcile releases.json + cli changelog.json with what actually shipped:
add CLI 2026.5.6 (examples in `pachca api ... --describe` output). n8n/sdk are
already in sync; generator's extra patches lack a recoverable changelog and are
left as-is (the gate skips them since they're already on npm).
The gate accepted any version greater than npm-max, allowing skips
(1.1.4 → 1.1.6). Now the declared version must be the exact valid next step
per the library rule: semver patch+1 / minor+1.0 / major+1.0.0, or CalVer
patch+1 within the month / .0 in a later month — all relative to the highest
version actually on npm. On mismatch the gate prints the allowed versions
(e.g. generator after npm 1.1.4 → 1.1.5, 1.2.0 or 2.0.0).
@lookinway lookinway merged commit cbf49db into main May 22, 2026
10 checks passed
lookinway added a commit that referenced this pull request May 23, 2026
PR #232 (`cbf49dbf`, 2026-05-22) added version 2026.5.6 to
`packages/cli/src/data/changelog.json` and a matching entry to
`apps/docs/data/releases.json`, but the regenerated artefacts (the file the
generators produce from those sources) were not included:

  - packages/cli/CHANGELOG.md                        ← stale at 2026.5.4
  - apps/docs/public/updates.md                      ← missing 2026-05-21
  - apps/docs/public/updates/2026-05-21.md           ← missing entirely
  - apps/docs/public/updates/season/spring-2026.md   ← missing 2026-05-21

Production was unaffected because Docker build regenerates these on deploy,
but the committed copies in main are out of sync with their sources. A pre-
existing PR or local working tree picks up the drift on any `turbo build`,
which then leaks into unrelated PRs.

Bring repo state back in sync. Subsequent commit on this branch adds a CI
gate (`scripts/check-generated-sync.mjs`) so the same drift can't recur.
lookinway added a commit that referenced this pull request May 23, 2026
PR #232 added version 2026.5.6 to changelog.json + releases.json but did
not include the regenerated CHANGELOG.md / public/updates/2026-05-21.md /
season/spring-2026.md / AGENTS.md. Production wasn't affected (Docker
build regenerates on deploy), but unrelated branches that touch any of
those files inherit the drift as a phantom diff on `turbo build`.

Existing gates miss this: `check-changelog-sync.mjs` only checks that
code-changes and changelog-entries are paired, not that generated files
are up to date with their sources. `check-release.mjs` only decides
whether to publish.

New gate: `scripts/check-generated-sync.mjs` runs `bun turbo build` and
asserts that no tracked path under the well-known generated globs ends
up modified or untracked. If anything drifts, it lists the files and
explains how to fix.

Wiring:
  - package.json:   `bun run check:generated`
  - check.yml:      runs after `bun turbo check` with CI=1
  - locally:        no-ops unless --force or CI is set (full rebuild)

Validated by inducing a drift (sed on CHANGELOG.md → turbo build
regenerated to 2026.5.6, then caught the orthogonal AGENTS.md drift
that motivated the previous commit).
lookinway added a commit that referenced this pull request May 23, 2026
`check-changelog-sync.mjs` previously counted ANY change to a package's
own changelog files as «changelog written» — including `packages/cli/CHANGELOG.md`,
which is regenerated from `changelog.json` by patch-manifest.js on every
build. That created a deadlock around the drift left by PR #232 (which
landed 48 minutes before this gate did): any PR that brought `CHANGELOG.md`
back in sync with the existing `changelog.json` would be rejected for
«changelog updated but no code change», even though no new release was
being declared.

Split the package config into:
  - ownChangelogs    — excluded from code-change detection (unchanged)
  - sourceChangelogs — source-of-truth files; a diff here declares a release

For the CLI: `changelog.json` is the source, `CHANGELOG.md` is generated.
For n8n: `CHANGELOG.md` is the source (no separate JSON).
Generator/SDK: no own changelogs — use releases.json only (unchanged).

The other gate added in this branch (`check-generated-sync`) catches any
manual edit to a generated changelog that drifts from its source, so this
relaxation doesn't open a hole — the two gates compose.
@lookinway lookinway deleted the release-publish-gate branch May 24, 2026 15:01
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.

1 participant