-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
lerna publish --canary publishes broken packages #2060
Comments
Yeah, that definitely does seem broken. Part of the problem with "nightly" releases, at least as Lerna attempts them, is that CI often uses a shallow clone, which means in many cases the tags from the previous release literally aren't there. There are workarounds, of course. At a higher level, I think part of the problem with Theoretically, we have "better" coverage now. That being said, I'm positive there are big chunks missing. Awhile back I was hoping that |
I want to achieve essentially the same thing as @bimbiltu. I want changes in any pull request to be published as canary builds to dist-tag How can I achieve the desired behavior? Will the following work?
Alternatively, use |
@cspotcode You can't pass |
For me, it'd be ideal to have a mechanism for just adding The real one is, at least with private NPM repository based on JFrog Artifactory, that packages with version like I don't think it's the same problem as @bimbiltu described, but, well, it's about broken packages as well. |
@erykpiast Yeah, in retrospect using the |
The spec seems to say that anything after the plus does not count towards
precedence. However, I would think that if someone types out the full
version string, it should find that version exactly.
Is the problem that we cannot pass raw version strings to npm, because it
always interprets them as a "version range" or "version matcher" or
whatever it's called? Does using an equal sign help?
…On Tue, Dec 31, 2019, 12:55 PM Daniel Stockman ***@***.***> wrote:
@erykpiast <https://github.com/erykpiast> Yeah, in retrospect using the +
to append commit_hash was a mistake, as even the public registry
completely ignores it (it's allowed to, per the spec
<https://semver.org/#spec-item-10>).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2060?email_source=notifications&email_token=AAC35OESLYCMX4YA3Y3HZPTQ3OBPVA5CNFSM4HJFUDSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH4P56Q#issuecomment-569966330>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OCU75YGVWYPEDGESUTQ3OBPVANCNFSM4HJFUDSA>
.
|
Yes, true, the spec is only speaking to precedence there. In my manual testing, I found that attempting to publish version The version specifiers passed to npm commands are generally cleaned up by semver's |
Hi guys. I'm facing the same issue and unfortunately didn't get from this thread is there any other than dummy changes in last commit option to publish all changes --since default packages with canary release? I'm using lerna@3.13.2 but I can use more or less any |
@dimaShin The simple workaround is to just pass the If for some reason you don't want to publish all those extra packages you could also write a script that gets the intersection of |
@evocateur would you accept a PR that removes the lerna/commands/publish/index.js Line 365 in 3367257
|
@NMinhNguyen This is sorely needed. Right now we're using a hack to workaround this, but it's unpleasant:
Produces:
Where the trailing |
@jakewhelan you may wanna consider patching Lerna just for this bit via https://github.com/ds300/patch-package |
I didn't see [this option](lerna#2060 (comment)) documented anywhere and it proved very helpful for my use case! Feel free to add additional context to explain the flag.
Hi Folks 👋 You may or may not know that lerna is now under the stewardship of Nrwl (announcement here #3121), a company with a long history of not just producing valuable open-source software (OSS), but also backing others (at the time of writing, Nrwl has donated over $50,000 to OSS it hasn't created, see https://opencollective.com/nx for full details). Quite simply, Nrwl ❤️ OSS, and is committed to making lerna the best it can be. We use it ourselves. In order to take this awesome project forward from its current state, it is important that we focus our finite resources on what is most important to lerna users in 2022. With that in mind, we have identified this issue as being potentially stale due to its age and/or lack of recent activity. Next steps: We want to give you some time to read through this comment and take action per one of the steps outlined below, so for the next 14 days we will not make any further updates to this issue. @bimbiltu as the original author of this issue, we are looking to you to update us on the latest state of this as it relates to the latest version of lerna. Please choose one of the steps below, depending on what type of issue this is:
If we do not hear from @bimbiltu on this thread within the next 14 days, we will automatically close this issue. If you are another user impacted by this issue but it ends up being closed as part of this process, we still want to hear from you! Please simply head over to our new issue templates and fill out all the requested details on the template which applies to your situation: https://github.com/lerna/lerna/issues/new/choose Thank you all for being a part of this awesome community, we could not be more excited to help move things forward from here 🙏 🚀 |
Great to see lerna is getting a new maintainer! I've opened a PR with a reproducer for this lerna/repro#2 |
I didn't see [this option](lerna#2060 (comment)) documented anywhere and it proved very helpful for my use case! Feel free to add additional context to explain the flag.
Lerna uses '+${SHA}' in the package version but GitHub Packages ignores everything after the '+', which means the package version is always the same To fix this, we use a custom 'preid' that includes the SHA: lerna/lerna#2060 (comment) --force-publish is also used, to ensure every package is published on each commit
Lerna uses '+${SHA}' in the package version but GitHub Packages ignores everything after the '+', which means the package version is always the same To fix this, we use a custom 'preid' that includes the SHA: lerna/lerna#2060 (comment) --force-publish is also used, to ensure every package is published on each commit
Hey guys, I got the same issue here. Any solution? I was thinking to fetch the latest version according to the provided |
lerna publish --canary
only looks at HEAD to determine what packages changed. This means that a package can be published without correct dependencies if those dependencies were changed in an earlier commit. I believe that--canary
only operating on the HEAD commit is intentional, but I'm not sure how to achieve the "nightly release" behavior that this flag is supposed to provide.I read through a few issues about the
--canary
and this may be a duplicate but I decided to create a new issue to share my use case and describe the problems im running into.Expected Behavior
Every package published by
lerna publish --canary
should have dependencies that align with the state of the repo when the publish was run.Current Behavior
Since
lerna publish --canary
only looks at the HEAD for changes it can publish broken packages. For an example, see the "Steps to Reproduce" sectionPossible Solution
One solution of this could be to add
--changed
tolerna publish
like #962 suggestedAs a workaround I could use
--force-publish "*"
or try to replicate the--since
flag using--force-publish
andlerna list --since
. I could also stop using the--canary
flag but then I would lose its ability to automatically increment the-alpha.X
suffix.Steps to Reproduce (for bugs)
Do the following in a monorepo with package-a and package-b where package-a depends on package-b
lerna publish --canary
. lerna releasespackage-a@1.0.0-alpha.0
andpackage-b@1.0.0-alpha.0
.package-a
will depend onpackage-b@1.0.0-alpha.0
as expected.lerna publish --canary
. lerna releasespackage-a@1.0.0-alpha.1
that depends onpackage-b@1.0.0
.package-a
will be broken if it uses a feature introduced in a previous commit and therefore is only available in package-b's canarylerna.json
I was using a pretty basic config:
Context
I have a monorepo containing a few apps and libraries that are used by the apps. I want to run
lerna publish --canary
in CI for each commit to the master branch and a lot of the apps end up getting broken canaries as they are not using the correct versions of the libraries.Your Environment
lerna --version
npm --version
yarn --version
node --version
The text was updated successfully, but these errors were encountered: