-
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
chore: Use git describe correctly #2572
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a test to verify this, and I don't see any link to a reproduction that would otherwise suffice as a reason to change this. There are plenty of tests that validate the git describe
command as written works reasonably well.
What exactly are you trying to fix with this change?
@@ -10,6 +10,8 @@ module.exports.sync = sync; | |||
function getArgs(options, includeMergedTags) { | |||
let args = [ | |||
"describe", | |||
// return latest tag - otherwise the ref is incoorrect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "correct" you mean... detects broken tags that aren't properly annotated? There should be no situation in which Lerna itself creates release tags that are undetectable without the --tags
option here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have met similar issue.
I've release packages and tagged git tag via GitHub API from GitHub Actions.
The tag is lightweight(non-annotated) tag.
git describe
can not get lightweight(non-annotated) tag without --tags
flag.
Example repository used GitHub API for tagging git tag
https://github.com/azu/lerna-monorepo-github-actions-release
In this repository, git describe
show old git tag. (Probably, latest annotated git tag)
❯ git describe
v1.3.0-68-ge149829
❯ git describe --tags
v2.0.1-3-ge149829
As a result, lerna changed
show 1.3.0...latest
changes. (latest tag is 2.0.1)
It make lerna version --conventional-commits
always suggest major update.
To use git describe --tags
will fix this issue that I met.
bcc1d8a
to
d4b1b21
Compare
Lerna is using |
@evocateur Looks like there's about three different issues, each with a few people giving reasons why this PR is a necessary fix. The existing behavior of |
You should be able to get a repository into a state such that it needs this change simply by using |
When automatically detecting the next canary version with
lerna publish --canary
somehow lerna was not detecting the most recent canary version of the package or the packages automatically... This commit fixes it in this, but i dont know if something else breaks with this change.Types of changes
Checklist: