Skip to content

Latest commit

 

History

History
277 lines (217 loc) · 12.4 KB

File metadata and controls

277 lines (217 loc) · 12.4 KB

2.3.0

Rename PGTLE_VERSION to PGXNTOOL_PGTLE_VERSION

make pgtle’s version-limiting variable was named `PGTLE_VERSION, which make auto-imports from an identically-named environment variable. That name is also a natural choice for a CI job’s "which pg_tle to test against" env var — when one was set, make pgtle/make run-pgtle silently misbehaved instead of erroring. Renamed to PGXNTOOL_PGTLE_VERSION to avoid the collision. If you invoke make pgtle PGTLE_VERSION=…​ directly, update it to PGXNTOOL_PGTLE_VERSION.

Fix DATA wildcard skipping historical full-install version scripts

base.mk’s `DATA wildcard (sql/----.sql) only matched upgrade scripts (two -- separators), silently skipping historical full-install scripts like sql/ext—​0.9.6.sql (one --) even though these are meant to be committed to git. make install never placed them in the extension directory, so CREATE EXTENSION ext VERSION 'x.y.z' failed for any version older than current. Widened to sql/--*.sql, which matches both.

Fix make test always exiting 0, even when every test fails

.IGNORE: installcheck made make treat installcheck as always successful regardless of pg_regress’s exit status, and `test’s recipe only `cat`ed `regression.diffs for visibility without checking it. make test now exits non-zero when regression.diffs is non-empty, after printing it.

Issues fixed in this release: #35, #49, #78, #79, #48

2.2.0

Add check-stale-expected to catch orphaned test/expected files

make test now fails if test/expected/.out (or test/build/expected/.out) has no corresponding test/sql/.sql (or test/build/.sql). If your project has genuinely stale expected-output files sitting around, make test will newly fail until they’re removed. pg_regress’s alternate expected-output files (test_0.out .. test_9.out) are recognized and not flagged as stale.

Rename EXTENSION_VERSION_FILES to EXTENSIONCURRENT_VERSIONFILES

The old name implied it listed every version file for an extension; it actually only ever holds the current/most-recent one per extension. If your Makefile references EXTENSION_VERSION_FILES directly (e.g. to add extra dependencies to DATA), update it to EXTENSIONCURRENT_VERSIONFILES.

Add make pgxntool-version to print the embedded pgxntool version

There was no way to tell which pgxntool version a project had embedded via git subtree short of digging through git history. make pgxntool-version (and pgxntool/bin/version directly) now prints it, read from the first line of pgxntool/HISTORY.asc — the same line the release process stamps with the version number. The line is rejected unless it’s STABLE or a plain X.Y.Z version (digits only, no pre-release suffixes).

Add PGXN_REMOTE to override the remote used by tag/rmtag/forcetag/dist

These targets hardcoded the origin remote, silently re-tagging the wrong repository for maintainers whose origin is a personal fork. Defaults to origin, so existing behavior is unchanged unless you set it.

Fix make pgtle PGTLE_VERSION=X generating all versions instead of one

