feat(scripts): sync the pg resolution to @malloydata/db-postgres on Malloy bumps#868
Merged
Conversation
…alloy bumps pg is a transitive dependency via @malloydata/db-postgres, which pins its own pg (an exact 8.7.3 as of 0.0.421). Publisher never touches the pg Client/Pool API: every Postgres connection goes through Malloy's connector (PooledPostgresConnection in connection.ts) and schema listing runs standard information_schema SQL through malloyConnection.runSQL (db_utils.ts). PR #786 added a root "pg" resolution that held pg at 8.16.3, which rode in incidentally with the theming family bump; forcing pg above the connector's pin just runs Malloy's connector on a driver it was not built or tested against. Add scripts/sync-pg-version.js, mirroring scripts/sync-duckdb-version.js: it reads the pg version @malloydata/db-postgres declares in bun.lock (not the top-level pg entry, which is our own resolution) and keeps the root resolution equal to it. Policy is plain-track: resolutions.pg is set to exactly what the connector declares. To move Publisher's pg, bump pg upstream in @malloydata/db-postgres and the next Malloy bump carries Publisher along. On the current tree this syncs resolutions.pg from 8.16.3 down to 8.7.3, so the package.json resolution and bun.lock are updated to match. - upgrade-malloy.sh runs sync-pg-version.js --write (then bun install) right after the DuckDB sync, replacing the manual "re-verify by hand" note. - package.json adds a validate-pg-sync script. - build.yml adds a "Check pg version consistency" CI gate so a bump that leaves the resolution out of step with the connector fails the build. Follow-up to #786, requested by Sagar. Signed-off-by: Monty Lennie <[email protected]>
mlennie
force-pushed
the
monty/sync-pg-version
branch
from
July 7, 2026 18:43
959005a to
dae32ef
Compare
sagarswamirao
approved these changes
Jul 7, 2026
mlennie
enabled auto-merge (squash)
July 7, 2026 20:04
Co-authored-by: Cursor <[email protected]> # Conflicts: # package.json
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.
Follow-up to the theming PR (#786), requested by @sagarswamirao: automate the
pgresolution so it stays in sync with@malloydata/db-postgreson Malloy bumps instead of being a hand-maintained magic constant.Background:
pgisn't a direct dependency; it comes in transitively via@malloydata/db-postgres, which pins its own pg (an exact8.7.3as of 0.0.421). #786 added a root"pg": "8.16.3"resolution so the theming family bump wouldn't downgrade the driver from main's8.16.3, plus a manual "re-verify on the next bump" note inupgrade-malloy.sh.This adds
scripts/sync-pg-version.js, mirroring the existingscripts/sync-duckdb-version.jspattern:@malloydata/db-postgresdeclares inbun.lock(not the top-levelpgentry, which is our own resolution reflected back).resolutions.pgin sync:--writerewrites it, check mode (default) exits non-zero on drift,--printemits the version.upgrade-malloy.sh(runs after the DuckDB sync, thenbun install), avalidate-pg-syncpackage script, and a "Check pg version consistency" CI gate inbuild.yml.Policy: floor-guarded.
resolutions.pgis set to the higher of the current pin and what db-postgres declares, so it adopts a newer pg automatically on a bump but never downgrades below the current pin. This is a superset of a literal "track db-postgres" sync: it keeps pg in step when the connector moves up, and just won't drag it backward when the connector pins an older exact version (as 0.0.421 does). Today db-postgres declares8.7.3and the pin is8.16.3, so this PR is a no-op on the current tree (check mode passes,--writeis a no-op).@sagarswamirao if you'd rather it plain-track db-postgres exactly (which would set pg to
8.7.3today, a downgrade), that's a one-line change; floor-guarded just seemed like the safer default. Happy to switch.Verified: the sync script on the current tree (no-op) and across scenarios (connector above pin adopts it, below pin keeps the pin, range specs handled); bash/YAML/JSON syntax; typecheck, lint, and the server unit suite (1069 pass).