Repository navigation
Conversation
Move the git commit sha from the pre-release string of the semantic
version number to the build metadata string.
Git commit shas are not always valid pre-release strings according to
the Semantic Versioning Specification 2.0. For example, SemVer requires
that a numeric pre-release segment (a segment consisting of only
numbers) must not contain a leading zero. However, it's possible for
a git commit sha to be all numbers and for the first number to be zero.
The same rule does **not** apply to the build metadata string placed
after a `+` character. Therefore, to ensure the version contains git sha
information, but is still valid, we are moving the sha to the build
metadata string.
BREAKING CHANGE:
Git commit sha is now contained in the build metadata string of the
semantic version number.
So `1.1.0-alpha.81e3b443` now becomes `1.1.0-alpha+81e3b443` when you
run `lerna --canary`.
To increment the pre-release number after `alpha` please include it in
the string passed to the `--canary` flag:
```bash
lerna --canary=alpha.0
```
For convience, consider using the build number typically set in your
build environment by your CI platform:
```bash
lerna --canary=alpha.${BUILD_NUMBER}
```
Fixes #1118
|
@evocateur I'm not sure why most of those snapshots were updated. When I ran I understand why the My development environment is a Node 8 Docker container using the version of I also don't understand why What do I need to do to get a working local build, and one that plays nicely with Lerna's CI setup? Edit: Even a Docker Node 10 image does not work for me (same snapshot issues, and build failure): node@29c44ab42d4b:/app$ git --version
git version 2.1.4
node@29c44ab42d4b:/app$ npm --version
6.1.0
node@29c44ab42d4b:/app$ node --version
v10.6.0 |
evocateur
left a comment
There was a problem hiding this comment.
The vast majority of the snapshots should not have changed (nor the lockfile). I don’t work in a Docker container, so I can’t say what’s wrong. It works well enough in Travis, so it’s not containers generally...
|
There is a snapshot serializer that may need to be updated due to the version format change. I’m still not a huge fan of passing in the numeric bit of the release ID. I’m in the process of major refactoring in this area, FYI (splitting version command out of publish). |
|
v2.1.4 of git seems rather old, since the latest release is v2.17.x... |
I'll pull down the Travis CI docker image so that I can have a development environment with the proper tools.
I'll keep an eye out for that.
Me neither, but the next option was to use the For example, if However, that seemed like way too much complexity to introduce to address just this issue. Would your refactor provide something like that?
Not unheard of though. At my company we use Lerna 2.0 |
|
@evocateur @hbetts what needs to be done to get this merged and released? I currently cannot use Lerna canaries for my projects that publish to Artifactory which is quite unfortunate. |
|
@fenduru I need to update this change so that unrelated snapshots are not updated. That will require a little time to build out a custom Docker image to provide a compatible development environment. (Longer story is copied below) The other part of this is determining what @evocateur means by As known, most of the snapshots should not have changed. So, I spent this morning trying to get a reproducible development environment on my laptop. Using the official Therefore, to get a development environment that matches that of the core maintainer and their CI environment, I need to pull the Travis CI image. So, in addition to learning why However, Travis CI images do not contain Node, or any of the tooling needed to setup a Node development environment (such as Therefore, I'm going to need to build a Docker image off of the Travis CI image, and manually install the required version of Node I need for Lerna development. |
|
I was able to come up with a workaround for the time being: Which yields a version like |
|
I believe @evocateur's answer is effectively #1522 I'm closing this PR out because the underlying code has been rewritten by @evocateur. Furthermore, #1522 actually addresses this issue. |
|
@hbetts Thanks for all your contributions, they've been especially helpful lately! |
|
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. |
Move the git commit sha from the pre-release string of the semantic
version number to the build metadata string.
Git commit shas are not always valid pre-release strings according to
the Semantic Versioning Specification 2.0. For example, SemVer requires
that a numeric pre-release segment (a segment consisting of only
numbers) must not contain a leading zero. However, it's possible for
a git commit sha to be all numbers and for the first number to be zero.
The same rule does not apply to the build metadata string placed
after a
+character. Therefore, to ensure the version contains git shainformation, but is still valid, we are moving the sha to the build
metadata string.
BREAKING CHANGE:
Git commit sha is now contained in the build metadata string of the
semantic version number.
So
1.1.0-alpha.81e3b443now becomes1.1.0-alpha+81e3b443when yourun
lerna --canary.To increment the pre-release number after
alphaplease include it inthe string passed to the
--canaryflag:For convience, consider using the build number typically set in your
build environment by your CI platform:
lerna --canary=alpha.${BUILD_NUMBER}Fixes #1118
Description
Please see commit message.
Motivation and Context
Please see #1118.
How Has This Been Tested?
Please see snapshots.
Types of changes
Checklist:
npm. I used a Docker container, and you can't upgrade older versions ofnpmin Docker because of annpmbug.