Real update path: recover 0.1.1, author 0.1.1→stable diff (depends on #26 for the stable rename) - #22
Draft
jnasbyupgrade wants to merge 3 commits into
Draft
Real update path: recover 0.1.1, author 0.1.1→stable diff (depends on #26 for the stable rename)#22jnasbyupgrade wants to merge 3 commits into
jnasbyupgrade wants to merge 3 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
changed the base branch from
test-install-foundation
to
rename-1.0.0-to-stable
August 4, 2026 22:53
jnasbyupgrade
force-pushed
the
real-update-path
branch
from
August 4, 2026 22:53
cc69f19 to
2e36592
Compare
…, 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>
extension_drop's real 0.1.1 install script (2017) was never committed to this repo -- only ever generated as a PGXN dist build artifact and uploaded directly -- so no update-diff script has ever existed either, despite a real SQL change between 0.1.1 and the current `stable` source (removing redundant client_min_messages handling; see #24, which renamed default_version from the never-released "1.0.0" to `stable` and is a prerequisite for this branch). That left anyone who actually installed 0.1.1 from PGXN with no path forward at all. - Recover the real 0.1.1 sql/extension_drop.sql from PGXN's dist archive (https://api.pgxn.org/dist/extension_drop/0.1.1/extension_drop-0.1.1.zip) and commit it as sql/extension_drop--0.1.1.sql. Add it to DATA explicitly (pgxntool's DATA wildcard only picks up the current version file and two-dash update scripts, not other historical single-version files -- Postgres-Extensions/pgxntool#48). - Author sql/extension_drop--0.1.1--stable.sql: the actual delta is just extension_drop__event_trigger() gaining one RAISE DEBUG line (found by diffing recovered 0.1.1 against current source). The client_min_messages removal and a cat_tools function rename (function__arg_types_text -> routine__parse_arg_types_text) both turned out to be install-script-only behavior with nothing persisted to replay. - Default TEST_UPDATE_FROM to 0.1.1 and wire up a real extension-update-test CI job: installs 0.1.1, plants the dependency guard, runs ALTER EXTENSION UPDATE, re-proves the guard survived, dynamically asserts the version landed at stable, then runs the pgTAP suite in update mode. Factored into bin/test_update_path.sh so it's runnable locally, not just inline CI YAML. Verified locally against PG17: 0.1.1 install -> guard blocks non-CASCADE drop -> ALTER EXTENSION UPDATE -> guard still blocks drop -> version lands at 'stable' -> full pgTAP suite passes in both fresh and update modes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jnasbyupgrade
force-pushed
the
real-update-path
branch
from
August 4, 2026 23:12
2e36592 to
3add6cc
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#7 to enable a native same-repo stacked PR (bases off
test-install-foundation, which now exists directly onPostgres-Extensions/extension_tools). Original PR: jnasbyupgrade#7Update: This PR previously also did the
default_versionrename (1.0.0->stable) inline. That's been split out into #26 at the owner's request, since it's a separate, independently-mergeable concern (pure versioning/docs) from the update-path testing infrastructure below. This PR's base is nowrename-1.0.0-to-stable(#26's branch) instead oftest-install-foundationdirectly, since the update-path testing work here genuinely depends on both: thetest/install/harness fromtest-install-foundation(#19) and thestablerename from #26 (the update-diff script's target, and whatbin/test_update_path.shasserts the version lands at). Sincerename-1.0.0-to-stablebranches offfix-cat-tools-installas a sibling oftest-install-foundationrather than stacking under it, this PR's "Files changed" tab will showtest-install-foundation's own files too until #19 merges (a GitHub diff-scoping artifact of depending on two sibling branches at once, not new/duplicated content) -- it no longer shows anydefault_version/HISTORY.asc/META changes, since those now live solely in #26.Summary
extension_drop's real 0.1.1 install script (2017, its only actual PGXN
release) was never committed to this repo -- only ever generated as a
build artifact and uploaded directly to PGXN. As a result, no update-diff
script has ever existed either, despite a real SQL change between 0.1.1
and the current
stablesource (the client_min_messages removal inHISTORY.asc). Anyone who actually installed 0.1.1 from PGXN had, and
until this PR merges still has, no
ALTER EXTENSION UPDATEpath forwardat all.
This is real, valuable, buildable-right-now work -- it does not depend on
cat_tools shipping a real PGXN 0.3.0, or on this extension being formally
released. It only rides on this branch stack because CI needs cat_tools
installed from git-source (already solved by the base of this stack)
rather than PGXN, and because it needs the
stablerename (#26) to knowwhat to update to.
What's in this PR
Recovered the real 0.1.1 install script from PGXN's dist archive:
https://api.pgxn.org/dist/extension_drop/0.1.1/extension_drop-0.1.1.zip(URL confirmed working, confirmed against
https://api.pgxn.org/dist/extension_drop.json). Committed byte-for-byteas
sql/extension_drop--0.1.1.sql. AddedDATA += sql/extension_drop--0.1.1.sqlto the Makefile -- pgxntool's
base.mkDATAwildcard only picks up thecurrent version file plus two-dash update scripts, not other historical
single-version files (already filed as
Postgres-Extensions/pgxntool#48).The actual delta, found by diffing recovered 0.1.1 against current
sql/extension_drop.sql, turned out to be three things, only one ofwhich needs replaying in an update script:
extension_drop__event_trigger()gained oneRAISE DEBUGline atentry -- a real, persisted function body change. This is the only
thing
sql/extension_drop--0.1.1--stable.sqldoes (a singleCREATE OR REPLACE FUNCTION).client_min_messagessave/restore removal HISTORY.asc alreadydocuments -- but that code only ever ran inside the install script's
own session and never left anything in the extension's persisted
state, so an already-installed 0.1.1 has nothing to clean up here.
function__arg_types_text->routine__parse_arg_types_text, not previously documented inHISTORY.asc -- found via
git log -Sonsql/extension_drop.sql,landed in the "Fix misnamed function call" part of Switch to GitHub Actions and update pgxntool #1) -- but that
call only happens transiently inside the install script's internal
__extension_drop.create_function()builder to compute REVOKE/GRANTargument lists; it's never stored in any persisted function body, so
it doesn't affect an already-installed 0.1.1 either. (Also: cat_tools
0.3.0 keeps the old name as a deprecated wrapper, so a fresh
CREATE EXTENSION extension_drop VERSION '0.1.1'still works today fortesting this exact path.)
default_versionrename (1.0.0->stable) now lives in Rename default_version from 1.0.0 to stable #26, nothere -- see that PR for details. This PR's update-diff script
(
sql/extension_drop--0.1.1--stable.sql) andbin/test_update_path.shboth depend on it having landed.
Wired up a real, CI-exercised update-path leg.
TEST_UPDATE_FROMnow defaults to
0.1.1(previously required explicitly, with no safedefault, since there was nothing real to point it at). Added
bin/test_update_path.sh, a committed/parameterized script (not inlineYAML) that: installs 0.1.1, plants the dependency-guard view, proves a
non-
CASCADEDROP EXTENSIONis blocked, runsALTER EXTENSION extension_drop UPDATE, re-proves the guard still blocks the drop, anddynamically asserts (empty-value-guarded, not hardcoded) that the
installed version now matches
extension_drop.control'sdefault_version. The newextension-update-testCI job runs thisscript, then
make test-updateto run the full pgTAP suite (includingdependency_guard) against the updated result.This job runs as a single job on PG17 rather than a second full PG
matrix: extension_drop's install/update scripts have nothing
catalog-version-sensitive in them (no
pg_upgrade/omit_column-styleconcerns), so it's a PG-version-agnostic, SQL-level concern layered onto
the matrix approach the rest of this stack already uses, not something
that needs its own axis.
Local verification (PG17, this container)
Test plan
ALTER EXTENSION UPDATE-> lands atstable-> dependency guard survives -> full pgTAP suite passes(update mode)
stable) still passes thefull suite
testmatrix (fresh install, PG 9.3-17) stays greenextension-update-testjob passes