You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Canary should have incrementing version numbers. #277
The canary feature is fantastic, however because it uses commit hashes instead of numbers, publishing a canary release with the same basic version number might require the wrong versions when using ^ for all the other package dependencies. Can we either overwrite the dependencies to require explicit canary versions OR properly version canaries so that newer canaries will always be installed over older ones? :)
Reacted by James Newell, Filipp Riabchun, Anton Kosyakov, danjef, Tom Yukhayev, Patrick Hulce, Sylvester Aswin and Hutson Betts
Also, it would be nice if I could select the next version. Right now it uses lerna.json which is the current version but I'd prefer to publish a canary for the next minor or patch release most of the time, so I have to manually edit lerna.json.
I just ran into this issue, where the "latest" version of a dep was chosen over the canary because the canary version was based on the last released version number not the "next" one.
If you're automatically building a canary from CI you don't want the prompting flow, so as long as there's still a way to publish a canary with the "next" version number without interactivity then that'd work for my use case.
changed the title [-]Canary should have incrementing version numbers.[/-][+][Feature] Canary should have incrementing version numbers.[/+]on Nov 16, 2016
We should either use incrementing part in canary version before hash, or substitute exact version for controlled packages without caret in front.
Now our canary builds are definetely broken, because users will get wrong dependencies versions :(
Reacted by Christian Alfoni, Tenor, Filipp Riabchun and Tom Yukhayev
Is there anything holding up a PR fixing these issues? I haven't looked at the Lerna codebase much but would be happy to make a PR a) supporting incrementing number releases and b) add support for specifying a next version.
I'm using Lerna + canary releases to great effect with Gatsby and am planning on automating canary releases on build passes (anyone doing this btw?) and these two changes would make that much nicer.
That doesn’t solve the issue with monorepos since two canaries that depend on each other without exact flag will break as soon as the next hash is higher on alphabetic order.
I was hoping to get around to proper incrementing with better git describe metadata, but implicit --exact sounds like a decent workaround for the time being.
Somewhat related, as reported in #915: --canary and --cd-version don't interact the way I expected them to. I think that if --canary --cd-version=patch didn't drop the meta suffix (-alpha.x) it might help with this issue.
@evocateur I don't know the whole flow around the --canary and why it uses the commit hash but wouldn't it make sense in order to avoid such issue to use Date.now() instead? as a version. it's always incremental and could avoid collision issues.
@alan-agius4Date.now() gives no authoritative information on the state of the tree when the publish was made. The hash is really intended as build metadata (and thus should be after the prerelease id and other dot-separated stuff, e.g. 1.0.4-alpha.0+deadbeef).
However, until we restore the gitHead property that normally appears in the package tarball's package.json after a "normal" npm publish, we need to keep it there to provide a breadcrumb back to the exact state that the canary version was published from. (gitHead is missing because .git isn't in process.cwd() when we run npm publish from lerna)
I'm very interested in getting this to work as currently our desired CI release flow cannot be covered with lerna. However, after playing around a bit I noticed that both 1.0.4-alpha.0+deadbeef and 1.0.4-alpha.0+sha.deadbeef are currently not accepted by the yarn registry.
Command failed: yarn publish --new-version 2.0.1-build.1519722155+61bd02c2 --tag test
warning package.json: No license field
warning package.json: No license field
error An unexpected error occurred: "https://registry.yarnpkg.com/@company%2fapp-2: New versions must be valid semver.".
On Feb 27, 2018, at 01:12, Pleun Vanderbauwhede ***@***.***> wrote:
I'm very interested in getting this to work as currently our desired CI release flow cannot be covered with lerna. However, after playing around a bit I noticed that both 1.0.4-alpha.0+deadbeef and 1.0.4-alpha.0+sha.deadbeef are currently not accepted by the yarn registry.
Command failed: yarn publish --new-version 2.0.1-build.1519722155+61bd02c2 --tag test
warning package.json: No license field
warning package.json: No license field
error An unexpected error occurred: ***@***.***%2fapp-2: New versions must be valid semver.".
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Activity
hzoo commentedon Jul 13, 2016
Ah good point.. didn't really think of that at the time..
cpojer commentedon Jul 13, 2016
Canary is super useful btw.
Also, it would be nice if I could select the next version. Right now it uses lerna.json which is the current version but I'd prefer to publish a canary for the next minor or patch release most of the time, so I have to manually edit lerna.json.
jamiebuilds commentedon Jul 13, 2016
Can we just follow the normal prompting for versions flow for canary?
marcins commentedon Oct 5, 2016
I just ran into this issue, where the "latest" version of a dep was chosen over the canary because the canary version was based on the last released version number not the "next" one.
If you're automatically building a canary from CI you don't want the prompting flow, so as long as there's still a way to publish a canary with the "next" version number without interactivity then that'd work for my use case.
tdreyno commentedon Nov 4, 2016
Bumping this again. This is so broken it hurts.
[-]Canary should have incrementing version numbers.[/-][+][Feature] Canary should have incrementing version numbers.[/+]Guria commentedon Nov 28, 2016
We should either use incrementing part in canary version before hash, or substitute exact version for controlled packages without caret in front.
Now our canary builds are definetely broken, because users will get wrong dependencies versions :(
L8D commentedon Dec 2, 2016
Can we please at least add a flag for using exact versions in published packages? It would even be useful for non-canary releases.
KyleAMathews commentedon Jan 22, 2017
Is there anything holding up a PR fixing these issues? I haven't looked at the Lerna codebase much but would be happy to make a PR a) supporting incrementing number releases and b) add support for specifying a next version.
I'm using Lerna + canary releases to great effect with Gatsby and am planning on automating canary releases on build passes (anyone doing this btw?) and these two changes would make that much nicer.
tdreyno commentedon Feb 10, 2017
@KyleAMathews That'd be great. I hacked it in to my local build: https://github.com/tdreyno/lerna/commit/5f743ca6e347347d6ebf477017f6cebc992c99f7
evocateur commentedon Feb 10, 2017
@tdreyno I'd say #426 covers your hacked-in change, since beta 33.
tdreyno commentedon Feb 14, 2017
Thanks @evocateur, I'll try it out!
ivosabev commentedon Apr 12, 2017
Same problem with
2.0.0-rc.02 remaining items
KyleAMathews commentedon May 18, 2017
For Gatsby I've been telling testers to just use "canary" for their package version.
gaearon commentedon May 18, 2017
That doesn’t solve the issue with monorepos since two canaries that depend on each other without
exactflag will break as soon as the next hash is higher on alphabetic order.KyleAMathews commentedon May 18, 2017
evocateur commentedon May 18, 2017
I was hoping to get around to proper incrementing with better
git describemetadata, but implicit--exactsounds like a decent workaround for the time being.shawnbot commentedon Jul 11, 2017
Somewhat related, as reported in #915:
--canaryand--cd-versiondon't interact the way I expected them to. I think that if--canary --cd-version=patchdidn't drop the meta suffix (-alpha.x) it might help with this issue.alan-agius4 commentedon Jan 18, 2018
@evocateur I don't know the whole flow around the
--canaryand why it uses the commit hash but wouldn't it make sense in order to avoid such issue to useDate.now()instead? as a version. it's always incremental and could avoid collision issues.evocateur commentedon Jan 18, 2018
@alan-agius4
Date.now()gives no authoritative information on the state of the tree when the publish was made. The hash is really intended as build metadata (and thus should be after the prerelease id and other dot-separated stuff, e.g.1.0.4-alpha.0+deadbeef).However, until we restore the
gitHeadproperty that normally appears in the package tarball's package.json after a "normal"npm publish, we need to keep it there to provide a breadcrumb back to the exact state that the canary version was published from. (gitHeadis missing because.gitisn't inprocess.cwd()when we runnpm publishfrom lerna)pleunv commentedon Feb 27, 2018
I'm very interested in getting this to work as currently our desired CI release flow cannot be covered with lerna. However, after playing around a bit I noticed that both
1.0.4-alpha.0+deadbeefand1.0.4-alpha.0+sha.deadbeefare currently not accepted by the yarn registry.According to https://semver.org/#spec-item-10 they definitely are valid semver versions.
npm publishwill go ahead and succeed, but will strip all additional meta (everything behind the+) from the published package's version.evocateur commentedon Feb 27, 2018
feat: Split `lerna version` from of `lerna publish` (#1522)
feat: Split `lerna version` from of `lerna publish` (lerna#1522)
lock commentedon Dec 27, 2018
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.