Skip to content

Sync pgxntool to 2.3.0 - #58

Open
jnasbyupgrade wants to merge 5 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:pgxntool-2.3.0-sync
Open

Sync pgxntool to 2.3.0#58
jnasbyupgrade wants to merge 5 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:pgxntool-2.3.0-sync

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Pulls the latest pgxntool release (2.3.0, up from 2.2.0) via git subtree pull. This release fixes both issues filed from our 2.2.0 sync: #78 (PGTLE_VERSION collision, renamed upstream to PGXNTOOL_PGTLE_VERSION) and #79 (check-stale-expected running before install, fixed by making installcheck unconditionally depend on install in base.mk).

That #79 fix reintroduces the exact problem bin/test_existing's TEST_EXISTING_DEPLOY=pgtle mode exists to avoid: calling installcheck directly now also runs install, writing cat_tools.control to the real extension directory even though the database under test was deployed via pg_tle -- tripping bin/assert_fs_clean. Since pgxntool no longer offers a way to skip install (that's a separate, still-open request, pgxntool#55), this redirects install's filesystem writes to a throwaway DESTDIR instead: existing mode's suite never exercises install's output (the extension is already present via pg_tle), so where it writes doesn't matter as long as it isn't the real extension directory. Verified locally against a real database: the real extension directory's cat_tools files are byte-for-byte unchanged (by checksum) after a full TEST_EXISTING_DEPLOY=pgtle run-suite invocation, and all 14 tests still pass.

No other cat_tools-side changes were needed for this sync -- EXTENSION_VERSION_FILES/PGTLE_VERSION aren't referenced anywhere in our own Makefile/sql.mk beyond what 2.2.0 already required. A few workarounds in our code are now redundant given what 2.3.0 fixes upstream; those are being cleaned up separately rather than bundled into this sync.

