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): support aube-only checkouts without package-lock.json
After the aube migration in #91 the repo no longer ships a
`package-lock.json`, but `scripts/release-helpers.mjs` and
`scripts/release-prep.mjs` still hardcoded it as a required file:
- `readPackageVersions` did `readJsonFile('package-lock.json')`
unconditionally and failed with ENOENT on the current main.
- `assertPackageVersionsMatch` then asserted the lockfile's `version`
and `packages[""].version` matched `package.json.version`.
- `release-prep.mjs` froze `VERSION_FILE_PATHS` as
`['package.json', 'package-lock.json']` at module scope and staged
both, so even if the version-match assertion were relaxed, the
staging step would still fail because `package-lock.json` does not
exist.
The net effect was that `npm run release:prep` (and, by inheritance,
`npm run release:finalize`) failed end-to-end on `main`, blocking the
documented release flow. This change makes the lockfile path optional:
- `readPackageVersions` checks `existsSync('package-lock.json')`. When
present it still parses + returns the lockfile version fields;
otherwise it returns `hasPackageLock: false` with null lockfile
versions and only validates `package.json`.
- `assertPackageVersionsMatch` only runs the lockfile-coherence
assertions when `hasPackageLock` is true.
- `release-prep.mjs` computes the version-file allowlist at runtime
via `resolveVersionFilePaths(root)`. On an aube-only checkout this
resolves to `['package.json']`; on a checkout that still carries
`package-lock.json` it stays at `['package.json', 'package-lock.json']`,
preserving the prior behavior for downstream consumers that
re-introduce an npm lockfile.
`release-finalize.mjs` consumes `assertPackageVersionsMatch` and
inherits the fix without changes.
Tests
-----
`createTempRepo` / `writePackageFiles` gain an `includePackageLock`
option (default `true`), and two new integration test cases cover the
aube-only path:
- `prepares a release on an aube-only checkout (no package-lock.json)`
asserts the prep commit's diff is exactly `['package.json']` and
that `package.json.version` matches the requested release version.
- `finalizes on an aube-only checkout (no package-lock.json)` asserts
the annotated tag is created and pushed.
The pre-existing npm-lockfile test cases are unchanged and continue
to assert the two-file diff + readVersions triple.
All 27 release-scripts tests pass. Format, lint, and typecheck are
clean.
Docs
----
`docs/RELEASE-PROCESS.md` is updated so the changelog-mode prose and
the manual-prep fallback no longer claim that `package-lock.json` is
always part of the prep commit; the fallback snippets now stage
`package-lock.json` only when it actually exists.
Change-Id: Idfb4bbdde5d222c4f0f9096d650bbbc2f6d5f9c9
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@
26
26
27
27
- Default-location screenshot PNGs, snapshot JSON files, and `record export` artifacts are now rolled back when the subsequent artifact-manifest append fails, so a manifest-validation failure no longer leaves an orphaned, unmanifested file under the session's `artifacts/` directory. Explicit `--out` paths supplied by the caller are preserved on failure because they belong to the user, not the session manifest ([#95](https://github.com/coder/agent-tty/pull/95), fixes [#79](https://github.com/coder/agent-tty/issues/79)).
28
28
-`EventLog.open` now closes the underlying file handle when validation (size-limit check or existing-content parsing) fails, preventing a file-descriptor leak on rejected session host startup ([#51](https://github.com/coder/agent-tty/pull/51)).
29
+
-`npm run release:prep` and `npm run release:finalize` now work on aube-only checkouts where `package-lock.json` does not exist. `readPackageVersions` / `assertPackageVersionsMatch` skip the lockfile-coherence assertions when `package-lock.json` is absent, and `release-prep.mjs` stages only `package.json` in that case. The npm-lockfile path is still fully supported when a `package-lock.json` is present. Without this fix, the documented release flow was broken after the `aube` migration in [#91](https://github.com/coder/agent-tty/pull/91).
Copy file name to clipboardExpand all lines: docs/RELEASE-PROCESS.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ Versions containing a hyphen, such as `-beta.0` or `-rc.0`, are published by the
131
131
132
132
### Changelog mode
133
133
134
-
Use `--changelog ci` for the default maintainer path. The prep commit will contain only `package.json`and`package-lock.json`; the `Release Changelog` workflow will update `CHANGELOG.md` on the release branch when needed.
134
+
Use `--changelog ci` for the default maintainer path. The prep commit will contain only the version files — `package.json`plus`package-lock.json` when present (after PR #91 this repo uses `aube-lock.yaml` instead, so the prep commit on the default branch contains only `package.json`). The`Release Changelog` workflow will update `CHANGELOG.md` on the release branch when needed.
135
135
136
136
```bash
137
137
npm run release:prep -- --version <version> --changelog ci
@@ -174,12 +174,13 @@ and commits the resulting `CHANGELOG.md` update back to the release branch. When
174
174
175
175
### Manual prep fallback
176
176
177
-
If the scripted prep path is blocked, use the manual fallback only from a clean, up-to-date `main` checkout:
177
+
If the scripted prep path is blocked, use the manual fallback only from a clean, up-to-date `main` checkout. Stage `package-lock.json` only if your checkout still has one (post-PR #91 the repo is aube-only and the file is absent):
0 commit comments