Skip to content

0.3.0

Choose a tag to compare

@github-actions github-actions released this 26 Aug 22:20

Release Notes

Mixed-credential directives work, and a command that cannot finish its work now says which piece it could not do instead of stopping part way through.

Clusters with more than one role

Each database is forked, snapshotted, or dropped once, as the role in the first directive URL that names it, and connections are pooled per role. A cluster holding two databases owned by two roles gets one connection each and still does each piece of work once, which is what made apply --recreate and template refresh usable on a repository whose directives mix a superuser with a runtime role.

A statement Postgres refuses for want of privileges names the role it ran as, which is not always the role in the variable being applied, and names the other roles the directives offer for that database.

Nothing is created before everything that can be decided has been

apply opens the target env files first and settles every variable against them, so a variable pointing at some third database stops the run with nothing created and nothing written. It used to find that out after every fork existed, and exit leaving a database prune would not reclaim and no command could name.

Past that, a database that fails for a reason no connection could predict is reported, counted, and the run carries on, so the databases that did fork get their variables rewritten rather than being left pointing at the live database. remove connects to every database its directives name before git worktree remove runs, so a server that is down stops it before the worktree is gone. prune and remove skip a fork none of the offered roles owns rather than failing every later run on it, and say what brings it back within reach.

Reporting

The create line says where a fork came from, origin=live or origin=template with the snapshot's age, so a wrapper no longer has to sniff the version to know which behaviour it got.

A connection count is reported only where the role can see one. pg_stat_activity hides what a session is from a role holding neither that session's role's privileges nor pg_read_all_stats, and a count that includes a row it cannot identify is an upper bound rather than a number.

--terminate closes the connections the role can close instead of failing on the first backend it may not signal. A backend that survives is left to CREATE DATABASE, which refuses over what is attached when it runs.

Worth knowing before upgrading

  • Two branches whose names normalize to one fork name (feature/auth-v2 and feature/auth.v2, or any two agreeing to the identifier limit) are a conflict naming the worktree that owns the fork. They used to share one database quietly, and apply --recreate in the second dropped the first's data.
  • The server field in --json list rows is the cluster (host:port) and no longer carries a role.
  • A refused --terminate no longer fails the run: apply falls back to the snapshot the way an in-use source has always meant, so a run that exited non-zero can now exit 0 with origin=template and older data. The warning that says so goes to stderr and survives --quiet.

Install worktreepg 0.3.0

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/itsjamie/worktreepg/releases/download/v0.3.0/worktreepg-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/itsjamie/worktreepg/releases/download/v0.3.0/worktreepg-installer.ps1 | iex"

Download worktreepg 0.3.0

File Platform Checksum
worktreepg-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
worktreepg-x86_64-apple-darwin.tar.xz Intel macOS checksum
worktreepg-x86_64-pc-windows-msvc.zip x64 Windows checksum
worktreepg-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum
worktreepg-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum