Skip to content

fix(sdk): enforce single source of truth for SDK package versioning #35109

@fmontes

Description

@fmontes

Description

The current SDK publishing workflow (deploy-javascript-sdk action) derives the version to publish by scanning all packages in core-web/libs/sdk/ and picking the highest latest and next dist-tags from NPM across all packages. This global versioning assumption breaks whenever packages drift out of sync.

Current problems:

  • @dotcms/react has next=1.2.6-next.3 while all others are at next=1.2.5-next.7
  • When the action calculates the next version, HIGHEST_NEXT=1.2.6-next.3 but HIGHEST_STABLE=1.2.5 — base mismatch causes the suffix to reset to .1, colliding with already-published 1.2.5-next.1
  • New packages (e.g. create-app) have no next tag yet, causing the same collision
  • ~150 lines of fragile version detection logic that still gets it wrong

Root cause: The system assumes global version sync but does not enforce it.

Acceptance Criteria

  • Add a single core-web/libs/sdk/VERSION file as the one source of truth for the SDK version
  • The deploy-javascript-sdk action reads the version from VERSION instead of scanning NPM dist-tags
  • The next tag suffix uses GITHUB_RUN_NUMBER instead of incrementing logic — guaranteed unique, no collision possible
  • New packages added to libs/sdk/ work automatically without manual version syncing
  • Version bumps are explicit git commits to VERSION (visible in history)
  • Remove the fragile version detection/calculation complexity from the action
  • cicd_manual-release-sdks.yml bumps the VERSION file instead of computing versions from NPM

Additional Context

Immediate trigger: adding @dotcms/create-app to the SDK libs caused repeated 403 publish failures because its package.json version (1.0.0) was out of sync with the rest (1.2.5), and the auto-detection logic could not recover gracefully.

Related fix already merged: #35107 (sync create-app to 1.2.5)

The next tag suffix collision happens because get_next_patch_number() resets to 1 when the base version changes, but does not check whether {base}-next.1 is already published on NPM.

Metadata

Metadata

Assignees

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions