Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the next-release workflow in CircleCI - it's publishing old version numbers #1442

Closed
MantisClone opened this issue Jul 26, 2024 · 0 comments · Fixed by #1435 or #1439
Closed

Fix the next-release workflow in CircleCI - it's publishing old version numbers #1442

MantisClone opened this issue Jul 26, 2024 · 0 comments · Fixed by #1435 or #1439
Assignees

Comments

@MantisClone
Copy link
Member

MantisClone commented Jul 26, 2024

Problem

The next-release workflow in CircleCI started releasing incorrect version numbers, based on old tags.

For example, it released @requestnetwork/advanced-logic@0.27.1-next.709
image

History

@MantisClone replaced several old lightweight tags with annotated tags in an attempt to fix the CHANGELOG.md files generated by lerna publish --conventional-commits.

We subsequently merged the #1435 hoping it would create new -next releases based on the latest 0.48.0 release tags. Unfortunately, this didn't work.
image

Then @MantisClone wrote and executed https://github.com/RequestNetwork/release-tools/pull/6, a script that backdated taggerdate of the annotated tags to Dec 4, 2020 based on the theory that lerna was getting confused by the out-of-order taggerdate. Unfortunately, this also didn't work.

@MantisClone also noticed that he forgot to backdate the taggerdate for the ethereum-storage tag due to a typo in the script, so he fixed the typo and re-ran the script. https://github.com/RequestNetwork/release-tools/pull/7

Then @MantisClone manually released a custom -next release - to unblock Request Finance in upgrading portal.

Then @MantisClone theorized that the root cause was because we "squash" merge our release branches, thus changing the commit hash and orphaning the tags applied by lerna publish --conventional-commits. So he tried revamping the release process in https://github.com/RequestNetwork/release-tools/pull/8 to do a regular merge instead of a squash merge. He used this new process to release 0.49.0. Unfortunately, even this did not fix the root cause. The next-release workflow still produced packages with old version numbers.

Finally, the root cause was found.

Root Cause

The next-release workflow published packages with old version numbers because lerna publish --canary uses git describe --first-parent to determine the previous annotated tag. --first-parent means that only tags originating from the master branch are considered, not tags originating from a merged branch. Since we've always applied annotated tags on branches, none of the annotated tags originate from master - EXCEPT FOR THE ONES @MantisClone WENT BACK AND MANUALLY CREATED!

Solution

  1. Disable the --first-parent flag by passing --include-merged-commits when calling lerna publish in the next-release workflow.
  2. Delete the annotated tags that @MantisClone created.

@MantisClone implemented solution (1) in #1440, but closed it and chose solution (2) instead.

Cleanup

@MantisClone cleaned up the release process in https://github.com/RequestNetwork/release-tools/pull/9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment