You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(v18): commit the parsePlPgSQL output for every PL/pgSQL fixture - #222
#221 committed the outputs of parse, fingerprint, normalize and scan; this does the same for parsePlPgSQL, the remaining exported function.
versions/18/test/snapshots/plpgsql-corpus.json: the 261 PL/pgSQL fixtures, copied from pgsql-parser's __fixtures__/plpgsql-generated/generated.json (at pgsql-parser@1069446).
versions/18/test/snapshots/plpgsql-pg18.json: the full parsePlPgSQLSync result for each, one line per fixture (255 kB, so no hashing; an output change is readable in the diff).
versions/18/test/snapshots.test.js: the comparison is now one check(corpus, snapshot, functions) used for both corpora. pg18.json is unchanged.
The test fails on builds whose outputs differ
Same file pointed at published packages (Node 22):
Release
PL/pgSQL fixtures
18.1.5
fail, 45 outputs changed
18.2.4
fail, 45 outputs changed
18.2.6, 18.2.7
pass
this build (Node 20, 22, 24)
pass
The 45 are an output change that came in after 18.2.4 without a note. Example, declare x record := row(1,2,3) (plpgsql_varprops-5.sql): the PLpgSQL_rec datum now carries "default_val":{"PLpgSQL_expr":{"query":"row(1,2,3)","parseMode":2}}, which 18.2.4 left out. It looks like an improvement; the point is that a change like this now fails a test and shows in the diff.
The change extends the versions/18 snapshot harness to cover parsePlPgSQLSync alongside the existing SQL outputs and commits the corresponding snapshot fixtures. The refactor is faithful and the fixtures are self-consistent, so no blocking issues were found.
Files
Change
versions/18/test/snapshots.test.js
Refactors the snapshot test into a generic check() helper that runs each registered parse/scan function per corpus entry and aggregates diffs.
No actionable comments were generated in the recent review.
Walkthrough
The PostgreSQL 18 snapshot tests now run separate SQL and PL/pgSQL corpora. New PL/pgSQL fixtures and committed parse-tree outputs cover variables, control flow, transactions, procedure calls, and other constructs.
Changes: PL/pgSQL snapshot coverage
Layer / File(s)
Summary
PL/pgSQL fixtures and expected outputs versions/18/test/snapshots/plpgsql-corpus.json, versions/18/test/snapshots/plpgsql-pg18.json
The fixture corpus and expected outputs cover variable properties, triggers, exceptions, transactions, schema-qualified references, domains, deparsing, control flow, procedure calls, caching, and arrays.
The test harness checks separate SQL and PL/pgSQL corpora against their snapshots. It can write snapshots when UPDATE_SNAPSHOTS is set and truncates output values in mismatch details.
PG 18 issues — upstream issue #157: The new snapshots exercise the same PL/pgSQL JSON interface and record output differences, but the available details do not show whether the reported cases are fixed.
This PR extends the committed PostgreSQL 18 snapshot tests to cover PL/pgSQL parse output. It changes only test code and test data, so it has no production impact. No concrete merge-blocking risk was found.
Security architecture risk: Minimal · up to 911dc
The PR adds regression coverage for existing PL/pgSQL parser output without changing production behavior or expanding access to the parser.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title says the PR commits parsePlPgSQL output for every PL/pgSQL fixture. The objectives confirm this is the main change: committed parsePlPgSQL output snapshots for all 261 fixtures, plus a refac…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title says the PR commits parsePlPgSQL output for every PL/pgSQL fixture. The objectives confirm this is the main change: committed parsePlPgSQL output snapshots for all 261 fixtures, plus a refactor of the snapshot test to a shared check function. The title is specific, short, and in conventional-commit style. The title does not mention the test refactor, which is a secondary detail.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 860db1c and 911dc6a.
Files selected for processing: 3
versions/18/test/snapshots.test.js
versions/18/test/snapshots/plpgsql-corpus.json
versions/18/test/snapshots/plpgsql-pg18.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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
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.
Summary
#221 committed the outputs of
parse,fingerprint,normalizeandscan; this does the same forparsePlPgSQL, the remaining exported function.versions/18/test/snapshots/plpgsql-corpus.json: the 261 PL/pgSQL fixtures, copied from pgsql-parser's__fixtures__/plpgsql-generated/generated.json(atpgsql-parser@1069446).versions/18/test/snapshots/plpgsql-pg18.json: the fullparsePlPgSQLSyncresult for each, one line per fixture (255 kB, so no hashing; an output change is readable in the diff).versions/18/test/snapshots.test.js: the comparison is now onecheck(corpus, snapshot, functions)used for both corpora.pg18.jsonis unchanged.The test fails on builds whose outputs differ
Same file pointed at published packages (Node 22):
The 45 are an output change that came in after 18.2.4 without a note. Example,
declare x record := row(1,2,3)(plpgsql_varprops-5.sql): thePLpgSQL_recdatum now carries"default_val":{"PLpgSQL_expr":{"query":"row(1,2,3)","parseMode":2}}, which 18.2.4 left out. It looks like an improvement; the point is that a change like this now fails a test and shows in the diff.Implemented in session Find why regressions slip past our release process
Review with Devin · Open in Devin Desktop
Summary by CodeRabbit