Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
63ade8d
Prototype: bin/update_lint_textfirst, a text-first update-script checker
jnasbyupgrade Sep 9, 2026
d9a7f01
Finish the text-first update-script checker and wire it into CI
jnasbyupgrade Sep 11, 2026
87dbb47
Make a malformed waiver a hard error rather than a silent no-op
jnasbyupgrade Sep 11, 2026
52f2d94
Trim a waiver comment that restated the header verbatim
jnasbyupgrade Sep 11, 2026
9f807c8
Drop enum label checking; the pgTAP suite verifies enums against the …
jnasbyupgrade Sep 11, 2026
de8d51d
Let a waiver regex contain a slash; document two declined cases
jnasbyupgrade Sep 11, 2026
93db23e
Report unreadable ALTER DEFAULT PRIVILEGES forms; run bin/ tests via …
jnasbyupgrade Sep 13, 2026
9036cbd
Rename bin/update_lint_textfirst to bin/lint-update; add lint-update …
jnasbyupgrade Sep 29, 2026
0f90537
lint-update: delete @generated@ lines instead of mirroring sql.mk; ke…
jnasbyupgrade Sep 29, 2026
f21ad02
lint-update: reject text after @generated@, mark end of kept -- comments
jnasbyupgrade Sep 30, 2026
9976f09
lint-update: state the comment rule as intended; note DO/format() lim…
jnasbyupgrade Oct 7, 2026
56ee07a
Mark the duplicated VERSIONED FILE! tag text on both sides
jnasbyupgrade Oct 7, 2026
c2175c2
Gate the test matrix on the lint job
jnasbyupgrade Oct 8, 2026
0f01f2c
Merge branch 'master' into update-lint-textfirst
jnasbyupgrade Oct 30, 2026
07ce224
CLAUDE.md: cite ai/RELEASE.md for the update-script rule instead of r…
jnasbyupgrade Oct 30, 2026
f6717a5
CLAUDE.md: shorten the update-lint bullet
jnasbyupgrade Oct 30, 2026
1685bc2
lint-update: also check the processed (generated) files, per major in CI
jnasbyupgrade Oct 30, 2026
3b33d5a
lint-update: add reciprocal DUPLICATED AT pointers; drop the real-tre…
jnasbyupgrade Oct 30, 2026
c9f9b61
lint-update --processed: fail on a missing generated file, and say wh…
jnasbyupgrade Oct 30, 2026
ad59438
Rename the lint-update self-test and state its purpose in the header
jnasbyupgrade Oct 30, 2026
8165d8e
Rename lint-update to lint--update
jnasbyupgrade Oct 30, 2026
73e7643
Use the lint--update name in CLAUDE.md and the CI step
jnasbyupgrade Oct 30, 2026
ac2731e
Make lint--update the canonical name in the Makefile and test header;…
jnasbyupgrade Oct 30, 2026
8d5052a
Use lint--update everywhere; update-lint stays only as a Makefile syn…
jnasbyupgrade Oct 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,9 @@ jobs:
# PG12+, where it is updated to the current version.
# ===========================================================================
test:
needs: [changes]
if: needs.changes.outputs.docs_only != 'true'
# lint takes seconds and needs no container, so a failure stops the matrix before it starts.
needs: [changes, lint]
if: success() && needs.changes.outputs.docs_only != 'true'
strategy:
matrix:
# Current-supported majors, from the single source in the changes job.
Expand All @@ -336,6 +337,10 @@ jobs:
# test/gen-relkinds.sh reads for the relkind drift check in
# test/sql/relation__.sql.
run: apt-get install -y rsync postgresql-server-dev-${{ matrix.pg }}
- name: Check the generated update script covers the generated install script
# Per major because the generated text depends on the PostgreSQL major; the raw check in
# `lint` runs once on the .sql.in sources.
run: make lint--update-processed
- name: Test on PostgreSQL ${{ matrix.pg }}
run: |
# Fail if the relkind drift source is empty (headers missing): the
Expand Down Expand Up @@ -394,6 +399,10 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v7
- name: Test bin/
# First, before anything that uses bin/: a bug in the tooling should be
# reported as a bug in the tooling, not as a finding against the SQL.
run: make test-bin
- name: Lint SQL
# CRITICAL: call `make lint` directly, not some other path (a script, a
# different target, etc). lint.mk's vendored include is guarded on
Expand All @@ -404,6 +413,12 @@ jobs:
# wrapper that swallows that exit code or calls a different entry point
# would defeat this safety net.
run: make lint
- name: Check the update script covers this cycle's install-script changes
# Static and database-free (see bin/lint--update's header),
# which is why it rides this job rather than the pgxn-tools container.
# A step, not a job: all-checks-passed hard-fails when the workflow's
# job-key set differs from its `needs:`.
run: make lint--update

