Skip to content

fix(scripts): accept -boon.N fork suffix in changelog packaging regex#34

Merged
insomnius merged 1 commit into
boonfrom
eng/package-changelog-boon-suffix
Jul 3, 2026
Merged

fix(scripts): accept -boon.N fork suffix in changelog packaging regex#34
insomnius merged 1 commit into
boonfrom
eng/package-changelog-boon-suffix

Conversation

@insomnius

@insomnius insomnius commented Jul 2, 2026

Copy link
Copy Markdown

What Problem This Solves

scripts/package-changelog.mjs rejects any -boon.N fork version with:

Error: Unsupported OpenClaw package version for changelog packaging: 2026.6.11-boon.1

RELEASE_HEADING_PATTERN and RELEASE_VERSION_PATTERN only accept -alpha.N / -beta.N prerelease suffixes plus the plain -N correction form. This blocks pnpm pack on every fork release.

Why This Change Was Made

Discovered while building the 2026.6.11-boon.1 tarball 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 future 6.x-boon.N (and later) releases can pnpm pack cleanly without ad-hoc edits.

Both RELEASE_HEADING_PATTERN and RELEASE_VERSION_PATTERN now include boon in the prerelease-shaped alternation. That regex arm accepts the <base>-<label>.<N> shape; it is not tied to prerelease semantics.

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, which resolves boon to channel: "stable"), not a prerelease. Keeping it out of PRERELEASE_VERSION_PATTERN preserves the prerelease-only fallback in resolvePackageChangelogVersions (which lets -alpha.N/-beta.N fall back to the base stable heading or Unreleased); boon versions resolve only to their own dedicated heading, matching how -N corrections already behave.

User Impact

  • Fork maintainers can pnpm pack on -boon.N builds without touching the script.
  • No behavior change for canonical -alpha.N / -beta.N / -N / plain YYYY.M.PATCH versions.

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).
  • Regression test added to test/scripts/package-changelog.test.ts covering the boon heading resolution and section extraction; existing alpha/beta/correction/stable cases unchanged.
  • Manual smoke via node -e against the modified module confirmed the four documented shapes plus rejection of a garbage version.

Related: #31.


Summary by cubic

Allow -boon.N fork versions in changelog packaging so pnpm pack works for boon releases without manual edits. Extends release parsing regex; prerelease handling stays the same.

  • Bug Fixes
    • Accept -boon.N in RELEASE_HEADING_PATTERN and RELEASE_VERSION_PATTERN in scripts/package-changelog.mjs.
    • Keep PRERELEASE_VERSION_PATTERN unchanged so boon versions are treated as stable and resolve only to their own heading.
    • Add tests for boon version resolution and section extraction.

Written for commit 2888011. Summary will update on new commits.

Review in cubic

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.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Re-trigger cubic

@insomnius

Copy link
Copy Markdown
Author

/cr

1 similar comment
@insomnius

Copy link
Copy Markdown
Author

/cr

@gandalfboon gandalfboon 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.

Approved. Verified the full diff live against the two patterns it actually touches.

  • Correct scope. RELEASE_HEADING_PATTERN + RELEASE_VERSION_PATTERN get alpha|beta -> alpha|beta|boon; PRERELEASE_VERSION_PATTERN is correctly left alone. -boon.N is authoritatively ranked channel: "stable" by OPENCLAW_BOON_FORK_VERSION_RE in src/infra/npm-registry-spec.ts (line 161), so adding boon to 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 base 2026.6.11 section), and extractCurrentPackageChangelog handles a ## 2026.6.11-boon.1 heading 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; the boon token 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.

@insomnius
insomnius merged commit a9e6c51 into boon Jul 3, 2026
123 of 124 checks passed
@insomnius
insomnius deleted the eng/package-changelog-boon-suffix branch July 3, 2026 11:13
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