ci: pg_tle deployment smoke test for extension_drop (chained on cat_tools) - #21
Draft
jnasbyupgrade wants to merge 5 commits into
Draft
ci: pg_tle deployment smoke test for extension_drop (chained on cat_tools)#21jnasbyupgrade wants to merge 5 commits into
jnasbyupgrade wants to merge 5 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This was referenced Aug 4, 2026
jnasbyupgrade
force-pushed
the
test-install-foundation
branch
2 times, most recently
from
August 6, 2026 17:13
43749f2 to
187577a
Compare
jnasbyupgrade
force-pushed
the
pg-tle-ci
branch
from
August 6, 2026 17:16
bec94b0 to
d97994b
Compare
jnasbyupgrade
force-pushed
the
test-install-foundation
branch
from
August 6, 2026 21:05
3fcef44 to
8f4e50d
Compare
jnasbyupgrade
force-pushed
the
pg-tle-ci
branch
from
August 6, 2026 21:08
d97994b to
7ebe9c1
Compare
zzz_build.sql hand-rolled exactly what pgxntool's test/build/ already does natively: run the raw install script directly (not via CREATE EXTENSION) for better error messages than a bare CREATE EXTENSION failure. Postgres-Extensions/cat_tools already made this exact move. Also fixes the flaky expected-output problem that came with the old approach: zzz_build.sql ran client_min_messages unsuppressed, so its expected output captured verbose, PG-minor-version-dependent NOTICEs (e.g. "%TYPE converted to ..." with a source-file LOCATION line) -- any environment/PG-version drift showed as a spurious diff. test/build runs as its own separate installcheck invocation with client_min_messages = WARNING (matching cat_tools's own build.sql), so the expected output is stable and empty. PGXNTOOL_ENABLE_TEST_BUILD set explicitly (yes) rather than left to auto-detect, so an accidental future deletion of test/build/'s contents is a hard error instead of the check silently vanishing.
…, quoting-requiring schema test Builds the U&U (update & upgrade) test infrastructure that doesn't require a real second extension_drop version or pg_upgrade CI to already exist: - PGXNTOOL_ENABLE_TEST_INSTALL = yes, with test/install/load.sql as the committed-once installer for the extension (no test roles exist for this extension, so unlike cat_tools there's nothing role-related to add). - TEST_LOAD_SOURCE (fresh/update/existing) GUC/make-var switch, parse-time validated, exported unconditionally, read in load.sql without missing_ok. `existing` mode is fully exercised locally (verified against a real, already-installed database, including the failure path when the extension is genuinely absent). `update` mode is wired up and structurally verified end-to-end, but extension_drop has no real prior released version to update FROM yet -- the Makefile refuses to run it without TEST_UPDATE_FROM set explicitly, and no CI leg exercises it in this repo today. - Dependency guard (test/sql/dependency_guard.sql): a view depending on extension_drop__commands' row type blocks a non-CASCADE DROP EXTENSION; proven by actually attempting the drop and asserting failure, not assumed. - test/sql/schema.sql's custom-schema test names renamed to mixed case (requires identifier quoting), reusing its existing coverage rather than adding a new schema-testing dimension. - ci.yml: run `make test && make verify-results` instead of pg-build-test, so a real regression actually fails the build (pgxntool's .IGNORE: installcheck otherwise reports green regardless of test results, per RELEASE.md's existing note about PRs #6/#7). Moving the extension's own installation into test/install/load.sql required adapting every test file that used to install it per-test in a rolled-back transaction (test/deps.sql, test/sql/simple.sql, test/sql/schema.sql, test/sql/zzz_build.sql) to work against the new committed-once install instead, since an extension name is a database-wide singleton. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…redate this branch CI on this branch showed the switch to `make test && make verify-results` surfacing real pgTAP failures on PostgreSQL 9.3/9.6 (cat_tools/extension_drop never actually install there). Checked PR #10's own baseline CI (#10, run 30665031257): PG 9.3 and 9.6 already report "3 of 3 tests failed" in the raw job log there too, just silently reported as a passing check because pg-build-test's underlying `make test` hits pgxntool's `.IGNORE: installcheck` the same way. So this isn't a regression from this PR's own changes -- it's the exact masking problem RELEASE.md already documents, just now applying to a different, older part of the PG matrix than the PRs (#6/#7) it originally cites. Reverting the ci.yml step back to pg-build-test here keeps this PR scoped to test/install infrastructure; fixing cat_tools's install path on pre-PG10 belongs to whoever owns that dependency setup (PR #10 or a follow-up), not this PR. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jnasbyupgrade
force-pushed
the
test-install-foundation
branch
from
August 6, 2026 23:03
8f4e50d to
67855c7
Compare
…at_tools) Proves extension_drop can be deployed with zero filesystem footprint via pg_tle (AWS's Trusted Language Extensions), the same fresh-install proof cat_tools' own pg-tle-test job (PR #47) does for itself -- but extension_drop REQUIRES cat_tools, so this job also registers cat_tools as a pg_tle extension first (a leaf extension's pg_tle test never has to solve chained dependency resolution). Every step that could write an extension file to disk is bracketed by a new bin/assert_fs_clean check (modeled on cat_tools' script of the same name), since a stray filesystem .control file silently wins over a pg_tle registration of the same name. Verified end to end locally: built pg_tle 1.5.2 from source, registered pg_tle+cat_tools+extension_drop against template1, CASCADE-installed extension_drop in a smoke database, and called extension_drop__add/__get/ __remove against a real installed extension -- all with zero filesystem control files present throughout (confirmed via bin/assert_fs_clean). Explicitly out of scope: the update path via pg_tle (extension_drop has no prior released version to update from yet) and binary pg_upgrade of a pg_tle-deployed extension -- both noted as follow-up work in the PR.
jnasbyupgrade
force-pushed
the
pg-tle-ci
branch
from
August 6, 2026 23:06
7ebe9c1 to
4dd1d8a
Compare
jnasbyupgrade
force-pushed
the
test-install-foundation
branch
3 times, most recently
from
August 7, 2026 22:14
2925fca to
03b0355
Compare
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.
Migrated from fork-internal PR jnasbyupgrade#5 to enable a native same-repo stacked PR (bases off
test-install-foundation, which now exists directly onPostgres-Extensions/extension_tools). Original PR: jnasbyupgrade#5Summary
Adds a
pg-tle-testCI job that provesextension_dropcan be deployed withzero filesystem footprint, via pg_tle (AWS's Trusted Language Extensions
— a database-backed catalog for installing an extension with no
.controlfile on disk; relevant for RDS/Aurora-style managed deployments). This is a
third deployment dimension, orthogonal to the fresh/update/existing testing
this stack already added in
test-install-foundation— not how theextension got there across time, but filesystem-installed vs. registered
purely through pg_tle's catalog.
This branch stacks on:
test-install-foundation(fork-internal, this PR's base) —test/install/load.sql,TEST_LOAD_SOURCE, the dependency guardfix-cat-tools-install(upstream draft Postgres-Extensions/extension_tools#10, transitively) — cat_tools installed from a pinned git ref because PGXN's published listing is a stale 2017 releaseThe chained-dependency gap this fills
The reference implementation for pg_tle testing is
Postgres-Extensions/cat_toolsPR #47'spg-tle-testjob — read directly fromcat_tools's currentci.yml, not just summarized. cat_tools is a leaf extension (no dependencies of its own), so its job never had to solve registering a chained dependency through pg_tle.extension_droprequires cat_tools (.control'srequires = 'cat_tools', and its own SQL callscat_tools.routine__parse_arg_types_text(...)), soCREATE EXTENSION extension_drop CASCADEonly resolves cleanly if cat_tools is also already registered as a pg_tle extension — otherwise the CASCADE either fails outright or (worse) silently resolves cat_tools from a stray filesystem install, defeating the whole point of the test. This job registers, in order:pg_tle→cat_tools(cloned fresh at the sameCAT_TOOLS_GIT_REFthe Makefile's own filesystemcat_toolstarget pins to, read viamake print-CAT_TOOLS_GIT_REFso the two never drift) →extension_drop(this repo's ownmake run-pgtle) — all againsttemplate1, before any database that needs them is created.What's taken from cat_tools verbatim / adapted / skipped
bin/assert_fs_clean(snapshot/verify subcommands, diffing*.controlfiles against a pre-pg_tle baseline) is modeled directly on cat_tools' script of the same name — same mechanism, same reasoning (a stray filesystem control file silently wins over a pg_tle registration of the same name; PostgreSQL never errors, it just resolves from disk). Comments rewritten to stand on their own rather than referencing cat_tools.pg-tle-testjob shape. The registration step is the real addition — cat_tools' equivalent step is a singlemake run-pgtle; this repo's is three ordered registrations (pg_tle,cat_tools,extension_drop) because of the dependency chain.ALTER EXTENSION UPDATEthrough pg_tle).extension_drophas no prior released version to update from yet —TEST_UPDATE_FROMhas no safe default (see the Makefile's own comment) — so there's nothing real to exercise. Straightforward to add once a real second version ships.pg_upgradeof a pg_tle-deployed extension (cat_tools'pg-tle-upgrade-test). A separate, heavier concern from a fresh-install smoke test.concurrency:group.test-fixes.md-style guidance recommends one, and this workflow doesn't have one yet, but a sibling fork branch (pg-upgrade-ci, same base) is concurrently adding its own job to this sameci.yml— to keep this PR a small, low-conflict diff I deliberately limited my changes to adding my own job plus wiring it intoall-checks-passed'sneeds:list, rather than also touching shared workflow-level YAML. Worth adding in a follow-up once both stacks have landed.changes/docs-only gate job — this repo doesn't have one yet; out of scope here.PG version matrix
Intersection of two independently-moving ranges, checked directly rather than assumed:
extension_drop's own tested range (testjob: 9.3–17) and pg_tle 1.5.2's supported PostgreSQL range (12–18, dropped PG11 — seepgxntool/pgtle_versions.md). Matrix is[12, 13, 14, 15, 16, 17]— 18 is left out since the existingtestjob doesn't cover it either.Local verification
Rehearsed the full flow end to end in this dev container (PG17, on a dedicated throwaway cluster created specifically for this — never touching the shared
main/pgupgradetestclusters other work in this container uses):shared_preload_libraries.CREATE EXTENSION pg_tleontemplate1; registered cat_tools (cloned atmaster, the currentCAT_TOOLS_GIT_REF) viamake run-pgtle, then this repo's ownextension_dropviamake run-pgtle— both againsttemplate1.createdb+CREATE EXTENSION extension_drop CASCADE— succeeded, withNOTICE: installing required extension "cat_tools"confirming CASCADE resolved the dependency through pg_tle.extversionmatchedmake print-PGXNVERSION(1.0.0) dynamically, and calledextension_drop__add/__get/__removeagainst a real installed extension (pg_tleitself) — a real function call, not just a successful install..controlfiles present throughout viabin/assert_fs_clean(this dev container actually already had stale filesystem installs of bothcat_toolsandextension_dropfrom earlier work in this repo, which — usefully — surfaced a real thing worth knowing: pg_tle's ownpgtle.install_extensionrefuses to register over a pre-existing filesystem control file of the same name, raisingcontrol file already exists for the ... extension. I briefly relocated just those two extensions' specific files to rehearse a clean registration, then restored them and confirmed viabin/assert_fs_cleandiff that the filesystem was back to its exact prior state, modulo the expected newpg_tle.controlfrom this rehearsal.)bin/assert_fs_cleanitself: confirmed it passes clean, fails when a synthetic stray.controlfile is injected, and passes again once removed.cd cat_tools_clone && git checkout ...would have persisted for the rest of thatrun:block (one continuous shell script), making the followingmake run-pgtle(meant for this repo) run inside the cat_tools clone instead. Fixed by using-Con bothgitandmakerather than a barecd.CI itself will be the final confirmation on a genuinely clean runner (no pre-existing filesystem installs to work around, unlike this dev container).
Test plan
pg-tle-testmatrix (PG 12–17) goes green on this PRall-checks-passedreflects the new job in itsneeds:listtest-install-foundation, itself based on the upstream draftfix-cat-tools-install)🤖 Generated with Claude Code