Structural fresh-vs-update comparison + convergence/divergence report - #33
Structural fresh-vs-update comparison + convergence/divergence report#33jnasbyupgrade wants to merge 2 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 |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
4c3ea52 to
dca71f7
Compare
6146766 to
c41e8f5
Compare
c41e8f5 to
30073d0
Compare
30073d0 to
1ff9811
Compare
6277cd3 to
7ce4954
Compare
7ce4954 to
73ce64e
Compare
73ce64e to
1858473
Compare
1858473 to
1a11083
Compare
1a11083 to
bd14a70
Compare
bd14a70 to
4008107
Compare
4008107 to
00371d9
Compare
00371d9 to
c8bf327
Compare
c8bf327 to
aed095e
Compare
aed095e to
019e3ee
Compare
019e3ee to
5a9fde3
Compare
5a9fde3 to
449633a
Compare
449633a to
0211525
Compare
…_update) Adds the one checklist item genuinely missing everywhere (cat_tools' own PR #46 only did this manually, uncommitted, per the design doc this whole series is based on): a script that installs fresh and 0.9.6-then-updated copies of count_nulls in their own scratch databases and diffs pg_get_functiondef/comments/ACLs for every object the extension owns (discovered live via pg_depend, not a hardcoded object list). Wired into extension-update-test as an automatic step, crossed with TEST_SCHEMA same as the rest of that job. Also scopes out extending pg-tle-test to the update path (documented inline, and filed as Postgres-Extensions/pgxntool#90): pgxntool 2.3.0's own fix for installcheck's ordering bug (#83) made installcheck unconditionally depend on install, which writes a real .control file to disk - defeating the entire point of proving a pg_tle deployment never touches the filesystem. There's currently no way to invoke the real pgTAP suite without a filesystem install happening first. The fresh-install pg_tle smoke test (already on master via #16) is unaffected, since it never calls installcheck. Verified locally against PG17: fresh/update x empty/Quoted all pass via make verify-results; bin/compare_fresh_vs_update reports identical definitions for both schema legs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ob name cat_tools#67 proposes generalizing this script's object-discovery-and- diff technique into a real cat_tools feature; note it as a natural follow-up. Also fix test/README.md's mention of the now-removed extension-update-test job (folded into test earlier in this stack).
0211525 to
ae463a2
Compare
|
Claude finished @jnasbyupgrade's task in 3m 36s —— View job Code review: PR #33 (Structural fresh-vs-update comparison + convergence/divergence report)Task list
SummaryReviewed the diff against What I checked specifically
No CLAUDE.md violations found (checked VerdictNo changes requested. The one item above is optional/informational, not a blocker. |
["", Quoted]TEST_SCHEMA matrix) is being replaced by the always-randomize-the-install-schema design in #55. This PR's own "genuinely novel" claim (crossing U&U with TEST_SCHEMA) and itsbin/compare_fresh_vs_updatewiring are built directly on top of that now-obsolete axis. Left open for reference only.Stacked on #32 (phase 5: crossing U&U with schema). Last PR in this series - adds the one remaining checklist item that had no precedent anywhere in the org, and closes out with the convergence/divergence writeup this whole exercise was actually meant to produce.
What changed
bin/compare_fresh_vs_update: installs fresh and 0.9.6-then-updated copies of count_nulls in scratch databases and diffspg_get_functiondef/comments/ACLs for every object the extension owns (viapg_depend, not a hardcoded list). Wired intoextension-update-testautomatically, crossed withTEST_SCHEMAsame as the rest of that job.pg-tle-testto the update path, and said so explicitly rather than silently skipping it: pgxntool 2.3.0's own fix forinstallcheck's ordering bug (Fix installcheck running before install; make test now fails on regressions pgxntool#83, landed in Update pgxntool to 2.3.0 #25) madeinstallcheckunconditionally depend oninstall, which writes a real.controlfile to disk - defeating the entire point of a pg_tle-deployment test. Filed as installcheck's new install prerequisite (fix for #79) closes off testing a filesystem-install-free deployment (e.g. pg_tle) pgxntool#90.Convergence/divergence report
This whole series (#25-#32) started from a design doc built around porting cat_tools PR #16's U&U testing pattern more or less directly. Partway through, the actual work diverged significantly - worth recording explicitly, since that's the real signal for what's generic (belongs in pgxntool) vs. specific to one repo's history.
Taken essentially verbatim, from pgxntool/README.asc's own documented pattern (not cat_tools directly - see below): the
TEST_LOAD_SOURCE/TEST_SCHEMAGUC-propagation mechanism (PGOPTIONS->current_setting(), read withoutmissing_ok), the dependency-guard technique (plant + actively prove a blocked non-CASCADE drop, re-prove after every step), thechangesjob's docs-only gate and single-source PG-major derivation, and thetest/installself-comparing-output convention (don't trackload.out- correctness comes from the SQL failing loudly, not a textual diff).What actually diverged from the original plan, and why:
test/install, not per-test-filedeps.sqlGUCs. The first draft of this work (PR Add full update+upgrade test harness (TEST_LOAD_SOURCE/TEST_SCHEMA, bin/test_existing, pg-upgrade-test/extension-update-test) #23, now closed) ported cat_tools'bin/test_existing-heavy pattern almost directly, threadingTEST_LOAD_SOURCE/TEST_SCHEMAthroughtest/deps.sql- which runs inside a per-test rolled-back transaction, so an in-placeALTER EXTENSION UPDATEthere never actually commits (silently untested against the one thing that matters most: real production behavior).pgxntool/README.asc's own "Update & Upgrade (U&U) Testing" section (which the earlier draft hadn't read closely enough) says this outright, and - strikingly - cites this very repo's own old code as the example of what NOT to copy (a plpgsql-function-assertion style that "adds complexity of its own"). Restarted from scratch ontest/installinstead.TEST_SCHEMAwith the rest of the suite. Rebuildingcore/functions.sql's pgTAP call descriptions to never embed the literal schema name (while still using it in the actual executed SQL, viancs()) reduced that to ONE alternate, for a genuinely different reason (whether there's a schema to clean up, not an artifact of how the extension landed there).bin/test_existingshrunk to two subcommands. Oncetest/installcould handle fresh AND update entirely inside one committed pg_regress session,extension-update-testneeded no external script at all - justmake test-update.bin/test_existingnow exists ONLY for the one thing that genuinely can't live inside pg_regress: a real binarypg_upgraderun.DATAwildcard gap,PGTLE_VERSIONcollision) and changed a documentedmake testexit-code assumption the whole design leaned on.Genuinely novel, no precedent anywhere in the org (checked directly - see #32): crossing U&U (
extension-update-test,pg-upgrade-test) withTEST_SCHEMA. Neither cat_tools nor extension_tools does this. Made possible - not just easier - by the schema-invariant-description design above: without it, this would have meant a combinatorial expected-file explosion instead of zero new files.Skipped, deliberately: the pg_tle update-path extension (see above, blocked upstream). The every-major
pg-upgrade-stepwiseclimb (count_nulls has no catalog-touching views/functions - nothing version-sensitive to break at a specific PG-major boundary, so the two big-jumppg-upgrade-testlegs already cover the real risk).Filed upstream along the way, as real findings from doing this work, not tangential: Postgres-Extensions/pgxntool#86 (agents have no lightweight way to discover README.asc's relevant sections without reading the whole thing), Postgres-Extensions/pgxntool#90 (the installcheck/install regression above).
Verification
Locally against PG17: all four combinations (fresh/update × empty/Quoted schema) pass via
make verify-results;bin/compare_fresh_vs_updatereports identical object definitions for both schema legs.