Skip to content

[Fix] Pin Prisma Node.js dependency in CI workflows#24696

Merged
yuneng-berri merged 1 commit intomainfrom
litellm_pin_prisma_node_ci
Mar 27, 2026
Merged

[Fix] Pin Prisma Node.js dependency in CI workflows#24696
yuneng-berri merged 1 commit intomainfrom
litellm_pin_prisma_node_ci

Conversation

@yuneng-berri
Copy link
Copy Markdown
Collaborator

Summary

Failure Path (Before Fix)

prisma generate internally runs npm install [email protected] against the npm registry at runtime. In CI, there is no pre-installed Node.js, so prisma falls back to nodeenv which downloads Node, then runs an unpinned npm install. This causes:

  • ECONNRESET errors from flaky npm registry connections on GitHub Actions runners
  • An unpinned npm transitive dependency tree resolved at runtime

Fix

Pre-install nodejs-wheel-binaries==24.13.1 (a Python package that bundles Node.js + npm locally) before running prisma generate. This matches the approach already used in the Dockerfiles. When prisma detects nodejs-wheel-binaries is available, it uses the bundled Node/npm instead of downloading from the internet.

Testing

  • Verified that the Dockerfiles (Dockerfile.non_root) already use nodejs-wheel-binaries==24.13.1 with prisma==0.11.0
  • The prisma Python client (v0.11.0) checks for nodejs-wheel-binaries before falling back to nodeenv/global npm

Type

🐛 Bug Fix
🚄 Infrastructure

prisma generate internally runs `npm install [email protected]` against the
npm registry at runtime. Without a bundled Node.js, this causes
ECONNRESET failures on flaky GitHub Actions network and leaves the
npm transitive dependency tree unpinned.

Pre-install nodejs-wheel-binaries==24.13.1 (matching the Dockerfiles)
so prisma uses the bundled Node/npm instead of fetching from the
registry.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Mar 27, 2026 6:26pm

Request Review

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 27, 2026

CLA assistant check
All committers have signed the CLA.

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq bot commented Mar 27, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing litellm_pin_prisma_node_ci (ca3457b) with main (8c2c6a4)

Open in CodSpeed

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 27, 2026

Greptile Summary

This PR fixes flaky CI failures caused by prisma generate trying to download Node.js at runtime via nodeenv on GitHub Actions runners. The fix pre-installs nodejs-wheel-binaries==24.13.1 into the Poetry virtual environment before running prisma generate, mirroring the approach already used in docker/Dockerfile.non_root. A PRISMA_BINARY_CACHE_DIR env var is also added to pin the Prisma binary cache to runner.temp.\n\nBoth workflow files that call prisma generate are correctly updated — no other CI workflows use that command. The pinned version (24.13.1) is consistent across the Dockerfiles and requirements.txt.\n\nKey changes:\n- .github/workflows/test-litellm-matrix.yml — adds nodejs-wheel-binaries install + PRISMA_BINARY_CACHE_DIR before prisma generate\n- .github/workflows/test-proxy-e2e-azure-batches.yml — same fix; minor inconsistency: PRISMA_BINARY_CACHE_DIR is set only on the Generate Prisma client step, not on the subsequent Run Prisma migrations (prisma migrate deploy) step

Confidence Score: 5/5

Safe to merge — targeted infrastructure fix with no production code changes and no regressions.

All changed lines are CI workflow YAML. The fix is well-motivated, consistent with existing Dockerfile practice, and the only finding is a P2 style inconsistency (missing PRISMA_BINARY_CACHE_DIR on the migration step). Per confidence guidance, P2-only findings default to 5/5.

No files require special attention; the minor PRISMA_BINARY_CACHE_DIR inconsistency in test-proxy-e2e-azure-batches.yml is non-blocking.

Important Files Changed

Filename Overview
.github/workflows/test-litellm-matrix.yml Pre-installs nodejs-wheel-binaries==24.13.1 and sets PRISMA_BINARY_CACHE_DIR before prisma generate; consistent with Dockerfile approach and fixes flaky ECONNRESET failures.
.github/workflows/test-proxy-e2e-azure-batches.yml Same nodejs-wheel-binaries fix applied to the Generate Prisma client step; minor inconsistency: PRISMA_BINARY_CACHE_DIR is not propagated to the subsequent prisma migrate deploy step.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[CI: Generate Prisma client step] --> B{Before fix}
    A --> C{After fix}

    B --> D[prisma generate invoked]
    D --> E[prisma detects no Node.js in venv]
    E --> F[Falls back to nodeenv]
    F --> G[Downloads Node.js from internet]
    G --> H{npm registry reachable?}
    H -- Yes --> I[npm install [email protected] succeeds]
    H -- No --> J[ECONNRESET / flaky failure]

    C --> K[pip install nodejs-wheel-binaries==24.13.1]
    K --> L[prisma generate invoked]
    L --> M[prisma detects nodejs-wheel-binaries in venv]
    M --> N[Uses bundled Node.js + npm locally]
    N --> O[prisma generate succeeds reliably]
Loading

Comments Outside Diff (1)

  1. .github/workflows/test-proxy-e2e-azure-batches.yml, line 77-83 (link)

    P2 PRISMA_BINARY_CACHE_DIR not set for prisma migrate deploy

    The Generate Prisma client step sets PRISMA_BINARY_CACHE_DIR: ${{ runner.temp }}/prisma-cache, but the subsequent Run Prisma migrations step (prisma migrate deploy) does not. This is inconsistent — if Prisma downloads any engine binaries during migration, it won't use the pinned cache path for that step.

    In practice this is likely benign because nodejs-wheel-binaries (installed in the venv in the prior step) is the main mechanism preventing runtime npm downloads, and the venv persists across steps in the same job. For full consistency, consider adding the same PRISMA_BINARY_CACHE_DIR env var to the Run Prisma migrations step as well.

Reviews (1): Last reviewed commit: "Pin nodejs-wheel-binaries in CI workflow..." | Re-trigger Greptile

@yuneng-berri yuneng-berri merged commit 241c456 into main Mar 27, 2026
40 of 86 checks passed
@yuneng-berri yuneng-berri deleted the litellm_pin_prisma_node_ci branch March 27, 2026 19:17
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.

3 participants