You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(release): decouple version bumps from release PRs (#893)
* fix(release): decouple version bumps from release PRs
Release PRs previously bumped package.json, Cargo.toml, and
package-lock.json, causing CI failures because the native prebuilt
binary didn't exist at the new version yet. Every release PR was
merged with red CI.
The publish workflow already handles version bumping atomically —
after building native binaries. This change:
- Removes version bumping from the /release skill (docs-only PRs)
- Skips npm test in publish preflight for stable releases (CI
already validated the code on the merged PR)
- Adds post-merge instructions to create a GitHub Release
New release flow:
1. /release creates docs-only PR (CHANGELOG, ROADMAP) → CI passes
2. Merge PR, create GitHub Release with tag
3. Publish workflow bumps versions, builds, publishes, pushes
version bump PR back to main
* fix: revert publish.yml test skip — not needed
The skill change (no version bumps in release PRs) is sufficient.
With package.json staying at the old version on main, preflight
tests pass naturally since both package.json and the prebuilt
native binary report the same version.
@@ -13,6 +13,8 @@ You are preparing a release for `@optave/codegraph`.
13
13
- If a version was provided (e.g. `3.1.1`), use it as the target version.
14
14
- If no version was provided (empty or blank `$ARGUMENTS`), you will auto-detect it in Step 1b.
15
15
16
+
**Important: this skill does NOT bump versions.** The publish workflow (`publish.yml`) handles version bumping in `package.json`, `Cargo.toml`, `package-lock.json`, and `optionalDependencies` atomically — after building native binaries and publishing to npm. Bumping versions in the release PR would cause CI failures because the native prebuilt binary wouldn't exist at the new version yet.
17
+
16
18
---
17
19
18
20
## Step 0: Isolate and sync
@@ -27,7 +29,7 @@ You are preparing a release for `@optave/codegraph`.
27
29
```bash
28
30
git checkout origin/main
29
31
```
30
-
Do **not** create the `release/VERSION` branch here — Step 8 creates it once VERSION is known.
32
+
Do **not** create the `release/VERSION` branch here — Step 7 creates it once VERSION is known.
31
33
32
34
## Step 1a: Gather context
33
35
@@ -69,18 +71,7 @@ Use the resolved version as `VERSION` for all subsequent steps.
69
71
70
72
If `$ARGUMENTS` was provided, use it directly as `VERSION`.
71
73
72
-
## Step 2: Bump version in package.json
73
-
74
-
Edit `package.json` to set `"version": "VERSION"`.
75
-
76
-
Also bump `crates/codegraph-core/Cargo.toml` — set the `version` field in `[package]` to match `VERSION`. This keeps the Rust crate version in sync with the npm package.
77
-
78
-
**Do NOT bump:**
79
-
-`optionalDependencies` versions — synced automatically by `scripts/sync-native-versions.ts` during the publish workflow
80
-
81
-
Then run `npm install --package-lock-only` to update `package-lock.json`.
82
-
83
-
## Step 3: Update CHANGELOG.md
74
+
## Step 2: Update CHANGELOG.md
84
75
85
76
The CHANGELOG doubles as **release notes** — it's what users see on the GitHub release page. Write it for humans, not machines.
86
77
@@ -116,7 +107,7 @@ Rules:
116
107
- Include a Performance section if there are performance improvements
117
108
- Read previous CHANGELOG entries to match the tone and detail level
@@ -126,7 +117,7 @@ Read `docs/roadmap/ROADMAP.md` and update:
126
117
- Add checklist items: `- ✅` for done, `- 🔲` for remaining
127
118
- Check actual code exists (glob/grep for new files/directories mentioned in PRs) before marking tasks complete
128
119
129
-
## Step 5: Update BACKLOG.md
120
+
## Step 4: Update BACKLOG.md
130
121
131
122
Read `docs/roadmap/BACKLOG.md` and check if any backlog items were completed or partially completed by commits in this release.
132
123
@@ -138,7 +129,7 @@ Read `docs/roadmap/BACKLOG.md` and check if any backlog items were completed or
138
129
- Check the "Depends on" column of other items — if they depended on the newly completed item, note that they are now unblocked
139
130
- Update the `Last updated` date at the top of the file
140
131
141
-
## Step 6: Update README.md
132
+
## Step 5: Update README.md
142
133
143
134
Read `README.md` and check if any new user-facing features from this release need to be documented:
144
135
@@ -154,79 +145,60 @@ Read `README.md` and check if any new user-facing features from this release nee
154
145
6.**Version references** — only update version-specific references (e.g., install commands). Historical milestone markers like "Complete (v3.0.0)" should stay as-is
155
146
7. If nothing user-facing changed (pure refactors, bug fixes, internal improvements), no README update is needed — **but still run the roadmap ordering cross-check (item 5)**
156
147
157
-
## Step 7: Verify package-lock.json
148
+
## Step 6: Verify`libc` fields in package-lock.json
158
149
159
-
Run `grep` to confirm the new version appears in `package-lock.json` and that all `@optave/codegraph-*` optional dependency entries are complete (have version, resolved, integrity, cpu, os fields). Flag any incomplete entries — they indicate an unpublished platform binary.
150
+
Some npm versions (notably v11+) silently strip the `libc` field from Linux entries in `package-lock.json`. Without `libc`, npm may install glibc binaries on musl systems (Alpine) and vice versa.
160
151
161
-
**Critical: verify `libc` fields on Linux entries.** Some npm versions (notably v11+) silently strip the `libc`field when regenerating the lock file via `npm install --package-lock-only`. Without `libc`, npm may install glibc binaries on musl systems (Alpine) and vice versa. Check:
152
+
Even though this skill does not bump versions, check that `libc`fields are present — they can go missing after any `npm install` run:
# Expected: 3 (one each for linux-arm64-gnu, linux-x64-gnu, linux-x64-musl)
156
+
# Expected: ≥3 (one each for linux-arm64-gnu, linux-x64-gnu, linux-x64-musl)
166
157
```
167
158
168
-
If the count is less than 3, manually restore the missing fields:
159
+
If the count is less than 3, restore the missing fields in a separate commit:
169
160
-`-gnu` packages: `"libc": ["glibc"]`
170
161
-`-musl` packages: `"libc": ["musl"]`
171
162
172
163
Place the `libc` array after the `cpu` array in each entry.
173
164
174
-
## Step 7b: Validate release config scripts
175
-
176
-
Verify that all script references in release-related config files point to files that actually exist. Broken references cause silent failures during `npm run release` or the publish workflow.
177
-
178
-
Check these files for script paths:
179
-
180
-
```bash
181
-
# .versionrc.json — check any "scripts" entries (runner and forwarded args)
- Redundant script entries that duplicate what npm lifecycle hooks already handle (remove them)
203
-
204
-
## Step 8: Create branch, commit, push, PR
165
+
## Step 7: Create branch, commit, push, PR
205
166
206
167
1. Create branch: `git checkout -b release/VERSION` (if on detached HEAD from Step 0, this creates the branch at the current commit)
207
-
2. Stage only the files you changed: `CHANGELOG.md`, `package.json`, `package-lock.json`, `docs/roadmap/ROADMAP.md`, `docs/roadmap/BACKLOG.md` if changed, `README.md` if changed
208
-
3. Commit: `chore: release vVERSION`
168
+
2. Stage only the files you changed: `CHANGELOG.md`, `docs/roadmap/ROADMAP.md`, `docs/roadmap/BACKLOG.md` if changed, `README.md` if changed, `package-lock.json` if libc fields were fixed
169
+
3. Commit: `docs: prepare release notes for vVERSION`
- Add CHANGELOG entry for all commits since previous release
176
+
- Add CHANGELOG entry for vVERSION (all commits since previous release)
217
177
- Update ROADMAP progress
218
178
179
+
**After merging:** create a GitHub Release with tag `vVERSION` to trigger the publish workflow, which handles version bumping, native binary builds, and npm publishing.
180
+
219
181
## Test plan
220
-
- [ ] `npm install` succeeds with updated lock file
221
182
- [ ] CHANGELOG renders correctly on GitHub
222
183
- [ ] ROADMAP checklist items match actual codebase state
223
184
EOF
224
185
)"
225
186
```
226
187
188
+
## Step 8: Post-merge instructions
189
+
190
+
After the PR is merged, remind the user:
191
+
192
+
> **Next step:** Go to GitHub → Releases → "Draft a new release" → tag `vVERSION` → target `main` → title `vVERSION` → auto-generate release notes or paste the CHANGELOG section → Publish.
193
+
>
194
+
> This triggers the publish workflow which will:
195
+
> 1. Build native binaries for all 6 platforms with the correct version
196
+
> 2. Publish platform packages and main package to npm
197
+
> 3. Push a version bump PR (`package.json`, `Cargo.toml`, `package-lock.json`) back to main
198
+
227
199
## Important reminders
228
200
201
+
-**No version bumps in this PR** — the publish workflow handles `package.json`, `Cargo.toml`, `package-lock.json`, and `optionalDependencies` atomically after building native binaries
229
202
-**No co-author lines** in commit messages
230
203
-**No Claude Code references** in commit messages or PR descriptions
231
-
- The publish workflow (`publish.yml`) handles: optionalDependencies version sync, npm publishing, git tagging, and the post-publish version bump PR
232
-
- If you find issues (incomplete lock entries, phantom packages), fix them in a separate commit with a descriptive message
204
+
- If you find `libc` field issues in package-lock.json, fix them in a separate commit with a descriptive message
0 commit comments