pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.55k stars 237 forks source link

turnkey release + CI testing #1807

Open workingjubilee opened 1 month ago

workingjubilee commented 1 month ago

I spent some time on release engineering lately because I was tired of having to rejigger everything every time I cut a release:

The final objective here is to make the command for "test if the release can be run from this code" and "actually run the release" be essentially the same, and for it to simply be one wave of the wand.

eeeebbbbrrrr commented 1 month ago

The final objective here is to make the command for "test if the release can be run from this code" and "actually run the release" be essentially the same, and for it to simply be one wave of the wand.

What is the new command? Does release.md need an update or is it current?

workingjubilee commented 1 month ago

It seems current except for finalize-release.sh not existing anymore.

workingjubilee commented 1 month ago

I use a git workflow that requires my presence is confirmed every time git touches the network, so I'm not a huge fan of how prepare-release.sh currently works.

In particular this diff check doesn't work lol:

git fetch origin
git diff origin/develop | if [ "$0" = "" ]; then
    echo "git diff found local changes on develop branch, cannot cut release."
elif [ "$NEW_VERSION" = "" ]; then
    echo "No version set. Are you just copying and pasting this without checking?"
else
    git pull origin develop --ff-only
workingjubilee commented 1 month ago

ah, it's the spaces, they break it. it should be

git diff origin/develop | if [ "$0"="" ]; then

and the condition should probably be inverted?

workingjubilee commented 1 month ago

and this won't work on uncommitted / working directory changes, but we then git commit.

I wrote this code, too... :upside_down_face: It needs to test against adding a file to the directory, etc. otherwise the script is kinda pointless.