microsoft / beachball

The Sunniest Semantic Version Bumper

Home Page:https://microsoft.github.io/beachball

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better recovery after Git merge fails in CI

AkimaLunar opened this issue · comments

Problem

We had Git fail to commit back into main branch after the packages had been published in CI, which was hard to untangle after. A couple ideas of how this could be improved.

Idea 1

  1. Change the order of commands: Git merge first, then publish to the registry. That way if something goes wrong with Git the process errors out and quits.
  2. If the branch was merged, but publishing fails, revert the merge back to the main original state (so you get all the change files back to try again).

Idea 2

If idea 1 is not possible, improve the sync script or create a new one. After Git merge fails, the user has their packages published, but changelogs not generated and package.json's not updated. The recovery script would:

  1. Fetch the correct versions for package.jsons (the current sync functionality`).
  2. Without bumping further, delete change files and generate updated changelogs.
  3. Create a flag for the next Beachball run in CI not to require changelogs (omit changelog files and package.json from check change).