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
Use --canary=<value> as prerelease tag, not commit-ish #1020
Conversation
Hmm, the appveyor builds seem to fail in different ways each time, none of which seem to be related to my changes. |
@achingbrain was going to work on this myself but glad to see you got this. Additionally, I wanted to raise a concern with the lerna maintainers about the role that the |
I see what you mean. That said canary works well for my current project which requires per-commit automated CI deployment for internal testing with a manual public release gate. @evocateur any thoughts on this PR? |
I appreciate the PR, @achingbrain. I am not generally a fan of "polymorphic" options that we inherited from the more lenient
|
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.
Thanks for your patience, @achingbrain, just a few small fixes and we can get this merged.
test/UpdatedPackagesCollector.js
Outdated
const repository = { | ||
rootPath: 'root-path' | ||
}; | ||
|
||
describe("UpdatedPackagesCollector", () => { | ||
it("should exist", () => { | ||
expect(UpdatedPackagesCollector).toBeDefined(); | ||
}); | ||
|
||
it("needs better tests"); |
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.
It now has them, thank you! (you can delete this empty test case, if you want)
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.
Heh, I left that in because I agree with the sentiment 😉
Will remove.
@@ -13,6 +13,9 @@ import loadPkgManifests from "../helpers/loadPkgManifests"; | |||
const lastCommitMessage = (cwd) => | |||
execa.stdout("git", ["log", "-1", "--format=%B"], { cwd }).then(normalizeNewline); | |||
|
|||
const lastCommitId = (cwd) => | |||
execa.stdout("git", ["rev-parse", "HEAD"], { cwd }).then((line) => line.trim().substring(0, 8)); |
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 thought execa
automatically trimmed stdout
?
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.
Removed
const { stdout, stderr } = await execa(LERNA_BIN, args, { cwd }); | ||
const hash = await lastCommitId(cwd); | ||
expect(stdout.replace(new RegExp(hash, 'g'), 'hash')).toMatchSnapshot("stdout: canary default version"); | ||
expect(stderr).toMatchSnapshot("stderr: canary beta version"); |
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.
This snapshot label should be stderr: canary default version
, looks like copy+paste oversight.
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.
Fixed
@evocateur I've made the changes as requested, is there anything else that needs doing before this can be merged? Thanks.. |
@achingbrain Thanks! |
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. |
Description
The docs say we should be able to override the meta suffix by passing the canary flag as a string value. lerna takes this value and tries to use it to work out what range of commits it should consider when publishing a package so you can't actually override the meta suffix unless you use a commit id to do this. Considering the commit id is added to the version number for canary releases anyway this seems redundant.
eg:
This works:
According to the docs this should work but doesn't:
Motivation and Context
It would be useful to be able to override the meta suffix as described in the docs.
Fixes #1008.
How Has This Been Tested?
Added some unit tests for the
UpdatedPackagesCollector
module and integration tests for the canary flag.Types of changes
Checklist: