Skip to content
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

Made release script interactive to choose how to bump the version #944

Merged
merged 1 commit into from
Jun 25, 2018

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Jun 22, 2018

Moved the commands executed by yarn release out of the package's release script and into a ./scripts/release.js to enable additional functionality. I have tested the functionality up to the new git tag being pushed, but from that point on there are no changes compared to the previous release script.

CHANGELOG.md now auto-updates during a release
This is so the recent, un-published changes can be read by the release script, and so the new user-defined version can be injected when npm changes the package's version.

ensures user is on master branch
ensure master branch

inspects CHANGELOG.md to recommend how to update the version, enforces the user's choice must be one of major, minor, or patch
changelog detection

if any steps fail, the release script is halted with an error code (this gif shows the script failing because the git working directory is dirty)
halt on errors

all stdout, stderr, and stdin pipes are passed as inherited, maintaining same output format as before
stdio

@chandlerprall chandlerprall changed the title Made release script interactive to choose how to bump the version WIP: Made release script interactive to choose how to bump the version Jun 22, 2018
@chandlerprall chandlerprall changed the title WIP: Made release script interactive to choose how to bump the version Made release script interactive to choose how to bump the version Jun 22, 2018
@chandlerprall chandlerprall requested review from snide and bevacqua June 22, 2018 18:42
version: {
description: 'choice:',
pattern: /^(major|minor|patch)$/,
message: 'Version must be major, minor, or patch',
Copy link
Contributor

@snide snide Jun 25, 2018

Choose a reason for hiding this comment

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

"Your choice must be major, minor or patch"

Just to relate it specifically to the previous prompt.

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

I tested this locally by manipulating a bunch of the changelog text. It'll obviously only be as good as we stick to pattern, but seems to work against a bunch of random ones I picked from the past.

I think once we merge this we should immediately run it to make sure the full npm process works (it looks like it should be fine), and we can always revert if it has trouble.

Might want a changelog item for this change itself. Know it's not directly consumer related, but feels big enough we'd want to mark it.

@chandlerprall chandlerprall force-pushed the feature/release-script branch from 18d512b to e65e56a Compare June 25, 2018 19:56
@chandlerprall chandlerprall force-pushed the feature/release-script branch from 31d5a5a to d348349 Compare June 25, 2018 20:23
@chandlerprall chandlerprall merged commit db1b0f1 into elastic:master Jun 25, 2018
@chandlerprall chandlerprall deleted the feature/release-script branch June 25, 2018 20:29
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.

2 participants