fix(ci): pass NODE_OPTIONS=--use-system-ca to clear grpc-tools tls install #199
Reference in New Issue
Block a user
Delete Branch "fix/ci-grpc-tools-node-system-ca"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The CI runner fails
pnpm install --frozen-lockfilesince the AI-relay chantier addedgrpc-toolsto the dep tree. The package's postinstall downloads a precompiledprotocarchive fromnode-precompiled-binaries.grpc.io, and Node 24's bundled CA set cannot verify the TLS chain on the runner network path.The fix follows the Node team's own remediation, surfaced verbatim in the error message:
Setting
NODE_OPTIONS=--use-system-caat the workflowenv:block makes Node consult the OS CA store in addition to its bundled set. The runner image (catthehacker/ubuntu:act-22.04per ADR-0015) carries the standard Ubuntuca-certificatesbundle, which validates the chain.What lands
.gitea/workflows/ci.yml:.gitea/workflows/docs-site.yml: same one-line block.Both placed at workflow scope so every Node process (pnpm itself + every postinstall it spawns) inherits the option without per-step duplication.
No package.json change. No code change. No runner-image change.
Notes for the reviewer
apps/portal-bff/src/grpc/gen/are committed (per ADR-0024 §"Sub-decision 3 — vendored protos"), so CI only needs to type-check them. Removinggrpc-toolsfrompnpm.onlyBuiltDependencieswould also clear the failure and is arguably more minimal in CI. The trade-off: developers who update protos would have to opt back into the postinstall (pnpm approve-builds grpc-tools && pnpm rebuild grpc-tools) before runningpnpm grpc:codegen.--use-system-cakeeps the developer workflow identical and fixes the underlying TLS-chain issue for any future native dep that hits the same wall (a real risk as the dep tree grows). The cost is a single workflow env var.env:rather than per-stepenv:. Five separatepnpm installsteps run acrossci.yml; setting it five times would invite drift. Theenv:block at workflow scope applies to every step in every job — clean, single source of truth.--use-system-cais documented since Node 22; Node 24 (the workspace LTS per.nvmrc) carries it. No.nvmrcchange required.Test plan
This PR cannot be locally validated in a way that reproduces the failure — the CI runner's network path is the only environment where
node-precompiled-binaries.grpc.iocannot be reached with Node's bundled CA. The validation is the next CI run.pnpm install --frozen-lockfilecompletes;pnpm ci:checkruns to completion.grpc-toolsfrompnpm.onlyBuiltDependenciesso the postinstall is skipped entirely in CI (and document the dev-sidepnpm approve-buildsstep). Trivial follow-up if needed.What's next
If
--use-system-cafixes the CI install and no other Node TLS issues surface, no further action is required. The env var stays as a forward-looking guard.