Skip to content

Reintroduce next npm dist-tag for internal dev/QA testing on merge to main #36701

Description

@KevinDavilaDotCMS

Description

Follow-up to #36587/PR #36633 (date-lockstep SDK versioning), which removed the standalone @next prerelease channel entirely — SDK packages are now only published to the latest npm dist-tag, and only when a real dotCMS release is cut (cicd_release-sdk.yml, triggered by release: created). Nothing publishes to npm on a plain merge to main anymore.

This created a gap for internal QA: the team runs a post-merge QA phase against "real" environments, not local code (npm pack + .tgz install isn't usable there). Without a next channel, there's no installable, non-production SDK version to point those environments at between merges and the next real release cut.

This issue reintroduces a next npm dist-tag, published automatically on merge to main when SDK files change — but explicitly as an internal dev/QA-only channel, not a customer-facing one, and without reopening the "second door for an off-version SDK publish" concern ADR-0019 originally removed next to close. The latest/date-lockstep mechanism (real releases, MinSdkVersion, the compatibility handshake) is not touched at all by this change.

Naming scheme

The next version is computed at publish time — no local VERSION file is reintroduced:

  1. Query the currently-published latest version live from npm (e.g. npm view @dotcms/client version).
  2. Append -next.<github.run_number> (unique, monotonically increasing per workflow run).

Example: if latest is currently 26.3.17-1, a trunk run publishes 26.3.17-1-next.87. Verified with Node's semver package that this format is valid strict and loose semver — safe for npm publish.

Because this string always carries an explicit -next. prerelease suffix, it can never be mistaken for a real date-lockstep release version — and it's never something we tell customers to install.

Proposed changes

  1. deploy-javascript-sdk/action.yml — add a new optional input npm-tag (default 'latest'); use it in place of the currently hardcoded --tag latest in the publish step. Everything else in the action (build, per-package version rewrite, idempotency check) is reused unchanged for both tags.
  2. cicd_3-trunk.yml — re-add SDK-changed detection and a next-publish step:

Explicitly not touched

cicd_comp_deployment-phase.yml, cicd_release-sdk.yml, cicd_6-release.yml, cicd_comp_release-prepare-phase.yml, MinSdkVersion.java, SdkVersionWebInterceptor.java, and all SDK-compatibility-check TypeScript code (sdk-compatibility.ts and friends) — the real-release, date-lockstep, and version-handshake mechanisms are unaffected.

Why this doesn't reopen the ADR-0019 "second door" concern

  • next versions are never date-lockstep-shaped, so they can never satisfy or interfere with the one-dotCMS-version⇄one-SDK-version invariant, which only concerns latest.
  • The SDK's own compatibility check (sdk-compatibility.ts's parseVersionSegments/compareVersions) already fails open (returns null, no warning logged) on a version string like 26.3.17-1-next.87, since the next/run-number segments aren't plain integers — verified against the existing, unmodified parsing logic. No code change needed there for this safety property to hold.
  • next is purely an internal dev/QA convenience; it must never be documented or recommended to customers as an installable channel.

Acceptance Criteria

  • deploy-javascript-sdk/action.yml has a new optional npm-tag input (default latest), used in the publish step instead of the hardcoded value
  • cicd_3-trunk.yml computes a next version from the currently-published latest npm version + -next.<run_number> suffix, with no local VERSION file reintroduced
  • cicd_3-trunk.yml only publishes to next when SDK files changed (reusing the existing sdk_libs filter) and the run is not a manual workflow_dispatch
  • End-to-end verified: a real push to main with SDK changes results in a new @dotcms/client@<version>-next.<n> published under the next dist-tag, installable via npm install @dotcms/client@next
  • Confirmed no changes were needed to cicd_release-sdk.yml/cicd_6-release.yml/MinSdkVersion/SdkVersionWebInterceptor — the real-release/date-lockstep/compatibility-handshake mechanism remains fully untouched
  • Confirmed a locally-installed next SDK build does not trigger any false-positive/false-negative in the SDK compatibility check (fails open due to the unparsable version string)

Priority

Medium

Additional Context

Testing plan: mirror how #36587/PR #36633 was validated — implement and test first in the core-workflow-test fork (dry-run trigger, then a real trunk-style push with SDK changes) before applying the same changes to dotcms/core.

Out of scope:

References:

Metadata

Metadata

Type

No type

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions