Skip to content

Adapt to pgxntool 2.4.0 and fix tests for current PostgreSQL - #3

Merged
jnasbyupgrade merged 19 commits into
masterfrom
pgxntool-update
Oct 26, 2026
Merged

jnasbyupgrade merged 19 commits into
masterfrom
pgxntool-update

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Adapts trunklet-format to the vendored pgxntool 2.4.0 (merged in #6) so make test actually runs and passes on current PostgreSQL. The old base.mk passed --load-language=plpgsql to pg_regress, which PostgreSQL 13 and later reject, and ignored installcheck errors, so make test exited 0 without running any test. pgxntool 2.4.0 runs the suite and exits non-zero on regressions.

Changes needed in trunklet-format:

  • Makefile: removed the local asciidoc rules; base.mk now builds and installs docs itself, and keeping both made make install fail with "will not overwrite just-created".
  • test/expected/base_94*.out, base_95*.out, base_961.out: removed; they have no matching test/sql file and fail pgxntool's stale-expected check.
  • test/sql/base.sql: every multi-row test input is now read through an ORDER BY on explicit positions, so pgTAP test numbers don't depend on the join order the planner picks. (PostgreSQL 17 joined the threw checks' inputs in the other order.)
  • test/load.sql, test/deps.sql, test/sql/{build,reload,search_path}.sql: terse verbosity is set only around the statements that create the extension. extension_drop's install script calls function__arg_types_text() from cat_tools 0.3.0 (which extension_drop pulls in), and that prints a deprecation warning; with verbose output the warning gets a LOCATION: line whose pl_exec.c line number differs between PostgreSQL majors.
  • test/expected/*.out: regenerated with make results (the warning is pinned without its LOCATION: line). Output contains no not ok.

make test passes locally on PostgreSQL 12 and 17. The stacked PR #4 adds CI and raises the supported floor to PostgreSQL 12; its run on top of this branch passes on PostgreSQL 12 through 18, for both a fresh install and the update from 0.2.0 (run 40230691469).

🤖 Generated with Claude Code

jnasbyupgrade and others added 2 commits October 25, 2026 14:10
The old pgxntool passed `--load-language=plpgsql` to pg_regress, which
PG17 rejects, and ignored installcheck errors, so `make test` exited 0
without running anything. pgxntool 2.4.0 runs the suite and fails on
regressions, which surfaced:

- Makefile: drop the local asciidoc rules; `base.mk` now builds and
  installs docs itself, and keeping both made `make install` fail with
  "will not overwrite just-created".
- test/expected: remove the `base_94*`, `base_95*` and `base_961` variant
  files, which have no matching `test/sql` file and fail pgxntool's
  stale-expected check. Regenerated the rest with `make results`: the
  installed trunklet now emits a `function__arg_types_text()` deprecation
  warning on load, and pgTap numbers the `threw` checks in `base` in a
  different order.
- sql/trunklet-format--0.2.0.sql: pgxntool now tracks the current
  version's generated install script instead of ignoring it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 20dad2d3-17d6-4cc1-9ae2-f4a54adc25c4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jnasbyupgrade
jnasbyupgrade added this pull request to stack #5 October 25, 2026 19:13
jnasbyupgrade and others added 4 commits October 25, 2026 14:27
trunklet's deprecation warning is printed with a `LOCATION:` line naming
a `pl_exec.c` line number, which differs between PostgreSQL majors, so
the expected output only matched one of them. `test/deps.sql` now sets
terse verbosity; expected output regenerated with `make results`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Order each multi-row test input explicitly (by WITH ORDINALITY / position
column, not by value) so pgTAP test numbers don't depend on the join
order the planner picks. Each throws_ok/is query reads an ordered
subquery or view as its only FROM item so ordering holds on 9.5.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Setting it in test/deps.sql applied it suite-wide. Only the statements
that create extensions emit the deprecation warning whose LOCATION line
varies by PostgreSQL version, so wrap just those.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jnasbyupgrade
jnasbyupgrade removed this pull request from stack #5 October 25, 2026 19:47
@jnasbyupgrade jnasbyupgrade changed the title Update pgxntool to 2.4.0 and fix tests for current PostgreSQL Adapt to pgxntool 2.4.0 and fix tests for current PostgreSQL Oct 25, 2026
@jnasbyupgrade
jnasbyupgrade changed the base branch from master to pgxntool-2.4.0 October 25, 2026 19:47
@jnasbyupgrade
jnasbyupgrade added this pull request to stack #7 October 25, 2026 19:47
Base automatically changed from pgxntool-2.4.0 to master October 25, 2026 19:55
Set default_version and the META.json versions to `stable`, so editing
the source regenerates the gitignored sql/trunklet-format--stable.sql
instead of a released version's install script.

Restore sql/trunklet-format--0.2.0.sql to the script that shipped as
0.2.0 (identical to the PGXN 0.2.0 release), and add the 0.2.0--stable
update script, which brings a 0.2.0 install up to the current source.
Updating from 0.2.0 needs extension_drop created first, because 0.2.0
did not require it; HISTORY.asc and README.md say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jnasbyupgrade
jnasbyupgrade removed this pull request from stack #7 October 25, 2026 20:10
@jnasbyupgrade
jnasbyupgrade changed the base branch from master to adopt-stable October 25, 2026 20:10
@jnasbyupgrade
jnasbyupgrade added this pull request to stack #9 October 25, 2026 20:10
jnasbyupgrade and others added 8 commits October 25, 2026 15:16
The drop command registered by the install and update scripts calls
trunklet.template_language__remove() with ignore_missing_functions,
which trunklet 0.3.3 added, and the update script uses
_trunklet._language_function__create(), added in 0.3.0. Raise both
trunklet prereqs to 0.3.3, and say in HISTORY.asc and README.md that
updating from 0.2.0 needs trunklet updated first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trunklet has no update script from 0.2.0, so ALTER EXTENSION trunklet
UPDATE only works from trunklet 0.2.1 or later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from adopt-stable to master October 26, 2026 20:54
Comment thread test/sql/base.sql
FROM unnest('{s,L}'::text[]) WITH ORDINALITY r(replace, rn)
, unnest(array[to_json(1.1), to_json(NULL::int), to_json('text'::text), to_json(true)])
WITH ORDINALITY v(value, vn)
ORDER BY rn, vn

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, ditch the comment on 96 and just mention -- Ensure consistent ordering against planner changes above the ORDER BY

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude here: fixed in 5d02776 — dropped the comment above the SELECT and added -- Ensure consistent ordering against planner changes above the ORDER BY.

Comment thread test/deps.sql Outdated
\set saved_verbosity :VERBOSITY
\set VERBOSITY terse
DO $$ BEGIN
IF current_setting('server_version_num')::int < 100000 THEN

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually still support < 10.0? I think this whole branch can go.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude here: flagged for review.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude here: removed the pre-10 branches (the DO block and the _create() fallback, plus the VERBOSITY wrapper that only served that block) in 08d8483. The floor is raised to 12 in the stacked PR #4.

jnasbyupgrade and others added 2 commits October 26, 2026 16:07
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The extension_drop/trunklet/cat_tools creates and the non-CASCADE
CREATE EXTENSION path only ran on server_version_num < 100000, and the
terse-VERBOSITY wrapper existed solely for that block.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jnasbyupgrade
jnasbyupgrade merged commit a4cb258 into master Oct 26, 2026
1 check passed
@jnasbyupgrade
jnasbyupgrade deleted the pgxntool-update branch October 26, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant