Skip to content

chore: enforce version sync in release workflows - #11

Merged
sf-jin-ku merged 1 commit into
mainfrom
jin/version-sync-main
Apr 6, 2026
Merged

chore: enforce version sync in release workflows#11
sf-jin-ku merged 1 commit into
mainfrom
jin/version-sync-main

Conversation

@sf-jin-ku

Copy link
Copy Markdown
Contributor

Summary

This adds a hard version-sync guarantee between package.json and .codex-plugin/plugin.json so release packaging cannot drift.

Changes

  • add shared version-sync helpers and CLI scripts
  • sync the plugin manifest in the npm version lifecycle
  • fail CI, publish, and prepack when manifest versions diverge
  • add regression coverage for mismatch detection and sync behavior

Verification

  • npm run check:version-sync
  • node --test tests/version-sync.test.mjs
  • npm pack --dry-run

@sf-jin-ku
sf-jin-ku merged commit 6c81eb3 into main Apr 6, 2026
3 checks passed
@sf-jin-ku
sf-jin-ku deleted the jin/version-sync-main branch April 6, 2026 01:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fcdd92186e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
"uninstall:codex": "node scripts/installer-cli.mjs uninstall",
"update:codex": "node scripts/installer-cli.mjs update"
"update:codex": "node scripts/installer-cli.mjs update",
"version": "npm run sync:plugin-version && npm run check:version-sync"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stage plugin manifest in npm version lifecycle

The new version lifecycle script updates .codex-plugin/plugin.json but never stages it, so npm version will create a commit/tag that bumps package.json while leaving the plugin manifest change unstaged. npm's own command docs (.../npm/docs/content/commands/npm-version.md, lifecycle steps 2/4) state files changed by lifecycle scripts must be explicitly added with git add; without that, a normal npm version patch release flow can produce a tagged commit that immediately fails check:version-sync in CI/publish.

Useful? React with 👍 / 👎.


describe("version sync", () => {
it("asserts the live repo versions match", () => {
assert.equal(assertVersionsMatch(), "1.0.0");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove hardcoded repo version from sync test

This test locks the expected live version to 1.0.0, so any legitimate future version bump (for example to 1.0.1) will fail even when package.json and .codex-plugin/plugin.json are correctly synchronized. Because npm run test is part of the required checks, every release version change will require touching this test or CI will break.

Useful? React with 👍 / 👎.

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