Repository navigation
Closed
Description
Our canary builds broke after updating from 2.0.0 to 2.1.0, they now get stuck because lerna is asking our CI server to pick a version.
Expected Behavior
lerna publish --npm-client=npm --exact --loglevel silly --canary --yes --skip-git --skip-temp-tag "--registry" "https://REDACTED/artifactory/api/npm/npm-snapshot-local/"
lerna sill input [ 'publish' ]
lerna sill flags { _: [ 'publish' ],
lerna sill flags exact: true,
lerna sill flags yes: true,
lerna sill flags 'skip-git': true,
lerna sill flags skipGit: true,
lerna sill flags 'npm-client': 'npm',
lerna sill flags npmClient: 'npm',
lerna sill flags loglevel: 'silly',
lerna sill flags canary: true,
lerna sill flags c: true,
lerna sill flags 'skip-temp-tag': true,
lerna sill flags skipTempTag: true,
lerna sill flags registry: 'https://REDACTED/artifactory/api/npm/npm-snapshot-local/' }
lerna verb rootPath /REDACTED/master
lerna info version 2.0.0
lerna sill isInitialized
lerna sill isInitialized true
lerna sill existsSync /REDACTED/master/VERSION
lerna sill initialize attempt
lerna info canary enabled
lerna info current version 0.11.12
Current Behavior
lerna publish --npm-client=npm --exact --loglevel silly --canary --yes --skip-git --skip-temp-tag "--registry" "https://REDACTED/artifactory/api/npm/npm-snapshot-local/"
lerna sill input [ 'publish' ]
lerna sill flags { _: [ 'publish' ],
lerna sill flags exact: true,
lerna sill flags yes: true,
lerna sill flags 'skip-git': true,
lerna sill flags skipGit: true,
lerna sill flags 'npm-client': 'npm',
lerna sill flags npmClient: 'npm',
lerna sill flags loglevel: 'silly',
lerna sill flags canary: '',
lerna sill flags c: '',
lerna sill flags 'skip-temp-tag': true,
lerna sill flags skipTempTag: true,
lerna sill flags registry: 'https://REDACTED/artifactory/api/npm/npm-snapshot-local/' }
lerna verb rootPath /REDACTED/master
lerna info version 2.1.0
lerna sill isInitialized
lerna sill isInitialized true
lerna sill existsSync /REDACTED/master/VERSION
lerna sill initialize attempt
lerna info current version 0.11.12
Possible Solution
When I supply --canary --yes I should not be asked for a version.
Steps to Reproduce (for bugs)
- Run
lerna publish --canary --yes
lerna.json
{
"lerna": "2.0.0",
"packages": [
"packages/*"
],
"npmClient": "yarn",
"version": "0.11.12"
}Context
Your Environment
| Executable | Version |
|---|---|
lerna --version |
2.1.0 |
npm --version |
4.2.0 |
yarn --version |
0.27.5 |
node --version |
7.10.1 |
| OS | Version |
|---|---|
| Debian | Jessie |
Metadata
Metadata
Assignees
Labels
No labels
Activity
Jmsa commentedon Aug 26, 2017
I'm seeing this as well and tracked it back to the the addition of
type: stringin the "builder" definition inPublishCommand.js. It's linked to some proposed changes for #915 and apart of this commit 83aad8f.@tkissing-work It's hacky but (for me) one work around is to use
--canary=HEADinstead of--canary. Just be aware that since the canary flag is used in the version bumping that this will addHEADto new the version of a package. Example1.0.1 => 1.1.0-HEAD.8db8964f.@shawnbot & @evocateur - It seems like the issues stems from trying to use canary (in 2.1.0) as a both a string and a boolean. For some other builder options it looks like there defaults that get set. If the plan is keep using that pattern the following (might be missing steps) should work, right?
default: undefined...canary !== undefinedUpdatedPackagesCollector.collectUpdatedPackages()to look for undefined, but also to look at string length afterwards when deciding whether or not to useGitUtilities.getCurrentSHAevocateur commentedon Aug 26, 2017
@tkissing-work I'm really sorry for breaking this!
@Jmsa Thanks so much for the investigation, it's a big help.
I think it's pretty clear we need to reduce/remove the overloading of
--canaryas well as improve our tests to actually parse args with yargs instead of our synthetic constructor arguments. We have--preidand--since, after all, which should be documented as the preferred method of achieving--canary=<since>and--canary=<pre-release-id>.I'm going to start by restoring the default
lerna publish --canary --yesbehaviour ASAP, and then move toward fixing the other canary-related issues.evocateur commentedon Aug 27, 2017
Once I fixed the unit tests to use the yargs parser, the errors became very clear:
https://travis-ci.org/lerna/lerna/jobs/268804889#L1190
Inevitable One Line Fix
tkissing-work commentedon Aug 28, 2017
Thanks for the work-around tip @Jmsa and for the quick fix @evocateur
Bugs happen, it's the reaction to it that matters - and seeing more/better unit tests is the kind of reaction I like :)
evocateur commentedon Aug 29, 2017
This has been fixed in v2.1.1 :)
lock commentedon Dec 28, 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.