fix(sdk): enforce single source of truth for SDK package versioning#35110
fix(sdk): enforce single source of truth for SDK package versioning#35110
Conversation
…35109) - Add core-web/libs/sdk/VERSION as the single version source - Replace ~150 lines of fragile NPM-scanning version detection with a simple read from VERSION file - Use GITHUB_RUN_NUMBER as next tag suffix — guaranteed unique, no collision - Manual release workflow now bumps VERSION file and commits it to git - New packages added to libs/sdk/ work automatically without manual sync Fixes recurring 403 publish failures caused by packages drifting out of version sync (e.g. react at 1.2.6-next.3 while others at 1.2.5-next.7). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @fmontes's task in 2m 6s —— View job PR Review
SummaryThe simplification is welcome and the core idea is sound, but there is one critical logic bug and a few other issues worth addressing before merging. Critical: Double-Increment in Manual Release
The manual workflow:
The deploy action then:
Result: git has The fix is to either pass Significant:
|
|
Architectural concern: VERSION file on main vs release branch pattern The dotCMS release model keeps main versionless and deterministic:
This PR introduces
Alternative (aligned with existing model):
This is a design question, not a blocker — there may be good reasons the SDK model needs to differ from Maven. But worth a deliberate decision rather than drifting into a different pattern. Also from the automated review:
|
What
Replaces the SDK publish action's version detection logic with a single
VERSIONfile atcore-web/libs/sdk/VERSION.Why
The old system scanned NPM dist-tags across all packages at publish time and picked the highest version globally. This broke in two ways:
@dotcms/reacthadnext=1.2.6-next.3while all others were atnext=1.2.5-next.7. The base version mismatch caused the suffix counter to reset to.1, colliding with an already-published version → 403 on every trunk run.create-appwithversion=1.0.0in itspackage.jsontriggered the same collision because it had never been published and the action couldn't reconcile its version with the rest.Changes
core-web/libs/sdk/VERSION— new file, set to1.2.6(current highest published stable). This is the single source of truth.deploy-javascript-sdk/action.yml— removed ~150 lines of NPM-scanning/version-calculation logic. Now reads fromVERSION, calculates next version in ~30 lines. Thenexttag suffix usesGITHUB_RUN_NUMBERinstead of an incrementing counter — unique by definition, no collision possible.cicd_manual-release-sdks.yml— bumpsVERSIONfile and commits it to git before publishing. Version bumps are now visible in git history.Result
libs/sdk/works automatically — no manual version syncing needed.nexttag will never collide with an existing published version.Closes #35109