base.mk’s `pgtle target never passed the PGTLE_VERSION make variable through to pgtle.sh --pgtle-version, so it silently generated all pg_tle version ranges regardless of the value given on the command line.

Fix pgtle.sh rejecting non-numeric version aliases like stable

extract_version_from_filename() required every version segment to start with a digit, so extensions using a persistent stable pseudo-version (default_version = 'stable') failed with "Cannot parse version from filename". Widened to accept any non-empty, ---free version string, matching how pg_tle itself treats extension versions.

Fix versioned SQL file corruption under overlapping make invocations

The rule generating sql/<ext>--<version>.sql used a > truncate followed by a separate >> append, so a rule that fired more than once (e.g. overlapping make processes) doubled the file’s content. Now uses a single atomic redirect.

Add include guard to base.mk

base.mk could end up included twice in one make run (for example, an extension’s own .mk module includes it in addition to the Makefile’s own include), which redefined every target and printed overriding-recipe warnings. A second inclusion is now a harmless no-op.

2.1.0

Fix setup.sh / pgxntool-sync.sh / update-setup-files.sh inside a git worktree

These scripts guarded the project root with [ -d .git ]. In a linked worktree .git is a file, not a directory, so the check failed: setup.sh would wrongly re-run git init, and the sync scripts aborted with "Not in a git repository." They now detect the repo with git rev-parse --git-dir, which works in both a normal clone and a worktree.

Fix verify-results checking stale results in make results

make results ran verify-results before make test, so it checked stale regression.diffs from a prior run. Reordered so verify-results always checks the fresh results.

Fix PGXNTOOL_ENABLE_TEST_BUILD/PGXNTOOL_ENABLE_TEST_INSTALL ignoring command-line values

Without override, the pgxntool_validate_yesno normalization was silently skipped when these variables were set on the command line.

2.0.3

Fix pgxntool-sync remote, and make it runnable without make

make pgxntool-sync pointed at the old SSH URL, which fails without GitHub SSH keys; it now uses https://github.com/Postgres-Extensions/pgxntool.git over HTTPS (still the release tag). The subtree pull + update-setup-files.sh logic moved into pgxntool/pgxntool-sync.sh, which the make targets now wrap, so you can also sync without make by running it directly.

2.0.2

Fix parse_control_file corrupting values with trailing comments

Control file values like default_version = '1.0.0' # comment were parsed incorrectly — the trailing quote was left in the value due to comment removal happening after quote stripping. Fixed by removing comments first.

2.0.1

Improve bash compatibility (specifically for Mac OS)

Mac OS uses the (very old) bash 3.2 as the default shell; fix a few compatibility bugs.

2.0.0

Remove .source file support

PostgreSQL removed .source file processing from pg_regress in PG15. The input/.sourcesql/.sql and output/.sourceexpected/.out conversion mechanism no longer functions. All related variables (TESTSOURCE*), the make_results.sh helper script, and the special-case logic in make results have been removed. Extensions that used .source files should convert them to regular test/sql/.sql and test/expected/.out files using relative paths.

Add test-build for pre-test validation

When CREATE EXTENSION fails due to a SQL syntax error, PostgreSQL reports only a cryptic error with limited context. test-build runs your extension SQL directly through pg_regress first, so syntax errors show the exact file, line, and position — cutting debugging time significantly. Place SQL files in test/build/ to enable; auto-detects based on file presence.

Add test/install for one-time test setup

Extensions that install dependencies or run expensive setup in every test file pay that cost once per test. test/install runs setup SQL once before the entire test suite, and all regular tests share the resulting database state. This can dramatically speed up test suites that install extensions or load fixtures. Place SQL files in test/install/ to enable; auto-detects based on file presence.

Add verify-results safeguard for make results

make results now refuses to run when tests are failing (detected via regression.diffs). Prevents accidentally blessing incorrect output as the new expected results. Enabled by default; disable with PGXNTOOL_ENABLE_VERIFY_RESULTS=no.

Fix bash 3.2 compatibility and shebang portability

${ARRAY[@]:-0} is a syntax error in bash 3.2; replaced with ${#ARRAY[@]}. Shell scripts now use !/usr/bin/env bash.

1.1.2

Fix double --dbname bug that defeated unique test database names

The unique database naming introduced in 1.1.0 was ineffective because base.mk added --dbname=$(REGRESS_DBNAME) to REGRESS_OPTS while PGXS also appends --dbname=$(CONTRIB_TESTDB). The second --dbname caused pg_regress to create a contrib_regression database that collided across projects. Fixed by overriding CONTRIB_TESTDB after include $(PGXS) instead.

1.1.1

Fix pg_tle exception handler and empty upgrade files

The exception handler for uninstall_extension() now correctly catches no_data_found (P0002) instead of undefined_object (42704). Empty upgrade files are now treated as valid no-op upgrades for version bumps. Added ON_ERROR_STOP=1 to run_pgtle_sql() so psql errors propagate correctly.

1.1.0

Use unique database names for tests

Tests now use a unique database name based on the project name and a hash of the current directory. This prevents test conflicts when running tests for multiple projects in parallel.

Add 3-way merge support for setup files after pgxntool-sync

New update-setup-files.sh script handles merging changes to files initially copied by setup.sh (.gitignore, test/deps.sql). After running make pgxntool-sync, the script performs a 3-way merge if both you and pgxntool have modified the same file, using git’s native conflict markers for resolution.

1.0.0

Fix broken multi-extension support

Prior to this fix, distributions with multiple extensions or extensions with versions different from the PGXN distribution version were completely broken. Extension versions are now correctly read from each .control file’s default_version instead of using META.json’s distribution version.

Add pg_tle support

New make pgtle target generates pg_tle registration SQL for extensions. Supports pg_tle version ranges (1.0.0-1.4.0, 1.4.0-1.5.0, 1.5.0+) with appropriate API calls for each range. See README for usage.

Use git tags for distribution versioning

The tag and rmtag targets now create/delete git tags instead of branches.

Support 13+

The --load-language option was removed from pg_regress in 13.

Reduce verbosity from test setup

As part of this change, you will want to review the changes to test/deps.sql.

Support asciidoc documentation targets

By default, if asciidoctor or asciidoc exists on the system, any files in doc/ that end in .adoc or .asciidoc will be processed to html.

See the README for full details.

Support 9.2

CREATE SCHEMA IF NOT EXISTS doesn’t work before 9.3.

Make installcheck depend on test input files

If a test input file changes we certainly need to re-run tests.

Have test/pgxntool/setup.sql install tap before running deps.sql

Support other asciidoc extensions

Create the test/sql/ directory during setup

Use --sudo option when installing pgtap

0.2.0

Stop using $(VERSION)

VERSION is defined by PGXS itself, so trying to use it causes problems.

Handle Postgres version 10+

Old code didn’t deal with the lack of a . that can appear in a 10+ version.

0.1.10

Remove invalid git subtree pull options

0.1.9

Install upgrade scripts

Fixes a bug where upgrade scripts (namely, sql/----*.sql) were not being installed.

0.1.8

Remove META.json processing from base.mk

Processing the META file from inside make was problematic with make dependencies. Now, a meta.mk file is generated and included as part of base.mk.

Fix bugs with test directory creation

0.1.7

Better handling of test directories

Missing test directories should now be created as necessary.

Ensure git repository is clean when running setup.sh

Fix bug for excluding .asc files

Enforce bash since -o errtrace isn’t valid sh

Paul Norman #3

Minor documentation tweaks

0.1.6

Remove tap stuff from deps.sql

Having the tap stuff in deps.sql was confusing because it was also loaded by setup.sql. Just let setup.sql handle it, as that’s what most people should probably do. At some point we’ll probably need a way to over-ride this though…​

Improve warning about extra pgxntool-sync-* targets

0.1.5

Change $(DATA) to rely on $(EXTENSION_VERSION_FILES) instead of what’s on the filesystem.

This is necessary because some install targets are generated and would not necessarily be on the filesystem when we installed. This also prevents installing leftover cruft from old versions.

Improve formatting of print-% target