-
Notifications
You must be signed in to change notification settings - Fork 604
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
[rush] Add support for premajor and prepatch bump types #4994
base: main
Are you sure you want to change the base?
[rush] Add support for premajor and prepatch bump types #4994
Conversation
@@ -25,8 +25,6 @@ import { cloneDeep } from '../utilities/objectUtilities'; | |||
* This is a copy of the semver ReleaseType enum, but with the `none` value added and | |||
* the `premajor` and `prepatch` omitted. | |||
* See {@link LockStepVersionPolicy._getReleaseType}. | |||
* | |||
* TODO: Consider supporting `premajor` and `prepatch` in the future. | |||
*/ | |||
export enum BumpType { |
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.
Do the numeric values of these need to be updated to reflect the order of increasing severity? These may be used to ensure that the most severe bump type wins if multiple are specified in a package's changefiles.
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.
However, we need to confirm that doing that as a breaking API change won't cause issues.
Maybe we make premajor
be 4.5
and prepatch
be 1.5
? When preminor
was added, was that also a breaking reordering of values? It that's the case, then reshuffling these and using integers is probably fine.
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.
@iclanton IMHO it makes sense for them to be ordered in more natural way, but as you mentioned it could be a breaking API change.
I'll wait for other maintainers to comment on this before making changes 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.
@octogonz - thoughts?
...on/changes/@microsoft/rush/support-premajor-prepatch-version-bump-type_2024-11-07-06-42.json
Outdated
Show resolved
Hide resolved
…on-bump-type_2024-11-07-06-42.json Co-authored-by: Ian Clanton-Thuon <[email protected]>
Summary
Simple change to allow premajor and prepatch bump types.
These are directly supported by the
semver
library.Details
How it was tested
I've added unit tests for "premajor" and "prepatch" as well as additional ones that make sure using bump type "patch" gets rid of any prerelease identifier.
PS. There was a bug in
VersionPolicy.test.ts
which caused tests to use the same instances ofversionPolicyN
objects. I've moved creation ofVersionPolicyConfiguration
intobeforeEach
hook to make sure that each test gets a clean environment.Impacted documentation
https://rushjs.io/pages/commands/rush_version/
https://rushjs.io/pages/configs/version-policies_json/