fix(scripts): accept -boon.N fork suffix in changelog packaging regex#34
Merged
Conversation
RELEASE_HEADING_PATTERN and RELEASE_VERSION_PATTERN in scripts/package-changelog.mjs only accept -alpha.N / -beta.N prerelease suffixes; `pnpm pack` on a -boon.N build fails with "Unsupported OpenClaw package version for changelog packaging: <version>". PRERELEASE_VERSION_PATTERN is intentionally left alone -- a -boon.N release is ranked as a stable correction of the base version (see src/infra/npm-registry-spec.ts OPENCLAW_BOON_FORK_VERSION_RE), not a prerelease. Discovered while building the 2026.6.11-boon.1 tarball for PR #31; hot-patched locally at the time, made permanent here.
Author
|
/cr |
1 similar comment
Author
|
/cr |
There was a problem hiding this comment.
Approved. Verified the full diff live against the two patterns it actually touches.
- Correct scope.
RELEASE_HEADING_PATTERN+RELEASE_VERSION_PATTERNgetalpha|beta->alpha|beta|boon;PRERELEASE_VERSION_PATTERNis correctly left alone.-boon.Nis authoritatively rankedchannel: "stable"byOPENCLAW_BOON_FORK_VERSION_REinsrc/infra/npm-registry-spec.ts(line 161), so addingboonto the prerelease pattern would have misclassified a stable fork build as a prerelease. Leaving it out is the right call, and the inline comment cites the source of truth. - Tests cover both paths.
resolvePackageChangelogVersions("2026.6.11-boon.1")-> self-only (confirms it does not fold into the base2026.6.11section), andextractCurrentPackageChangeloghandles a## 2026.6.11-boon.1heading end-to-end. Good boundary coverage for the exact bug that broke the PR #31 tarball. - No regressions. The
-[1-9][0-9]*bare-suffix alternation is untouched; theboontoken only extends the labelled-prerelease branch. CI fully green (30/30 checks). Signed, ruleset-friendly.
Durable fix for the pack failure you hot-patched during PR #31. Ship it and go run the canary.
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.
What Problem This Solves
scripts/package-changelog.mjsrejects any-boon.Nfork version with:RELEASE_HEADING_PATTERNandRELEASE_VERSION_PATTERNonly accept-alpha.N/-beta.Nprerelease suffixes plus the plain-Ncorrection form. This blockspnpm packon every fork release.Why This Change Was Made
Discovered while building the
2026.6.11-boon.1tarball for #31. The regex was hot-patched locally to unblock the release; that patch was reverted after upload. This PR makes the fix permanent so future6.x-boon.N(and later) releases canpnpm packcleanly without ad-hoc edits.Both
RELEASE_HEADING_PATTERNandRELEASE_VERSION_PATTERNnow includeboonin the prerelease-shaped alternation. That regex arm accepts the<base>-<label>.<N>shape; it is not tied to prerelease semantics.PRERELEASE_VERSION_PATTERNis intentionally left alone. A-boon.Nrelease is ranked as a stable correction of the base version (seesrc/infra/npm-registry-spec.tsOPENCLAW_BOON_FORK_VERSION_RE, which resolves boon tochannel: "stable"), not a prerelease. Keeping it out ofPRERELEASE_VERSION_PATTERNpreserves the prerelease-only fallback inresolvePackageChangelogVersions(which lets-alpha.N/-beta.Nfall back to the base stable heading orUnreleased); boon versions resolve only to their own dedicated heading, matching how-Ncorrections already behave.User Impact
pnpm packon-boon.Nbuilds without touching the script.-alpha.N/-beta.N/-N/ plainYYYY.M.PATCHversions.Evidence
resolvePackageChangelogVersions("2026.6.11-boon.1")returns["2026.6.11-boon.1"](single heading, stable-shaped) and no longer throws.resolvePackageChangelogVersions("2026.5.28-beta.1")still returns["2026.5.28-beta.1", "2026.5.28", "Unreleased"](prerelease fallback intact).test/scripts/package-changelog.test.tscovering the boon heading resolution and section extraction; existing alpha/beta/correction/stable cases unchanged.node -eagainst the modified module confirmed the four documented shapes plus rejection of a garbage version.Related: #31.
Summary by cubic
Allow
-boon.Nfork versions in changelog packaging sopnpm packworks for boon releases without manual edits. Extends release parsing regex; prerelease handling stays the same.-boon.NinRELEASE_HEADING_PATTERNandRELEASE_VERSION_PATTERNinscripts/package-changelog.mjs.PRERELEASE_VERSION_PATTERNunchanged so boon versions are treated as stable and resolve only to their own heading.Written for commit 2888011. Summary will update on new commits.