-
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 with CI/CD pipeline #1385
Comments
ok. I guess |
it's hard to understand the purpose of but why do you bump the npm packages version (instead of just suffix with commit short sha1 ), and even default to a minor?
how am I supposed to link this npm package back to my git tag? what is purpose of this design? right. I got it. it basically says "I'm a release candidate for the next minor version" and hence the bump plus, the description is really misleading, as there is no tag created; the entire git is disabled for a |
Instead of rewriting |
thanks @evocateur for your reply. Here is my understanding
I think the issue can be easily fixed by putting |
we were quite shocked to know that lerna factor in work tree changes when doing comparison, and that might not be intended. |
@bochen2014 we solved this issue by only allowing people to merge to master using a jenkins job, and the jenkins job also auto-rebases the branch onto master before merging it (failing if there is a conflict) |
BREAKING CHANGE: * `--preid` now defaults to "alpha" during prereleases: The previous default for this option was undefined, which led to an awkward "1.0.1-0" result when passed to `semver.inc()`. The new default "alpha" yields a much more useful "1.0.1-alpha.0" result. Any previous prerelease ID will be preserved, just as it was before. * `--no-verify` is no longer passed to `git commit` by default, but controlled by the new `--commit-hooks` option: The previous behavior was too overzealous, and the new option operates exactly like the corresponding [npm version](https://docs.npmjs.com/cli/version#commit-hooks) option of the same name. As long as your pre-commit hooks are properly scoped to ignore changes in package.json files, this change should not affect you. If that is not the case, you may pass `--no-commit-hooks` to restore the previous behavior. Fixes #277 Fixes #936 Fixes #956 Fixes #961 Fixes #1056 Fixes #1118 Fixes #1385 Fixes #1483 Fixes #1494
BREAKING CHANGE: * `--preid` now defaults to "alpha" during prereleases: The previous default for this option was undefined, which led to an awkward "1.0.1-0" result when passed to `semver.inc()`. The new default "alpha" yields a much more useful "1.0.1-alpha.0" result. Any previous prerelease ID will be preserved, just as it was before. * `--no-verify` is no longer passed to `git commit` by default, but controlled by the new `--commit-hooks` option: The previous behavior was too overzealous, and the new option operates exactly like the corresponding [npm version](https://docs.npmjs.com/cli/version#commit-hooks) option of the same name. As long as your pre-commit hooks are properly scoped to ignore changes in package.json files, this change should not affect you. If that is not the case, you may pass `--no-commit-hooks` to restore the previous behavior. Fixes lerna#277 Fixes lerna#936 Fixes lerna#956 Fixes lerna#961 Fixes lerna#1056 Fixes lerna#1118 Fixes lerna#1385 Fixes lerna#1483 Fixes lerna#1494
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. |
introduction
We have a monorepo project comprised of 5 packages. We are using lerna to manage package versions, with independent strategy. Overall, apart from one particular big surprise, the experience with lerna is good.
our pipeline setup
5 developers work on different features, once their work is finished, code is merged into master, which will trigger a build in Bamboo. The bamboo build server will build the code, bump the version of changed packages and publish them into a private npm registry.
the problem
the problem happens when people merge their code into master while there is an active build in progress.
For example, lets say my project has
A@1.0.0
,B@1.0.0
andC@1.0.0
to begin with. Here is what happened (in time order)chore(A)
andfeat(B)
. Bamboo picked it up and starts build#1;feat(C)
andchore(A)
. This triggers another build#2. Now we have both build#1 and build#2 running at the same time;A@1.0.1
andB@1.1.0
; and successfully published them into npm registry. But when it tries togit push
all thosepackage.json
files andchangelog.md
s back, it failed because it doesn't contains latest change(due to developer B 's merge). So build#1 failed withA@1.0.1
andB@1.1.0
published into npm registry. No commits or tags were pushed to origin.C@1.1.0
,A@1.0.1
andB@1.1.0
(note here thatB
will be picked up as well because build#1 didn't push the new tags. even if it did, build#2 may not be able to see it due to timing condition). It successfully publishedC@1.1.0
but failed on publishingA@1.0.1
because that package already exists. So build#2 also failed withC@1.1.0
published. No commits or tags were pushed to origin.Now, imagine you sit in front a dev machine and do a
git pull
. All your localpackage.json
files are still statingA@1.0.0
,B@1.0.0
andC@1.0.0
, no new git tags introduced, but all 3 npm packages have been published. What do you do? 😵 😵 😱 😱possible solutions : disable concurrent builds in bamboo
you may think that by making bambo build sequential the problem may be solved. But it wont' help because build#1 still fails due to not having developer B 's merge. build#2 also will fail because build#1 didn't push its local commits&tags. so disabling concurrent build literally has no effect at all.
your solution
I do have a solution but it's not ideal and I would like to hear from others before I share it here.
I'm pretty sure i'm not alone, as it seems to be the standard use case of lerna. What is the official way of using lerna in a CI/CD pipeline??
The text was updated successfully, but these errors were encountered: