Skip to content

Update to latest pgxntool#3

Open
jnasbyupgrade wants to merge 12 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:pgxntool-update
Open

Update to latest pgxntool#3
jnasbyupgrade wants to merge 12 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:pgxntool-update

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Summary

  • Update pgxntool to latest release
  • Update .gitignore from pgxntool template

I don't remember why we originally loaded pgTap from raw files. Standardize on what pgxntool recommends.
3b8cb2a Stamp 1.1.0
550a901 Remove commit.md (maintained in pgxntool-test)
d73ca93 Add unique test database names to prevent conflicts (#13)
9b344be Add update-setup-files.sh for 3-way merging after pgxntool-sync (#12)
ab7f6e2 Stamp 1.0.0
3a571ba Add pg_tle support and modernize test infrastructure (#11)
b96ea6d Add support for Claude code; build and doc improvements (#9)
e9c24de Fix pg_regress on versions > 12 (Postgres-Extensions#5)
c0af00f Improvements to HISTORY.asc
6e8f2a7 Allow use of sudo when installing an extension
705f1ec Don't run clean as part of make test
370fa8e Create test/sql during setup
890053c Fix bug with DOCS
5c2173e Fix DOCS variable
d8bf8ed Update HISTOROY
f92d493 Add support for asciidoc
dbdd978 Improve asciidoc handling
90bbfa5 Merge branch 'stable'
2f11ef0 Support 9.2
bceb84d Don't over-write DOC
1b97c8c Add pgtap as an installcheck dependency
cd24b0f Reduce verbosity of test setup
48dce67 Install tap before runing deps.sql
6cb4302 Add input files as deps to installcheck
c0e70ca Merge branch 'release'
899233d Merge branch 'master' into stable
e8dff79 Update HISTORY
f49e6e3 Fix version number handling
ed515aa Remove errant .
8856f1e Decimal point doesn't work, just multiply MAJORVER by 10
35d13b3 Switch to leaving decimal point in MAJORVER
8c59619 Merge branch 'master' into stable
17ee75a Fix typo
5c3032f Add EXTENSION_SQL_FILES variable
dcac898 Document the test targets
e4884c2 Merge branch 'master' into stable
c05f446 Clarify current version
d2e6c79 Update HISTORY
c3c1a08 Switch variable name for versioning
aa93684 Merge branch 'release'
940f35b Merge branch 'master' into stable
e6205f8 Remove merge conflict
1f5fcc5 Update HISTOROY
8b8e9b5 Remove invalid options from git subtree pull
2c1e313 Merge branch 'release'
227f558 Merge branch 'release' into stable
e5f78b3 Update history
e711eef Need to install upgrade scripts
102a856 Favor upstream changes in case of conflict
eda5f38 Merge branch 'release'
18532a9 Consistent spelling of license
7d3f6ad History for 0.1.8
3264d28 Silence meta output
a4ea40b Add expected/ as a dep
732f534 Handle alpha and beta versions
82216b6 Fix test directory handling
14e4ebc Distribution names can't contain spaces either
4aff20a Ignore meta.mk
04713aa Refactor; add PGXN/PGXNVERSION variables
02ae242 Move key to a safe location
cbe8921 Change names to support new tools
3765700 Switch to generating a meta.mk file for Make dependencies on META.json
2e78459 Merge branch 'master' of github.com:decibel/pgxntool
2b8e24a History for release
aac4331 Ignore ALL .asc files
2b46bda Merge pull request Postgres-Extensions#3 from pnorman/patch-1
866bbe5 Use bash for setup.sh
97aaf7f Fix .gitattributes
c8c4727 Merge branch 'stable'
4a57b43 Pull pgxntool from ../pgxntool stable
b877657 Add note about what pgxntool is
13b0265 Test ignoring PGXNtool README
b94e2f4 If output dir is needed but doesn't exist, create it.
d173527 Fix directory name
adc4348 Add test/sql as dep. Clean up directory creation.
0af7768 Create test output stuff if missing
798b6f4 Merge branch 'master' into stable
cf42f7b Add git status output
3746eea Fix shell bug
616741a Ensure repo is empty
c35e846 Add setup.sh to install instructions
cf6fb04 Add make help
3b23055 Merge branch 'release'
905922e Merge branch 'master' into stable
93ff527 Leave pgTap being loaded by setup.sql
c36180f Squashed commit of the following:
1dfff38 Improve warning
f6464b9 Add option to sync stable
749ff01 Add test/..../finish.sql
d71400c Merge branch 'release'
15d2567 Pull pgxntool from ../pgxntool master
732514e Fix $(DATA)
0c84d43 Improve print- recipe
6f7701e Merge branch 'master' into stable
5942cc9 Fix tap schema
a8fa40e Move deps to a file
c9a0b40 Add pgTap to deps
a0ab465 Fix REGRESS rules
882447c Fix test file detection
d152f6e Merge branch 'master' of github.com:decibel/pgxntool
a7a7dfe Formatting
393f301 Unset MODULES if it's empty
84fa612 Always attempt to build source files
9922a17 Adjust META.in.json so it's valid
411dfaf .source inputs need to be in an input directory
03b542a Fix .source test file support
cef41f7 Support .source test files
3a08445 Make testing more extensible Add TESTDIR and TESTOUT variables Explicitly tell pg_regress where to put output
acc8c17 Minor tweak to refer to new features.
ea3c67f Merge branch 'release'
dce257a Merge branch 'test'
0596bdd Merge stable: Fix for pgtap, keep public in search path
5e6305e Merge branch 'master' into stable
4473ed5 Fix problem with pgtap dependencies.
d043f2a Keep public in the search path for TAP
c38a392 Merge branch 'master' into stable
c6a31f0 Merge branch 'test' into stable
ac48ccf Merge branch 'release'
6a10733 Merge back from release
8d9f9b6 Fix README.asc after merge
aa3ea7f Merge branch 'test'
b0bf5b1 0.1.2: Add a bunch of features
4fb946f Don't export README
c17abbe Suggest initial setup is a squash commit.
f99608e Ready to test 0.1.2
e895a08 Have setup add META.json to git
1629702 Fix off-by-1 in tail
f133686 Deps issues
ea3e515 Fix META.json build issues
ecd0291 Make META.json variables recursive
5feee21 Copy META.in.json over.
979d836 Merge branch 'test'
77cd2da Support empty doc directory. Other improvements
1b32e06 Improve setup commit message
1ab4aa3 Add misssing file
f3f28d2 First stab at build_meta.sh
963b040 Missing comma
b984240 Don't puke if test/pgxntool already exists
5ade3be Fix file tests
9e97951 Better error handling; safecp()
be55d12 Make sure we're not accidentally ignoring META.json
48df320 Add template META.in.json
5f0dcd9 Update final message
992dca3 Add git stuff
c7bae04 Move .gitignore to a file
c05317b Add target to list all targets
da11d03 Add test helpers
1d1935f Add .gitignore
4632361 Fix typo
5ec6aa4 Add license and README
d27b1e2 Add dist-only rule
57c52fa Fix variable reference
bc0c837 Fix file path problem
e4bafbb Add sync commands
5069d9c Add JSON.sh
2ade7d9 Numerous changes to support test_factory
c556c41 Add .gitignore
b7a9cac Add initial makefiles from test_factory

git-subtree-dir: pgxntool
git-subtree-split: 3b8cb2a96c2611bb44b1d69fd533fd0f23fa8995
Minor tweaks to test setup. Also, start keeping versioned extension files in git.
pgxntool now assumes versioned SQL files are checked in, so do that, but
first bump our version number.
6ba3176 Fix pg_tle exception handler and empty upgrade files (#15)

git-subtree-dir: pgxntool
git-subtree-split: 6ba3176b21252b9d310ba0ede4c6a0d1d44093ec
REVERT: 6ba3176 Fix pg_tle exception handler and empty upgrade files (#15)

git-subtree-dir: pgxntool
git-subtree-split: 3b8cb2a96c2611bb44b1d69fd533fd0f23fa8995
639756c Stamp 1.1.1
6ba3176 Fix pg_tle exception handler and empty upgrade files (#15)

git-subtree-dir: pgxntool
git-subtree-split: 639756c43a64717347b82b46acfec5be478a7bbf
@jnasbyupgrade

Copy link
Copy Markdown
Contributor Author

@claude please review this PR.

@claude

claude Bot commented Jul 14, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 5m 2s —— View job


Claude's Review of "Update to latest pgxntool"

Todo list:

  • Gather context (PR diff vs origin/master, changed files)
  • Read repo docs (no project-level CLAUDE.md; only vendored pgxntool/CLAUDE.md, which documents the pgxntool tool itself, not this project)
  • Review pgxntool vendor update
  • Review count_nulls-specific changes (version bump, control/META, SQL upgrade scripts, tests, new ci.yml)
  • Post review

Summary

This PR pulls in a large upstream update of the vendored pgxntool/ build tooling and, on top of it, bumps count_nulls to 1.0.0, adds the missing versioned SQL upgrade files to git (per the new .gitignore policy), replaces the old flat-file pgTap helpers with CREATE EXTENSION pgtap, and adds a GitHub Actions CI workflow. Most of the diff (base.mk, meta.mk.sh, setup.sh, pgtle.sh, README, etc.) is vendor code pulled in via the standard "squash pgxntool subtree" process, so I focused review on correctness of that vendored logic as it applies here, plus everything specific to this extension.

Findings

1. Likely bug in pgxntool/base.mk:96 (vendored, but affects this project's build)

GE91		 = $(call test, $(MAJORVER), -ge, 91)
...
ifeq ($($call test, $(MAJORVER), -lt 13), yes)
	REGRESS_OPTS += --load-language=plpgsql
endif

Two problems compared to the correct GE91 pattern one line above:

  • $($call test, ...) is malformed — it's missing the parenthesis after $ ($(call ...)), so this does not actually invoke the test macro at all. It expands to garbage/empty, meaning the ifeq is always false and --load-language=plpgsql is never added.
  • Even if the call syntax were fixed, the threshold is wrong: MAJORVER is scaled by 10 for PG ≥ 10 (MAJORVER = $1 * 10, e.g. PG13 → 130, PG17 → 170), matching the -ge, 91 convention used for GE91 (9.1 → 91). So comparing against 13 instead of 130 would still never match any real MAJORVER value for PG13 specifically as intended (it'd trivially be true for every version ≥ 10, since e.g. 100 is not -lt 13... actually it'd be no for all PG10+ since 100+ is never -lt 13, so the flag would never apply to modern versions either way).

The likely intended fix: ifeq ($(call test, $(MAJORVER), -lt, 130), yes). Since the new .github/workflows/ci.yml in this PR tests PG 10 through 17 (.github/workflows/ci.yml:6), it'd be worth confirming whether older PG versions in that matrix actually need --load-language=plpgsql for installcheck to pass — as currently written, the flag is never applied to any version. I wasn't able to run make/make test in this sandbox (tool permissions block make -n, pg_config --version, etc. outside an allow-listed make test), so please verify with the actual CI run before merging.
Fix this →

2. .travis.yml is now redundant — the new .github/workflows/ci.yml covers PG 10–17 via pgxn/pgxn-tools, making the old Travis config (.travis.yml) dead weight. Not blocking, just a cleanup opportunity in this or a follow-up PR.

Things that look correct

  • Version bump is consistent across count_nulls.control, META.in.json, and META.json (0.9.61.0.0 for the extension; 0.9.71.0.0 for the distribution).
  • sql/count_nulls--0.9.6--1.0.0.sql is a correct no-op upgrade script, and the full upgrade chain (0.9.0→0.9.2→0.9.5→0.9.6→1.0.0) remains intact.
  • The .gitignore change to stop ignoring sql/*--*.sql is properly reflected — sql/count_nulls--0.9.6.sql and sql/count_nulls--1.0.0.sql are now correctly tracked, generated via pgxntool/control.mk.sh (which itself looks correct).
  • Replacing the ~9,400-line vendored test/helpers/pgtap-core.sql/pgtap-schema.sql with CREATE EXTENSION IF NOT EXISTS pgtap in pgxntool/test/pgxntool/tap_setup.sql is a solid simplification.
  • test/deps.sql correctly instantiates the new template with CREATE EXTENSION count_nulls; inside :schema, and the corresponding test/expected/*.out changes are just whitespace/formatting fixes from the pgTap version bump (indentation of # Subtest: lines) — consistent with the new pgTap loaded via extension rather than raw SQL.
  • No obviously risky patterns (no curl|sh, no unsafe eval, no destructive shell ops) in the new vendored scripts (lib.sh, control.mk.sh, update-setup-files.sh, pgtle.sh, safesed).

Note on testing

I was not able to execute make test/pg_config/make -n directly in this sandbox (blocked by tool permission restrictions), so this review is based on static analysis of the diff rather than an actual test run. Recommend confirming the CI matrix in the new ci.yml passes (especially for PG 10–12) before merging, given finding #1 above.

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