a6d3287 Release 2.3.0 (#89)
1a7ee20 CLAUDE.md: fix pre-existing documentation-accuracy errors (#88)
35fd187 Fix DATA wildcard skipping historical full-install version scripts (Postgres-Extensions#48) (#80)
f9ce2a2 Fix installcheck running before install; make test now fails on regressions (#83)
3ceb930 Rename PGTLE_VERSION to PGXNTOOL_PGTLE_VERSION (#85)
2de8429 claude-code-review.yml: add missing --comment flag (#84)
957bdf6 Restrict @claude mention trigger to a trusted account (#82)
b67064b Release 2.2.0 (#77)
d949d6d Fix stale README/CLAUDE.md docs; rename internal-only test shim (#76)
6d7822c ci: grant actions:write so bun cache save succeeds (#75)
2738f59 README.asc: fix stale docs, document undocumented API surface (#74)
d1d3bee Add make pgxntool-version to print the embedded pgxntool version (#73)
493a0f8 Fix parallel-build SQL corruption, remote hardcoding, and add safety checks (#61)
3b0e3de Fix make pgtle PGTLE_VERSION=X being silently ignored (#66)
21b35ef ci: skip paired-test-PR requirement for doc-only PRs (#71)
55efd03 Rename EXTENSION_VERSION_FILES to EXTENSION__CURRENT_VERSION__FILES (#69)
9d0a856 Fix pgtle.sh rejecting non-numeric version aliases like 'stable' (Postgres-Extensions#57) (#63)
9c2f75f Docs: versioned SQL file tracking tradeoffs and update-testing pattern (#60)
c38cf2a ci: never check out fork PR head in claude-code-review pull_request_target job (#70)
aab8f2b pgtle_versions.md: fix wrong uninstall_extension() version claim (#59)
e2c9174 README.asc: make tag creates a git tag, not a branch (Postgres-Extensions#58)
eb84bc6 Stamp 2.1.0
9fbe6f4 Fix results ordering, control file whitespace, ENABLE_* override, debug levels (Postgres-Extensions#31)
88bb4f2 Add Claude Code GitHub Actions workflows (Postgres-Extensions#41)
af5bbbb ci: pass repo owners to run-tests.yml for fork-account matching (Postgres-Extensions#40)
c7928af Fix repo-root guard to work inside a git worktree (Postgres-Extensions#39)
b062fca ci: point reusable test workflow at @master
b6cdbfd Add CI workflows and multi-session PR guard (Postgres-Extensions#33)
1ba0987 Stamp 2.0.3
1931cbe Fix pgxntool-sync remote and make it runnable without make (Postgres-Extensions#37)
8176304 Stamp 2.0.2
3e142ab Fix parse_control_file: remove comments before stripping quotes (Postgres-Extensions#27)
cacc301 Stamp 2.0.1
bf1db6b Fix bash 3.2 / Linux compatibility issues (Postgres-Extensions#26)
62d0fcb Fix broken ifeq for --load-language=plpgsql on PG < 13 (Postgres-Extensions#24)
121f0b3 Stamp 2.0.0
ad3ca7e Remove .source support; add test/install, test/build, and verify-results (Postgres-Extensions#18)
c010cf8 Fix bash 3.2 compatibility (Postgres-Extensions#23)
abeb9d3 Remove .source file support from pg_regress integration (Postgres-Extensions#22)
08c1879 Stamp 1.1.2
6e0dad2 Fix double --dbname bug that defeated unique test database names
639756c Stamp 1.1.1
6ba3176 Fix pg_tle exception handler and empty upgrade files (Postgres-Extensions#15)
3b8cb2a Stamp 1.1.0
550a901 Remove commit.md (maintained in pgxntool-test)
d73ca93 Add unique test database names to prevent conflicts (Postgres-Extensions#13)
9b344be Add update-setup-files.sh for 3-way merging after pgxntool-sync (#12)
ab7f6e2 Stamp 1.0.0
3a571ba Add pg_tle support and modernize test infrastructure (#11)
b96ea6d Add support for Claude code; build and doc improvements (#9)
e9c24de Fix pg_regress on versions > 12 (#5)

git-subtree-dir: pgxntool
git-subtree-split: a6d3287e879c45aa0c9a32c6f9513312396c8915
…cratch DESTDIR

pgxntool 2.3.0 fixed issue #79 (installcheck running before install) by
making installcheck unconditionally depend on install in base.mk -- with no
opt-out. That reintroduces the problem TEST_EXISTING_DEPLOY=pgtle mode exists
to avoid: calling installcheck directly now also runs install, which would
write cat_tools.control to the real extension directory even though the
database under test was deployed via pg_tle, tripping bin/assert_fs_clean.

Redirect install's filesystem writes to a throwaway DESTDIR instead of trying
to skip it: existing mode's pg_regress run never exercises install's output
(the extension is already present in the database via pg_tle), so where
install's side effect lands doesn't matter, as long as it isn't the real
extension directory. Verified locally: real extension directory's cat_tools
files are byte-for-byte unchanged (compared by checksum) after a full
TEST_EXISTING_DEPLOY=pgtle run-suite invocation, and all 14 tests still pass.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 614a65fc-23a7-4acf-9251-ccfe3b392148

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…ater

Points at the specific lines to remove once pgxntool grows a real
install-skip override (pgxntool#55), not just the top-of-file doc comment.
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

Code review

3 issues found. (Note: inline line comments were not available in this environment, so findings are consolidated here with direct links to the relevant lines.)

1. DESTDIR redirect reintroduces a real, live pgtap install (significant)

cat_tools/bin/test_existing

Lines 258 to 265 in 304b4f3

local pgtle_destdir
pgtle_destdir=$(mktemp -d)
make testdeps $existing_args
make installcheck $existing_args DESTDIR="$pgtle_destdir"
local testout
testout=$(make -s print-TESTOUT 2>/dev/null | sed -n 's/.*set to "\(.*\)"$/\1/p')
pgxntool/verify-results-pgtap.sh "$testout"
rm -rf "$pgtle_destdir"

The new DESTDIR="$pgtle_destdir" override on make installcheck does not achieve the filesystem isolation it is meant to provide. pgxntool/base.mk (untouched by this PR) has:

installcheck: pgtap
pgtap: $(DESTDIR)$(datadir)/extension/pgtap.control

$(DESTDIR)$(datadir)/extension/pgtap.control:
	pgxn install pgtap --sudo

installcheck depends on pgtap, whose prerequisite path incorporates DESTDIR, but the recipe itself (pgxn install pgtap --sudo) never reads DESTDIR -- it always installs into the real system extension directory. Since $pgtle_destdir is a fresh, empty mktemp -d directory, $(DESTDIR)$(datadir)/extension/pgtap.control can never exist there, so Make concludes pgtap is stale and runs pgxn install pgtap --sudo for real -- hitting sudo/network and writing to the actual system extension directory on every pg_tle-mode run. .github/workflows/ci.yml already documents this exact failure mode (confirmed happening in a real CI run) for the pg_tle jobs, which is why they pre-install pgtap via a dedicated make pgtap step before the baseline filesystem snapshot. This likely will not turn the job red (the reinstalled content matches what CI already installed), but the isolation this new comment block claims (a scratch DESTDIR keeps the real extension directory untouched) does not actually hold for the pgtap prerequisite.

Possible fix: seed $pgtle_destdir with a stub pgtap.control before the make installcheck call, or otherwise keep the pgtap prerequisite off the overridden DESTDIR.

2. Bare issue reference violates CLAUDE.md

# under test was deployed via pg_tle, not the filesystem, and must NEVER be
# filesystem-installed by anything this script does. pgxntool 2.3.0 fixed
# installcheck running before install (issue #79) by making `installcheck`
# itself unconditionally depend on `install` in base.mk -- so even calling
# `installcheck` directly (bypassing `test`) now runs `install` too, with no

Line 41 reads (issue #79) -- a bare issue number. Per this repos CLAUDE.md rule on PR/issue references, references inside committed files must be full URLs, never a bare #NN. bin/test_existing is cat_tools own authored file (not vendored pgxntool content), so the rule applies. Full URLs are used correctly elsewhere in this same comment block (lines 51 and 256), so this looks like an oversight rather than a deliberate choice.

Suggested fix: change (issue #79) to (https://github.com/Postgres-Extensions/pgxntool/issues/79).

3. Scratch DESTDIR leaks on the failure path (minor)

cat_tools/bin/test_existing

Lines 258 to 265 in 304b4f3

local pgtle_destdir
pgtle_destdir=$(mktemp -d)
make testdeps $existing_args
make installcheck $existing_args DESTDIR="$pgtle_destdir"
local testout
testout=$(make -s print-TESTOUT 2>/dev/null | sed -n 's/.*set to "\(.*\)"$/\1/p')
pgxntool/verify-results-pgtap.sh "$testout"
rm -rf "$pgtle_destdir"

$pgtle_destdir is only cleaned up by the plain rm -rf at the end of this block. The script runs under set -euo pipefail (line 69), and this is exactly the path where make installcheck / verify-results-pgtap.sh exit non-zero on genuine test failures -- a routine outcome here, not a contrived edge case. Any failure between mktemp -d and the final rm -rf aborts the script before cleanup runs, leaking the temp dir (a full scratch extension install tree). Low impact since this runs in ephemeral CI containers, but also affects local developer runs against a scratch DB.

Suggested fix: add a trap right after mktemp -d, e.g. trap 'rm -rf "$pgtle_destdir"' EXIT (use EXIT, not RETURN -- under errexit the script exits directly rather than returning from the function normally, so a RETURN trap would not fire here), and drop the now-redundant trailing rm -rf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant