Skip to content

Enabled hotfix changes for rush - #434

Merged
QZ (qz2017) merged 1 commit into
microsoft:masterfrom
lambertwang-zz:magellantoo/hotfixChanges
Nov 27, 2017
Merged

QZ (qz2017) merged 1 commit into
microsoft:masterfrom
lambertwang-zz:magellantoo/hotfixChanges

Conversation

@lambertwang-zz

Copy link
Copy Markdown

Added a 'hotfix' bump option for rush change

It will append -hotfix.1 to the version number or increment the hotfix version if already on a hotfix branch.

@octogonz

Copy link
Copy Markdown
Collaborator

Thanks for submitting this PR.

QZ (@qz2017) could you take a look?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are those extra spaces for?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that my auto-linting reformatted the whitespace throughout this file. I will turn it off and revert the changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a tag is not passed to npm publish, the 'latest' tag is automatically used and we don't want the hotfix version to replace the latest on the package manager.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not use a hardcoded condition like this. Are you sure no one else has 'hotfix' as part of their version?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a different condition check, instead of checking this string.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use semver instead.

@qz2017

Copy link
Copy Markdown
Contributor

We need test coverage for the newly added logic. PublishUtilities class should respect the switch as well.

@qz2017 QZ (qz2017) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prerelease does not need to be exact match. as long as it is part of the range.

I do not want hotfix logic to mess up existing version bump logic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you prevent other changes from happening to the package?

Can you throw errors if it happens?

@lambertwang-zz Lambert Wang (lambertwang-zz) Nov 14, 2017 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should throw errors if you try and publish a hotfix change when there are also patch/minor/major changes. And you should not try to make patch/minor/major changes on top of a prerelease branch.
I can make it throw errors and add tests for this case.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests were added for applying a patch and hotfix on the same package. (should error)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to do it the other way. When it is enabled, add this option.

@lambertwang-zz

Lambert Wang (lambertwang-zz) commented Nov 17, 2017 •

Copy link
Copy Markdown
Author

Hotfix versioning was changed to increment package version by patch and then append the hotfix .
IE: Hotfix change on a@1.0.0 becomes a@1.0.1-hotfix.0

Update: This behavior was reverted and an exception was made specifically for hotfixing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only adds the hotfix help message if the hotfixchange is enabled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it fails, let it fail so that any bug can be exposed. People can still turn hotfixChangeEnabled off to work around the bug.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break out of the loop if it happens.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@qz2017 QZ (qz2017) Nov 23, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add if (hotFixSwitch on) around it? So that if there is any hotfix but switch is off, those change logs are not generated. It is optional. You do not have to do it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a [](start = 23, length = 1)

Should be 'd'.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a [](start = 23, length = 1)

should be 'd'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prereleaseComponents [](start = 12, length = 20)

Put this line inside the if (changeType == hotfix) branch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false [](start = 8, length = 5)

What is this?

@qz2017 QZ (qz2017) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@qz2017
QZ (qz2017) merged commit 3615b1f into microsoft:master Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants