Skip to content

yarn new-version#229

Merged
mdespuits merged 5 commits intomasterfrom
yarn-version
Jul 1, 2020
Merged

yarn new-version#229
mdespuits merged 5 commits intomasterfrom
yarn-version

Conversation

@mdespuits
Copy link
Copy Markdown
Contributor

@mdespuits mdespuits commented Jul 1, 2020

Adds yarn new-version

asciicast

This calls yarn version --no-git-tag-version, which doesn't create a tag, and then auto-commits the changes with the appropriate commit message. This will allow the ability to tag the squashed merge commit in the master branch instead of a commit squashed in a PR.

Documents current workflow for releasing new versions of Rover for both Champions as non-Champions alike.

@mdespuits mdespuits added the documentation Helping us not forget label Jul 1, 2020
Comment thread package.json
"preversion": "run-p -l test build",
"version": "yarn update-changelog && git add CHANGELOG.md",
"new-version": "yarn version --no-git-tag-version",
"postnew-version": "git add . && git commit -m \"v$npm_package_version\" -n",
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.

The workflow is a little uneven in terms of what git commands are automatic (git add . && git commit ...) vs. manual (git checkout master && git fetch -p && git reset ...)

I'd probably err on the side of asking the user to do the git commands manually, at least at first; but it could go either way.

But I won't be a stickler about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's kinda trickier than I would have hoped. The main problem is that we do not allow anyone to push directly to master unless they are a champion (which makes sense).

The assumption of yarn version and other patterns is that this ability is present. It also assumes that the tag is on the final commit for the version. In our case, this can also be a squashed commit from a pull request, not the original commit itself. That's why there is a slightly different flow for non-champions and champions and thus the usefulness of new-version.

Comment thread CONTRIBUTING.md
1. For `patch`: `yarn new-version --patch`
2. For `minor`: `yarn new-version --minor`
3. For `major`: `yarn new-version --major`
4. For other: `yarn new-version --new-version 3.4.11`
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.

Using this pattern, there won't be any kind of tag attached to the version, right?

I think I see why that's necessary, I just want to make sure I understand it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, with new-version it doesn't create the tag because otherwise, the tag will be on a commit that will be squashed from the PR and not exist in the master branch.

@mdespuits mdespuits merged commit bd30a8b into master Jul 1, 2020
@mdespuits mdespuits deleted the yarn-version branch July 1, 2020 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Helping us not forget

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants