Structural fresh-vs-update comparison, wired into test and pg-upgrade-test - #33
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. |
8647cf9 to
dffacb8
Compare
4c3ea52 to
dca71f7
Compare
6b45ca9 to
995dced
Compare
6146766 to
c41e8f5
Compare
01e6d51 to
d26f9b7
Compare
c41e8f5 to
30073d0
Compare
d26f9b7 to
1d942ca
Compare
30073d0 to
1ff9811
Compare
1d942ca to
1694173
Compare
6277cd3 to
7ce4954
Compare
08f22cf to
7207912
Compare
7ce4954 to
73ce64e
Compare
7207912 to
d76ac58
Compare
73ce64e to
1858473
Compare
d76ac58 to
a24874f
Compare
1858473 to
1a11083
Compare
a24874f to
4d0f14c
Compare
1a11083 to
bd14a70
Compare
4d0f14c to
f96fb78
Compare
bd14a70 to
4008107
Compare
f96fb78 to
293db9f
Compare
4008107 to
00371d9
Compare
293db9f to
ee0f795
Compare
c8bf327 to
aed095e
Compare
8a8f05f to
412c933
Compare
aed095e to
019e3ee
Compare
412c933 to
c159d3d
Compare
019e3ee to
5a9fde3
Compare
c159d3d to
f3da5c0
Compare
5a9fde3 to
449633a
Compare
f3da5c0 to
6e3cca1
Compare
449633a to
0211525
Compare
6e3cca1 to
508e17a
Compare
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. |
ae463a2 to
1a833cd
Compare
|
Claude finished @jnasbyupgrade's task in 4m 19s —— View job Code review: PR #33 (Structural fresh-vs-update comparison + convergence/divergence report)Task list
SummaryThe bulk of the diff against What's new in
|
508e17a to
8d88a17
Compare
1a833cd to
ffe07ed
Compare
|
Claude finished @jnasbyupgrade's task in 2m 31s —— View job Code review: PR #33 (Structural fresh-vs-update comparison + convergence/divergence report)Task list
SummaryReviewed the current tip ( Still open from prior review passesBoth of these were flagged in the 2026-08-09 automated review of commit
New observation
VerdictNo blockers. The two previously-flagged nits remain unaddressed after two review passes on this branch, plus one new informational observation on |
…l design Rebuild bin/compare_fresh_vs_update (the structural fresh-vs-update diff tool added on the now-closed phase5/6 branches) directly on master's current random-schema test install mechanism (test/helpers/create_test_schema.sql), replacing its old SCHEMA CLI argument and TEST_SCHEMA-based looping, both now gone from the rest of the codebase. The script always generates ONE randomly named schema up front - same naming convention as create_test_schema.sql: a constant `count_nulls test schema ` prefix (trailing space included, forcing SQL identifier quoting) plus a random suffix - and installs BOTH the fresh and updated copies into that SAME schema, via CREATE SCHEMA + CREATE EXTENSION ... WITH SCHEMA rather than mutating search_path first. A single shared schema is required, not incidental: pg_get_functiondef()'s output is schema-qualified, so two independently named schemas would show a spurious schema-name difference instead of isolating real update-vs-fresh divergence, which is the whole point of the comparison. Each of the two scratch databases also gets a defensive DROP SCHEMA ... CASCADE sweep for any stale `count_nulls test schema %`-prefixed leftover before creating its own, matching create_test_schema.sql's cleanup-before-create convention. ci.yml's `test` job now invokes the script once per run instead of looping it over the old two-value TEST_SCHEMA axis; test/README.md documents it in the suite's file layout. Modeled on the manual technique used in Postgres-Extensions/cat_tools#46, which found a real bug this way (a pre-0.2.2 update path left `EXECUTE PROCEDURE` hardcoded where a fresh install already used `EXECUTE FUNCTION`). Postgres-Extensions/cat_tools#67 proposes generalizing this exact capability into a real, user-facing cat_tools feature rather than test-only plumbing tied to one extension. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ffe07ed to
b1bc394
Compare
|
Claude finished @jnasbyupgrade's task in 1m 34s —— View job Code review: PR #33 (Structural fresh-vs-update comparison + convergence/divergence report)Task list
SummaryNew commit Previously-flagged issues — now resolved
Re-verified still-correct behavior
VerdictNo blockers, no open issues. All prior nits are resolved and no new problems were introduced by this commit. |
…de-test Extends bin/compare_fresh_vs_update with an EXISTING_DB argument so it can structurally diff an already-populated database against a fresh install, instead of only ever creating+updating its own scratch database. This lets pg-upgrade-test's twin databases (upgrade_oldest_first/upgrade_current_first, migrated by a real binary pg_upgrade) reuse the same comparison tool the test job's update leg already uses, rather than duplicating that logic. Since EXISTING_DB was installed independently (its own call to test/helpers/create_test_schema.sql, generating its own random schema), the fresh install this script creates for the comparison discovers and reuses that same schema instead of generating a new one - both sides still need to land in the same schema for the comparison to isolate real divergence rather than a spurious schema-name difference. The scratch-vs-scratch mode (no EXISTING_DB) drops schema handling entirely instead of gaining a second randomly-named schema to match: this script's job in that mode is proving fresh-vs-update parity, not exercising schema-qualification or quoting (test/helpers/create_test_schema.sql's job, used by the rest of the suite), so a plain unqualified `CREATE EXTENSION count_nulls` - landing in whatever the session's default resolves to, ordinarily `public` - is exactly as good for comparing definitions, since both installs still land in the SAME place by construction. The stale-schema cleanup sweep goes with it for that mode too: this script's scratch databases are always brand-new, uniquely-named ones created via createdb, which already fails loudly if a stale one exists, an adequate safety net without a schema-level sweep on top of it. install_extension() is therefore now two functions - install_extension_scratch() (no schema at all) and install_extension_matching_schema() (EXISTING_DB mode's own discover-and-match logic, unchanged, just carved into its own function). pg-upgrade-test's CI job now runs this comparison against both twin databases right after run-suite confirms they're at the current version; test/README.md and the test job's own step comment are updated for the new default-schema scratch behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Claude finished @jnasbyupgrade's task in 2m 38s —— View job Code review: PR #33 (Structural fresh-vs-update comparison + convergence/divergence report)Task list
Summary
What I checked specifically
Prior-round findingsAll three issues raised across earlier automated reviews on this branch (the VerdictNo blockers, no open issues. |
Adds bin/compare_fresh_vs_update, a standalone script that structurally compares every object count_nulls owns between a fresh install and an updated one, catching update-script divergence a fixed pgTAP suite has no way to know to assert. It diffs pg_get_functiondef(), each object's comment, and its ACL for every object pg_depend records as owned by the extension - discovered live, not a hardcoded list, so a newly added function is automatically covered without editing this script.
Both installs it creates itself use a plain, unqualified
CREATE EXTENSION count_nulls, so they land in the same default schema (ordinarilypublic) by construction - enough to compare object definitions without needing the main suite's schema-randomization/quoting machinery, which serves a different purpose (proving qualification-correctness, in test/helpers/create_test_schema.sql).The script also accepts an optional EXISTING_DB argument to compare a fresh install against an already-populated database instead of creating and updating its own scratch one. Since that database's schema was chosen by whatever created it, the fresh install discovers and reuses that same schema rather than generating a new one, so both sides still land in the same place.
Wired into CI in two places: the
testjob's update leg (bin/compare_fresh_vs_update 0.9.6, once per push) andpg-upgrade-test, which passes each of its twin real-pg_upgraded databases as EXISTING_DB. Both catch the same divergence class the fixed pgTAP suite doesn't - an object left subtly different (body, comment, ACL) by an update path, whether an in-place ALTER EXTENSION UPDATE or a real binary pg_upgrade.Modeled on the manual technique used in Postgres-Extensions/cat_tools#46, which found a real bug this way (a pre-0.2.2 update path left
EXECUTE PROCEDUREhardcoded where a fresh install already usedEXECUTE FUNCTION). Postgres-Extensions/cat_tools#67 proposes generalizing this exact capability - listing every object an extension owns along with each object's actual definition - into a real, user-facing cat_tools feature rather than test-only plumbing tied to one extension's update path.