Repository navigation
feat: migrate Prisma from 6.14.0 to 7.7.0 with driver adapters #4469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
deepshekhardas
wants to merge
20
commits into
triggerdotdev:main
from
deepshekhardas:feat/prisma-7-upgrade
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ed41f0a
fix(cli-v3): allow disabling source-map-support to prevent OOM with S…
023c3fd
fix(cli-v3): ignore engine checks during deployment install to preven…
93aa053
fix(core): delegate to original console in ConsoleInterceptor to pres…
8b684e1
fix(cli-v3): authenticate to Docker Hub to prevent rate limits (#2911)
737ad56
fix(cli-v3): ensure worker cleanup on SIGINT/SIGTERM (#2909)
c97cbcc
verify: add reproduction scripts and PR details for all major fixes
aa90db9
verify: add reproduction scripts and PR details for all major fixes
f5ce2bc
docs: add consolidated PR body description
8c986db
chore: remove reproduction scripts and temporary files
82f198f
Merge remote-tracking branch 'remotes/origin/fix/sentry-oom-2920'
9a3e8d0
Merge branch 'fix/issue-2909-orphaned-workers'
e101f8e
chore: remove reproduction scripts after verification
d01d438
fix: resolve typecheck errors after merge
aafb736
fix(webapp): auto-recover replication services after stream errors
ericallam 7fa3a16
fix(webapp): reschedule reconnect when subscribe() throws
ericallam 4e6461a
fix(webapp): reschedule reconnect when subscribe() returns stopped
ericallam 4b5db51
fix(webapp): drop bogus isStopped check, route leader-lock failure th…
ericallam 5365936
fix(webapp): scope leaderElection-lost recovery to reconnect strategy
ericallam d35bf04
Merge pull request #10 from deepshekhardas/pr/3613-replication-fix
deepshekhardas 5f4c41a
feat: migrate Prisma from 6.14.0 to 7.7.0 with driver adapters (PR #3…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(cli-v3): ignore engine checks during deployment install to preven…
…t build server failures (#2913)
- Loading branch information
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@trigger.dev/cli-v3": patch | ||
| --- | ||
|
|
||
| Fix: Ignore engine checks during deployment install phase to prevent failure on build server when Node version mismatch exists. (#2913) |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
|
|
||
| import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; | ||
| import { updateTriggerPackages } from "./update.js"; | ||
| import * as nypm from "nypm"; | ||
| import * as pkgTypes from "pkg-types"; | ||
| import * as fs from "node:fs/promises"; | ||
| import * as clack from "@clack/prompts"; | ||
| import path from "node:path"; | ||
|
|
||
| // Mock dependencies | ||
| vi.mock("nypm"); | ||
| vi.mock("pkg-types"); | ||
| vi.mock("node:fs/promises"); | ||
| vi.mock("@clack/prompts"); | ||
| vi.mock("std-env", () => ({ | ||
| hasTTY: true, | ||
| isCI: false, | ||
| })); | ||
| vi.mock("../utilities/initialBanner.js", () => ({ | ||
| updateCheck: vi.fn().mockResolvedValue(undefined), | ||
| printStandloneInitialBanner: vi.fn(), | ||
| })); | ||
| vi.mock("../version.js", () => ({ | ||
| VERSION: "3.0.0", | ||
| })); | ||
| vi.mock("../cli/common.js", () => ({ | ||
| CommonCommandOptions: { pick: () => ({}) }, | ||
| })); | ||
| vi.mock("../utilities/cliOutput.js", () => ({ | ||
| chalkError: vi.fn(), | ||
| prettyError: vi.fn(), | ||
| prettyWarning: vi.fn(), | ||
| })); | ||
| vi.mock("../utilities/fileSystem.js", () => ({ | ||
| removeFile: vi.fn(), | ||
| writeJSONFilePreserveOrder: vi.fn(), | ||
| })); | ||
| vi.mock("../utilities/logger.js", () => ({ | ||
| logger: { | ||
| debug: vi.fn(), | ||
| log: vi.fn(), | ||
| table: vi.fn(), | ||
| }, | ||
| })); | ||
| vi.mock("../utilities/windows.js", () => ({ | ||
| spinner: () => ({ | ||
| start: vi.fn(), | ||
| message: vi.fn(), | ||
| stop: vi.fn(), | ||
| }), | ||
| })); | ||
|
|
||
| describe("updateTriggerPackages", () => { | ||
| beforeEach(() => { | ||
| vi.resetAllMocks(); | ||
|
|
||
| // Default mocks | ||
| vi.mocked(fs.writeFile).mockResolvedValue(undefined); | ||
| vi.mocked(fs.rm).mockResolvedValue(undefined); | ||
| vi.mocked(pkgTypes.readPackageJSON).mockResolvedValue({ | ||
| dependencies: { | ||
| "@trigger.dev/sdk": "2.0.0", // Mismatch | ||
| }, | ||
| }); | ||
| vi.mocked(pkgTypes.resolvePackageJSON).mockResolvedValue("/path/to/package.json"); | ||
| vi.mocked(clack.confirm).mockResolvedValue(true); // User confirms update | ||
| vi.mocked(nypm.installDependencies).mockResolvedValue(undefined); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| vi.clearAllMocks(); | ||
| }); | ||
|
|
||
| it("should pass --no-engine-strict for npm when ignoreEngines is true", async () => { | ||
| vi.mocked(nypm.detectPackageManager).mockResolvedValue({ name: "npm", command: "npm", version: "1.0.0" } as any); | ||
|
|
||
| await updateTriggerPackages(".", { ignoreEngines: true } as any, true, true); | ||
|
|
||
| expect(nypm.installDependencies).toHaveBeenCalledWith(expect.objectContaining({ | ||
| args: ["--no-engine-strict"], | ||
| })); | ||
| }); | ||
|
|
||
| it("should pass --config.engine-strict=false for pnpm when ignoreEngines is true", async () => { | ||
| vi.mocked(nypm.detectPackageManager).mockResolvedValue({ name: "pnpm", command: "pnpm", version: "1.0.0" } as any); | ||
|
|
||
| await updateTriggerPackages(".", { ignoreEngines: true } as any, true, true); | ||
|
|
||
| expect(nypm.installDependencies).toHaveBeenCalledWith(expect.objectContaining({ | ||
| args: ["--config.engine-strict=false"], | ||
| })); | ||
| }); | ||
|
|
||
| it("should pass --ignore-engines for yarn when ignoreEngines is true", async () => { | ||
| vi.mocked(nypm.detectPackageManager).mockResolvedValue({ name: "yarn", command: "yarn", version: "1.0.0" } as any); | ||
|
|
||
| await updateTriggerPackages(".", { ignoreEngines: true } as any, true, true); | ||
|
|
||
| expect(nypm.installDependencies).toHaveBeenCalledWith(expect.objectContaining({ | ||
| args: ["--ignore-engines"], | ||
| })); | ||
| }); | ||
|
|
||
| it("should NOT pass engine flags if ignoreEngines is false (default)", async () => { | ||
| vi.mocked(nypm.detectPackageManager).mockResolvedValue({ name: "npm", command: "npm", version: "1.0.0" } as any); | ||
|
|
||
| await updateTriggerPackages(".", { ignoreEngines: false } as any, true, true); | ||
|
|
||
| expect(nypm.installDependencies).toHaveBeenCalledWith(expect.objectContaining({ | ||
| args: [], | ||
| })); | ||
| }); | ||
| }); |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Option to skip Node version checks during deployment install has no effect
The new setting for skipping Node engine checks is accepted and forwarded (
ignoreEngines: trueatpackages/cli-v3/src/commands/update.ts:21andpackages/cli-v3/src/commands/deploy.ts:262) but the install step never uses it, so deployments still fail when the project declares a stricter Node version.Impact: The advertised fix for build-server deployment failures on Node version mismatch does not work, and the newly added tests for it fail.
Missing plumbing into installDependencies
updateTriggerPackagesstill callsawait installDependencies({ cwd: projectPath, silent: true });(packages/cli-v3/src/commands/update.ts:260) with noargs. The new test filepackages/cli-v3/src/commands/update.test.ts:74-112assertsinstallDependenciesis called withargs: ["--no-engine-strict"](npm),["--config.engine-strict=false"](pnpm),["--ignore-engines"](yarn) and[]otherwise — none of which can pass against the current implementation.The fix is to derive the package-manager-specific flag from
options.ignoreEnginesand pass it asargstoinstallDependencies.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.