ci: pg_tle deployment smoke test for extension_drop (chained on cat_tools) - #21
Draft
jnasbyupgrade wants to merge 1 commit into
Draft
ci: pg_tle deployment smoke test for extension_drop (chained on cat_tools)#21jnasbyupgrade wants to merge 1 commit into
jnasbyupgrade wants to merge 1 commit into
Conversation
…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.
|
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
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