chore: pin exact versions for internal dependencies#283
Conversation
Configure lerna to use exact versions (no caret) for inter-package dependencies and add CI validation to enforce it. Changes: - Add `command.version.exact: true` to lerna.json - Remove caret from existing @datadog/flagging-core dependencies - Add scripts/internal-deps-validate.sh to catch version ranges - Add CI step to run the validation
| "version": "1.2.1", | ||
| "command": { | ||
| "version": { | ||
| "exact": true |
There was a problem hiding this comment.
👍 oh, I thinks that's why it converted references to carets in the last bump — I forgot --exact 😢
fwiw, I think this is the only change that we actually need. lerna will pin versions on the next release, so it doesn't matter what we currently have in package.json and ci validation is checking irrelevant code.
If you do want to keep validation, I'd put it in pre-release workflow instead, so it checks the source we attempt to release
There was a problem hiding this comment.
also, because we already published a version with caret dependencies, the safest move is to do a major bump, so that released version doesn't start picking up unmatched dependency versions
There was a problem hiding this comment.
lerna will pin versions on the next release, so it doesn't matter what we currently have in package.json
Removed the package.json changes in 5357491 we should see the version get pinned exactly when we run through the release process next time
ci validation is checking irrelevant code
Moved to the pre-release workflow in bc8b6cd
we already published a version with caret dependencies, the safest move is to do a major bump
A major bump makes sense. Safer to establish a clean baseline with exact pinning in 2.0.0
Motivation
Ensure consumers always get the tested combination of package versions rather than potentially mismatched versions due to semver ranges.
With caret (
^) versions, npm could resolve@datadog/flagging-core@^1.2.1to a newer version (e.g., 1.3.0) while@datadog/openfeature-browserwas built against 1.2.1, potentially causing subtle incompatibilities.Changes
command.version.exact: truetolerna.json- futureyarn releasewill use exact versions@datadog/flagging-coredependencies in browser and node-server packagesscripts/internal-deps-validate.sh- validates internal deps use exact versionsTest instructions
yarn release(dry-run) produces exact versions:Checklist