# cancel-on-close.yml cancels in-flight CI/claude-review runs on PR close by
# joining the SAME concurrency group strings this workflow and
Expand Down
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ documented in `../ai/CLAUDE.md` or pgxntool's own docs.
`.sql` directly (historical exception; see `sql/.gitignore`).
- Never hand-edit a generated `.sql` file — edit the `.sql.in` (or, for
the base file, `sql/cat_tools.sql.in`) and regenerate.
- `make lint--update` (CI's `lint` job) checks the update-script rule in
`../ai/RELEASE.md`'s "Ongoing development"; see `bin/lint--update`'s
header for its limits and the `-- lint--update: ok /REGEX/ reason`
waiver.

See [`../ai/CLAUDE.md`](../ai/CLAUDE.md) for the general (pgxntool-level)
rules this preprocessing sits on top of: why version-specific install and
Expand Down
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,37 @@ clean_old_version:
# `.vendor/linter/sql/bin/sql-lint sql/cat_tools--0.3.0.sql.in`.
LINT_TARGETS = sql/cat_tools.sql.in test/
include lint.mk

# Static check that this cycle's update script accounts for every change to the
# install script -- no database, no SQL parser. See bin/lint--update's
# header for what it does and does not catch.
#
# Deliberately NOT tied to `lint` in either direction. lint.mk's include is
# guarded on $(wildcard .git), so `lint` does not exist as a target in a
# released tarball and `make lint` fails loudly there; naming it as a
# prerequisite would define it with no recipe and turn that loud failure into a
# silent pass. `update-lint` is a synonym for `lint--update`, for people who remember the name backwards.
.PHONY: lint--update update-lint
lint--update update-lint:
bin/lint--update

# The same check over the generated .sql files (what actually installs).
# Separate from lint--update because that one needs no build or PostgreSQL,
# while the processed text depends on MAJORVER, so CI runs this per major in
# the `test` job.
.PHONY: lint--update-processed
# DUPLICATED AT bin/lint--update current_pair(): keep the derivation in sync.
LINT_UPDATE_CUR := $(patsubst sql/cat_tools--%.sql,%,$(EXTENSION__CURRENT_VERSION__FILES))
LINT_UPDATE_UPD := $(patsubst %.sql.in,%.sql,$(wildcard sql/cat_tools--*--$(LINT_UPDATE_CUR).sql.in))
LINT_UPDATE_OLD := $(patsubst sql/cat_tools--%--$(LINT_UPDATE_CUR).sql,sql/cat_tools--%.sql,$(LINT_UPDATE_UPD))
lint--update-processed: $(EXTENSION__CURRENT_VERSION__FILES) $(LINT_UPDATE_OLD) $(LINT_UPDATE_UPD)
bin/lint--update --processed

# Everything in bin/ that the rest of the suite leans on -- bin/test_existing
# and bin/structural_diff drive the pgTAP runs, bin/lint--update drives
# `lint--update` above -- so run this before anything that uses them: a broken
# tool otherwise reports as a broken extension. prove takes the directory, so a
# new bin/test/*.t needs no edit here. Test::Harness is core Perl; no setup.
.PHONY: test-bin
test-bin:
prove bin/test/
Loading
Loading