Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to force-publish canary for all packages in lerna v3 #1638

Closed
dotansimha opened this issue Aug 30, 2018 · 9 comments
Closed

Unable to force-publish canary for all packages in lerna v3 #1638

dotansimha opened this issue Aug 30, 2018 · 9 comments

Comments

@dotansimha
Copy link

dotansimha commented Aug 30, 2018

Since version 3, i'm unable to publish canary versions. It says that there are no git changes.

The log is:

$ lerna publish --force-publish="*" --canary --exact
lerna notice cli v3.2.1
lerna info canary enabled
lerna info Looking for changed packages since 1e07da5^..1e07da5
lerna success No changed packages to publish 

With 2.11.0 it works.

Expected Behavior

Should work the same?

Current Behavior

Publish does not work, and I couldn't find a way to bypass the changes check.

Possible Solution

Maybe it's related to a change in force-publish behaviour?

Steps to Reproduce (for bugs)

  1. `lerna publish --force-publish="*" --canary --exact
  2. Also tried with --ignore-changes="*" - it's still doesn't work...
lerna.json

{
  "lerna": "2.9.0",
  "version": "0.11.0",
  "npmClient": "yarn",
  "useWorkspaces": true
}

Your Environment

Executable Version
lerna --version 3.2.1
npm --version 6.4.0
yarn --version 1.9.4
node --version v9.11.1
OS Version
macOS High-Sierra 10.13.6 (17G65)
@evocateur
Copy link
Member

I'm not sure why you need to --force-publish --canary? Canary releases are already capable of deriving what is necessary to publish based on what changed in the previous release. It's designed to be run as a "nightly" build that runs on every commit pushed to master, for example.

@dotansimha
Copy link
Author

dotansimha commented Aug 31, 2018

@evocateur I'm trying to publish a canary version for all packages under the workspace (regardless of the changes in the packages). It worked in v2, but since v3 it's no longer works...

@wereHamster
Copy link

@evocateur I've run into a similar issue because changes outside of the individual package folders (repo-global typescript configuration for example) were not considered when lerna was checking if anything has changed since the last release. There is a lot outside of the package folders that has an influence on the resulting npm release. Examples include: the nodejs version, globally installed typescript, and even lerna itself! So it'd be nice if there was an easy way to force a canary build regardless of the git history that's affecting one particular folder. Ideally lerna would run everything up to creating the tgz and check if its checksum is different then the previous release on npmjs.com.

@evocateur
Copy link
Member

@dotansimha Yes, I realized that it's actually because we're not passing options.forcePublish to collect-updates anymore. It's kinda intentional? But I probably made the wrong choice. There's a lot of ambiguity in the history of the option.

I'm not entirely comfortable with where --canary is right now, conceptually. I'd like it to be more like semantic-release, with an option to propagate release tags etc back to the remote. And I'd really like to get away from any option that says "force" in it. Maybe --all is a better descriptor for the desired behavior?

@evocateur
Copy link
Member

@wereHamster Checksum diffing is way out of scope for Lerna itself. Since v3.2.0 there is support for a root postpack lifecycle that could conceivably run a script that finds all the packed tarballs at the root of package locations and checksum stuff then. You can't exactly change anything about the publish process then, except I guess mutating something in the tarball or exiting non-zero and halt the publish entirely.

Changes external to a package aren't the concern of lerna for the same reason they're not a concern of npm: there's literally no way to do that without specific domain knowledge of an individual environment/ecosystem.

@wereHamster
Copy link

@evocateur if reliable detection of changes is out of lerna's scope, it should provide a flag so that users can force the publishing. I'd like to publish "canary" releases on each push into my github repo (so that every commit is available for download from npmjs.com), regardless of whether lerna believes that a release is warranted or not.

@evocateur
Copy link
Member

@wereHamster Sure, fine. PRs accepted.

@dotansimha
Copy link
Author

Thanks! :D

@lock
Copy link

lock bot commented 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.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.