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
- Change the order of commands: Git
merge
first, thenpublish
to 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
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:
- Fetch the correct versions for
package.json
s (the currentsync
functionality`). - 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.json
fromcheck change
).