ci: pin pg-native so the Node 10 postgres-native legs parse by stuartnelson3 · Pull Request #18314 · sequelize/sequelize · GitHub
Skip to content

ci: pin pg-native so the Node 10 postgres-native legs parse - #18314

Open
stuartnelson3 wants to merge 1 commit into
sequelize:v6from
stuartnelson3:stn/bug-1961-pin-pg-native-node10
Open

ci: pin pg-native so the Node 10 postgres-native legs parse#18314
stuartnelson3 wants to merge 1 commit into
sequelize:v6from
stuartnelson3:stn/bug-1961-pin-pg-native-node10

Conversation

@stuartnelson3

Copy link
Copy Markdown

Pull Request Checklist

  • Have you added new tests to prevent regressions? Not applicable. This changes a workflow step only.
  • Does npm run test or npm run test-DIALECT pass with this change (including linting)? CI on this pull request is the test.
  • Is a documentation update included? Not applicable.
  • Did you update the typescript typings accordingly? Not applicable.
  • Does the description below contain a link to an existing issue? Closes v6 CI: postgres-native legs on Node 10 fail because pg-native is installed unpinned #18312.
  • Did you follow the commit message conventions explained in CONTRIBUTING.md? Yes.

Description Of Change

Closes #18312.

The workflow installs pg-native unpinned, after the lockfile install, so CI always takes
the newest release:

- run: yarn install --frozen-lockfile --ignore-engines
- run: yarn add pg-native --ignore-engines
  if: matrix.native

pg-native 3.8.0 added nullish coalescing, which Node 10 cannot parse, so the module throws
at load time before mocha runs a single test. That takes out four legs of the test-postgres
matrix on every pull request against v6:

node_modules/pg-native/index.js:153
  return statusMap[this.pq.transactionStatus()] ?? null
                                               ^
SyntaxError: Unexpected token ?

This pins the version. The Node 10 legs are the reason a pin is needed, and I pinned all
native legs rather than only the Node 10 ones, so the matrix stays uniform and no leg
depends on whatever npm publishes next.

Verification

Under node:10-alpine, Node v10.24.1, node --check on every .js file in each package:

Version Result
pg-native@3.7.0 3 files, all parse
pg-native@3.8.0 SyntaxError: Unexpected token ?
pg-native@3.9.0 SyntaxError: Unexpected token ?
libpq@1.11.0, the version 3.7.0 resolves parses

pg-native pins pg-types to an exact version, and libpq above is the resolved
transitive, so 3.7.0 is enough on its own. The native build itself was never the problem:
the Node 10 legs today get through install and fail at test time.

I could not run the native suite locally, because libpq needs headers this machine does not
have. CI on this pull request covers that.

Alternative I did not take

Adding pg-native to devDependencies would let --frozen-lockfile govern it and end this
class of failure for good. I left it alone, because every leg and every contributor would
then build libpq from source, and only the four native legs need it.

Closes sequelize#18312.

The workflow installed pg-native unpinned, after the lockfile install, so CI
always took the newest release. pg-native 3.8.0 added nullish coalescing, which
Node 10 cannot parse, and the module threw at load time before mocha ran a
single test.

Verified under node:10-alpine, Node v10.24.1: `node --check` passes on every js
file in pg-native 3.7.0 and fails on 3.8.0 and 3.9.0. The transitive libpq
1.11.0 parses too, and pg-native pins pg-types exactly, so 3.7.0 is enough.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 711e5602-c92a-4aca-9b94-bbb25ba1176d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@stuartnelson3

Copy link
Copy Markdown
Author

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