Release publish gate#232
Merged
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.