diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ff58898 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,13 @@ +# See ../ai/RELEASE.md's multi-extension distribution section: an +# extension with no real changes this release cycle keeps its +# --stable.sql update script un-renamed (a genuine no-op), +# rather than promoting it to a real versioned update script. That file +# must never ship in a release archive -- nothing in a tagged release +# has default_version = 'stable' for any extension, so a file only +# reachable via that pseudo-version would be permanently unreachable, +# confusing cruft in the archive. Safe as a blanket glob here (unlike +# .gitignore's exact-filename version of this same exclusion): by the +# time `make dist` archives a tag, any extension that DID change already +# had its stable-named file renamed away, so only genuine no-ops can +# still match this pattern. +sql/*--stable.sql export-ignore diff --git a/.gitignore b/.gitignore index 941a061..c6fd02e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,17 @@ control.mk # built targets # Note: Version-specific files (sql/*--*.sql) are now tracked in git and should be committed +# Exception: the `stable` pseudo-version (default_version between releases, +# see ../ai/RELEASE.md and ../ai/CLAUDE.md's "Version-specific SQL files") +# is permanently current, not a frozen release -- it would be regenerated +# and re-diffed on every source edit for zero test-coverage value if +# tracked. Named explicitly, not `sql/*--stable.sql`: that glob's `*` also +# matches across the second `--`, so it silently swept up the *update* +# scripts too (sql/----stable.sql, which must stay +# committed -- confirmed the hard way when `git status` didn't show them +# as untracked after creating them). +sql/test_factory--stable.sql +sql/test_factory_pgtap--stable.sql # Generated by asciidoctor from doc/*.asc; only the .asc source is tracked doc/*.html diff --git a/bin/test_existing b/bin/test_existing index a4f8a74..d92e4be 100755 --- a/bin/test_existing +++ b/bin/test_existing @@ -26,12 +26,12 @@ # # run-suite DB # Assert the installed version matches the current build (never -# hardcoded -- derived from `make -s print-PGXNVERSION`, so a broken -# extraction can't silently compare "" to ""), then run the suite in -# existing mode via --use-existing (pg_regress must not drop/recreate -# DB) and gate on verify-results, not a bare `make test` (pgxntool -# marks installcheck .IGNORE, so a plain test run exits 0 even when -# regression.diffs is nonempty). +# hardcoded -- derived from `make -s print-EXTENSION_test_factory_VERSION`, +# so a broken extraction can't silently compare "" to ""), then run +# the suite in existing mode via --use-existing (pg_regress must not +# drop/recreate DB) and gate on verify-results, not a bare `make test` +# (pgxntool marks installcheck .IGNORE, so a plain test run exits 0 +# even when regression.diffs is nonempty). # # No separate guard-planting subcommand: unlike cat_tools, test_factory's # dependency guard (a view in schema test_factory_drop_guard depending on @@ -57,8 +57,15 @@ psql_do() { psql -d "$db" -v ON_ERROR_STOP=1 "$@" } +# EXTENSION_test_factory_VERSION, not PGXNVERSION: the latter is the +# *distribution* version from META.json, which no longer tracks what +# CREATE EXTENSION actually installs now that test_factory.control's +# default_version sits at the literal 'stable' pseudo-version between +# releases (see ../ai/RELEASE.md) -- a bare CREATE EXTENSION always +# resolves to whatever default_version says, not the distribution's +# semver. current_version() { - make -s print-PGXNVERSION 2>/dev/null | sed -n 's/.*set to "\(.*\)"$/\1/p' + make -s print-EXTENSION_test_factory_VERSION 2>/dev/null | sed -n 's/.*set to "\(.*\)"$/\1/p' } installed_version() { diff --git a/sql/test_factory--0.5.0--stable.sql b/sql/test_factory--0.5.0--stable.sql new file mode 100644 index 0000000..e7e34b8 --- /dev/null +++ b/sql/test_factory--0.5.0--stable.sql @@ -0,0 +1,15 @@ +/* + * Genuine no-op: nothing in this extension has changed since 0.5.0 yet. + * This file exists purely so ALTER EXTENSION test_factory UPDATE has an + * edge to follow at all -- Postgres's version-graph resolution requires + * an actual sql/test_factory----.sql file to exist for a + * transition, regardless of whether its content would be a no-op + * (confirmed directly: without this file, ALTER EXTENSION UPDATE fails + * outright with "has no update path from version 0.5.0 to version + * stable", even though nothing would actually need to change). See + * ../ai/RELEASE.md's `stable` pseudo-version workflow: every subsequent + * SQL-touching PR adds whatever ALTER .../CREATE OR REPLACE ... statements + * are needed here to bring an install on 0.5.0 up to that change. + */ + +-- vi: expandtab ts=2 sw=2 diff --git a/sql/test_factory_pgtap--0.1.0--stable.sql b/sql/test_factory_pgtap--0.1.0--stable.sql new file mode 100644 index 0000000..ef78a33 --- /dev/null +++ b/sql/test_factory_pgtap--0.1.0--stable.sql @@ -0,0 +1,13 @@ +/* + * Genuine no-op: nothing in this extension has changed since 0.1.0 yet. + * Every extension this distribution provides keeps one of these between + * releases, not just the ones a given change happens to touch -- at + * release time, each extension's own --stable.sql is + * inspected to decide whether THAT extension needs a new version (see + * ../ai/RELEASE.md's multi-extension distribution section). An empty + * file here means test_factory_pgtap is not part of this cycle's + * changes and should ship at its existing version, whatever the + * distribution version does. + */ + +-- vi: expandtab ts=2 sw=2 diff --git a/test_factory.control b/test_factory.control index a18e438..565e4b6 100644 --- a/test_factory.control +++ b/test_factory.control @@ -1,3 +1,3 @@ comment = 'A framework for managing test data' -default_version = '0.5.0' +default_version = 'stable' relocatable = false diff --git a/test_factory_pgtap.control b/test_factory_pgtap.control index 8e4a75f..be2217c 100644 --- a/test_factory_pgtap.control +++ b/test_factory_pgtap.control @@ -1,4 +1,4 @@ comment = 'A framework for managing test data' -default_version = '0.1.0' +default_version = 'stable' relocatable = false requires = 'pgtap, test_factory'