Page MenuHomePhabricator

[land-bot] Introduce an autogen amendment step and update version numbers using it
ClosedPublic

Authored by jasonbcox on Sep 22 2020, 18:56.

Details

Summary

This ensures version bump changes are atomic in the git history, rather than
a series of version bump commits that we have today.

This autogen amendment behavior can be leveraged for other changes such as
linting, doc regeneration, and other mechanical tasks that do not need their
own commit.

Test Plan

Generate a test script to be the version bump generator. This emulates someone
else landing a version bump revision:

TEMP_SCRIPT=$(mktemp)
(cat <<EOF
set -euxo pipefail

sed -i 's/VERSION 0.22.3/VERSION 0.22.4/g' ~/projects/bitcoin-abc/CMakeLists.txt
export GIT_AUTHOR_NAME="Someone Else"
export GIT_AUTHOR_EMAIL="no-email@bitcoinabc.org"
export GIT_COMMITTER_NAME="Someone Else"
export GIT_COMMITTER_EMAIL="no-email@bitcoinabc.org"
git commit -am "bump version"
EOF
) > "${TEMP_SCRIPT}"
chmod +x "${TEMP_SCRIPT}"

Test:

./automated-commits.sh "${TEMP_SCRIPT}"
git show

Verify the following:

  • Version is bumped in: CMakeLists.txt, both AUR PKGBUILD files, and release notes.
  • Release notes is archived.
  • Commit message is preserved as "bump version".
  • Both author and committer are preserved as "Someone Else".

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix added a subscriber: deadalnix.

If you are going to loop over all the files in a folder, you want to prefix them with 00-blah.sh and so on, so they can be prioritized.

contrib/source-control-tools/autogen-recipes/update-aur-version.sh
1 ↗(On Diff #23691)

Didn't you mean to move it?

contrib/source-control-tools/automated-commits.sh
92 ↗(On Diff #23691)

Ho, nice!

likestamp

This revision is now accepted and ready to land.Sep 22 2020, 19:20
contrib/source-control-tools/autogen-recipes/update-aur-version.sh
1 ↗(On Diff #23691)

It is moved, but I had to make some modifications. Phab thinks I deleted and made a new file.

The only change is wrapping part of the script in a helper function and calling that function for each package.
Before this change, we were calling the script with the package name as an argument.

Good call on the priority naming. Let's start doing that now. Although it's hard to tell what the
priority will be, so let's start in the middle.