microsoft / beachball

The Sunniest Semantic Version Bumper
https://microsoft.github.io/beachball
MIT License
699 stars 85 forks source link

Support for the dedicated release branch flow #361

Open arazabishov opened 4 years ago

arazabishov commented 4 years ago

Challenges

The current bumping flow of the Beachball introduces a few challenges:

Potential inconsistency

The process of version bumping in Beachball is not atomic, creating the possibility of inconsistency between versioning on master/dev branches and artifacts published to NPM. In relatively small repositories that are quick to build are not as prone to this issue as larger mono repositories that take more than an hour to build.

For example, if a PR is submitted to master shortly after beachball publish is executed, the PR may be merged with the master before the version update from Beachball. This results in a state, where the artifacts published to NPM do not correspond to any commit on master.

Screenshot 2020-06-25 at 11 55 01 Screenshot 2020-07-01 at 19 31 20

Proposal

Introduce a master/dev branch and a release branch. All PRs are supposed to target the dev branch. Beachball will merge changes from the dev branch to the release branch and update versions in the process. Versions are only maintained on the release branch, including the changelog files. Only one Beachball merge process can be executed at a time. Artifacts are built and released based on the release branch only.

cc: @khovik, @VincentBailly, @bweggersen

kenotron commented 4 years ago

Steps

Here are steps in the release build job:

  1. git merge --no-commit master
  2. bump (changes changelog, package.json)
  3. git add .
  4. git merge --continue
  5. do BUILD / TEST, whatever
  6. beachball publish to npm, pushes package.json changes back into RELEASE branch

Discussion Topics

Estimated Work (if yes on discussion point)

arazabishov commented 4 years ago

Thanks for the response @kenotron . After taking a closer look at the implementation steps at Midgard together with @bweggersen, we have realized that a few intermediate implementation steps are missing in the proposal:

  1. When merging dev/master into the rolling release branch, beachball needs to use only those change files that have been added since the last bump. This is necessary because dev/master is going to accumulate change files indefinitely. The API might look something like: beachball bump --since <REF>.
  2. Ability to run publish without executing bump and revert, i.e. steps 1, 2, and 8 from the publish documentation.