beachball
beachball copied to clipboard
Better recovery after Git merge fails in CI
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
- Change the order of commands: Git
mergefirst, thenpublishto the registry. That way if something goes wrong with Git the process errors out and quits. - If the branch was merged, but publishing fails, revert the merge back to the
mainoriginal 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:
- Fetch the correct versions for
package.jsons (the currentsyncfunctionality`). - Without bumping further, delete change files and generate updated changelogs.
- Create a flag for the next Beachball run in CI not to require changelogs (omit changelog files and
package.jsonfromcheck change).