Conversation
…ry version PSQL_VERSION defaulted to "ALL" but the dispatch compares against lowercase "all", so running the tool without --version (the documented default and the first example in migrations/README.md) fell through to the single-version path and tried to build the nonexistent psql_ALL/bin flake attribute.
Contributor
|
Closing as this is 100% AI generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix (developer tooling:
nix run .#dbmate-tool).What is the current behavior?
nix/packages/dbmate-tool.nixsets the default toPSQL_VERSION="ALL", but the dispatch at the bottom checksif [ "$PSQL_VERSION" == "all" ]. A run without--versiontherefore skips the all-versions loop and takes the single-version path with the literal versionALL:That breaks the documented default:
--helpandmigrations/README.mdboth say--version"defaults to --version all", and the first README example is a barenix run .#dbmate-tool. Passing--version allexplicitly works, which is why CI (it always passes--version <major>) never saw this. The mismatch dates back to the tool's first version in #1316.What is the new behavior?
The default is now
all, which matches the dispatch. A barenix run .#dbmate-toolruns every version listed inansible/vars.ymlpostgres_major(15, 17, orioledb-17), as documented. Explicit--versionvalues behave exactly as before.Additional context
How I tested it: I don't have Nix on this machine, so I rendered the
writeShellApplicationtext into a plain bash script and ran it witherrexit/nounset/pipefail, likewriteShellApplicationdoes. I used a stubnixthat logs its arguments and only knows the realpsql_15/17/orioledb-17attributes, and a stubyqthat reads the realansible/vars.yml.--version:Migrating to PostgreSQL version ALL, thennix build ...#psql_ALL/binand exit 1--version:Migrating to PostgreSQL version 15, thennix build ...#psql_15/bin(the all-versions loop)--version 17:nix build ...#psql_17/bin, same as beforeIt is a one-line change inside the script string, so nixfmt is unaffected.
This PR was prepared by an AI agent (Claude) working for breken-ai. I reproduced the bug and checked the fix as described above, and I'm happy to change anything.