Skip to content

fix(pgpm): ignore PG17+ list offsets in the AST round-trip check - #1578

Merged
pyramation merged 1 commit into
mainfrom
fix/round-trip-diff-false-positives
Aug 1, 2026
Merged

fix(pgpm): ignore PG17+ list offsets in the AST round-trip check#1578
pyramation merged 1 commit into
mainfrom
fix/round-trip-diff-false-positives

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

pgpm package warns ⚠️ AST round-trip diff detected! on nearly every module. Almost all of it is noise: PG17+ added positional fields that cleanTree never stripped — A_ArrayExpr.list_start/list_end and A_Expr.rexpr_list_start/rexpr_list_end. Any ARRAY[...] or x IN (...) shifts those byte offsets when the SQL is reformatted, so the reparsed tree never matches. Scanning constructive-db: 3775 + 78 offset-only differences across 30 modules, hiding exactly one real deparser bug (a dropped EXCLUDE constraint name — fixed in constructive-io/pgsql-parser#331).

The diff check now uses a separate cleanTreeForDiff that also drops those four keys. cleanTree is deliberately left alone because hashSqlFile uses it for pgpm_migrate ledger hashes — widening it there would rewrite the hash of every already-deployed change containing an array.

Link to Devin session: https://app.devin.ai/sessions/5cfcc6690b574cdd96de080ee3b94b4e
Requested by: @pyramation

@pyramation pyramation self-assigned this Aug 1, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation
pyramation merged commit 89117bd into main Aug 1, 2026
16 checks passed
@pyramation
pyramation deleted the fix/round-trip-diff-false-positives branch August 1, 2026 01:26
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