Fix the PGXN tag that blocked the 2.0.0 upload, and check META.json in CI - #11
Merged
Conversation
…n CI
PGXN refused the 2.0.0 distribution:
Field /tags[11]: "pl/sql" is not a valid tag [Spec v1.0.0]
A Tag may not contain a slash. The tag is now plsql. No other tag was at fault.
The distribution version moves to 2.0.1 and the extension version stays at
2.0.0, since nothing about the extension changed. There is therefore no
plx--2.0.1.sql and no upgrade script: adding a version-advancing script and a
duplicate install script for a metadata typo would leave dead files in the
catalog forever. PGXN treats the distribution version and the extension version
as separate, which is exactly the case this covers.
The real problem is that the only thing validating META.json was PGXN itself,
at upload time, which is after a release has been tagged and published. That is
an expensive place to find a typo. test/check_meta.py now checks the spec's
constraints, runs as make metacheck, and runs in CI before the regression suite.
It reproduces the rejection above against the unfixed file.
Writing it turned up why this was easy to get wrong. The spec prose says a Tag
may contain no "slash, backslash, control, or space" characters, but that
sentence describes a Term. The Tag schema is ^[^/\\\p{Cntrl}]{2,}$, which
permits spaces. So "sql server" and "string builder" are valid tags that would
be invalid terms, and the slash in "pl/sql" was the only real fault. The
validator implements the schema rather than the prose, and says so, so the next
person does not go and "fix" the tags that were never broken.
Verified on PostgreSQL 18.4: metacheck passes, 13/13 installcheck.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PGXN refused the 2.0.0 distribution:
A Tag may not contain a slash. Now
plsql. No other tag was at fault.Versioning
The distribution version moves to 2.0.1; the extension version stays at 2.0.0, because nothing about the extension changed. So there is no
plx--2.0.1.sqland no upgrade script — adding a version-advancing script and a duplicate install script for a metadata typo would leave dead files in the catalog forever. PGXN treats the two versions as separate, which is exactly this case.There is no
ALTER EXTENSION plx UPDATEfor this release, and the CHANGELOG says so.The actual problem
The only thing validating
META.jsonwas PGXN, at upload time — after a release is tagged and published. That's an expensive place to find a typo.test/check_meta.py(make metacheck) now checks the spec's constraints and runs in CI ahead of the regression suite. Against the unfixed file it reproduces PGXN's rejection exactly:Why this was easy to get wrong
Worth recording, because the prose and the schema disagree and the prose is the trap.
The spec text says a Tag may contain no "slash, backslash, control, or space" characters. That sentence describes a Term. The Tag schema is:
which permits spaces. So
sql serverandstring builderare valid tags that would be invalid terms, and the slash inpl/sqlwas the only real fault. Reading the prose would have led to "fixing" three tags that were never broken.The validator implements the schema rather than the prose, and its docstring says why, so the next person doesn't repeat that.
Verification
PG18.4:
metacheckpasses, 13/13 installcheck. Every tag re-checked against the real pattern; 15 tags, all valid.🤖 Generated with Claude Code