Canary published version does NOT have commit sha
See original GitHub issueCanary publish doesn’t generate unique version number with commit sha.
Expected Behavior
According to the doc, lerna publish --canary --dist-tag=alpha
should release alpha version with commit sha in it. Suppose current package verison is 0.1.4
and commit version is 3d6bee55
, then the canary release version should be foo@0.1.5-alpha.3d6bee55
. This is to ensure each canary build is unique.
Current Behavior
The console output is like below. Note there is a 124+
(which may vary for differnt commit) ahead of the commit sha.
Successfully published:
- foo@0.1.5-alpha.124+3d6bee55
lerna success published 1 package
The canary publish actually published foo@0.1.5-alpha.124
instead of foo@0.1.5-alpha.124+3d6bee55
. The commit sha is not included. The 124
number looks like commit count but I’m not sure. Anyway, this makes canary release version not unique.
Steps to Reproduce (for bugs)
It is reproduced in lerna v3.4.3 and v3.10.7 with below command.
lerna publish --canary --npm-tag=alpha
Context
Our CI/CD system have a automatic canary build for each development branch. Since multiple developers might work based off same trunk branch, it is highly possible that automatic canary build fail due to version conflict with other development branches. It is mandatory to have each canary build have a unqiue npm version.
Your Environment
Executable | Version |
---|---|
lerna --version |
3.4.3 & 3.10.7 |
npm --version |
6.4.1 |
node --version |
8.12.0 |
OS | Version |
---|---|
MacOS | 10.13.6 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:14 (1 by maintainers)
👍 it would be nice to be able to change
+
to.
so npm does not strip that out.Hi @anicholls @constantin-v I just found the same issue releasing my canaries per PR build. I want to release all the packages per PR build and for that I use:
This was working well in v2 because the hash was appended with a dot:
The issue I’ve is when someone adds some changes on the PR the version released sent to the registry is:
The first time this is run on the CI works well because this version doesn’t exist yet, but with the next commit on the PR the CI run again the same command and this fails because the package already exist on the registry.
I’ve solved that with:
But I don’t think is a good solution. Any idea how I can move forward?
Thank you in advance