GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(cli): add version mismatch warning for global vs local prisma by Christiantyemele · Pull Request #29555 · prisma/orm ConversationSummaryImplements a warning when the global Prisma CLI version differs from the local project version. Changes
BountyThis PR addresses issue #1911 (50 bounty on Algora). Testing
Checklist
Closes #1911
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
Summary by CodeRabbitRelease Notes
WalkthroughThis PR adds version-mismatch detection between the global Prisma CLI and local project dependencies. A new utility reads the nearest ChangesVersion Mismatch Detection and Integration
🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
packages/cli/src/__tests__/checkVersionMismatch.test.ts (1)
1-76:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftFile naming violates kebab-case convention.
This test file should be named
check-version-mismatch.test.tsinstead ofcheckVersionMismatch.test.ts. As per coding guidelines, new TypeScript files must use kebab-case for file names.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/__tests__/checkVersionMismatch.test.ts` around lines 1 - 76, The test file name violates the kebab-case rule—rename the file from checkVersionMismatch.test.ts to check-version-mismatch.test.ts and update any references to it (e.g., test runner imports or scripts) so the test suite still picks it up; no code changes inside functions like checkVersionMismatch or createProject are required, just move/rename the file and verify CI/jest patterns (e.g., any custom test glob or explicit import paths) still match the new kebab-case filename.packages/cli/src/utils/checkVersionMismatch.ts (2)
1-97:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftFile naming violates kebab-case convention.
This file should be named
check-version-mismatch.tsinstead ofcheckVersionMismatch.ts. As per coding guidelines, new TypeScript files must use kebab-case for file names.This also requires updating:
- The import in
CLI.ts(line 9)- The import in the test file
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/utils/checkVersionMismatch.ts` around lines 1 - 97, The file name checkVersionMismatch.ts must be renamed to kebab-case check-version-mismatch.ts; update any imports that reference it (e.g., change the import in CLI.ts that currently imports { checkVersionMismatch } from './utils/checkVersionMismatch' to the new path './utils/check-version-mismatch') and update test imports similarly; ensure the named export checkVersionMismatch (and any references to getLocalPrismaVersions, getMismatchedLocalVersion, normalizeVersion if used elsewhere) remains unchanged so only the file path needs updating in CLI.ts and the test file(s).
191-191: 🧹 Nitpick | 🔵 TrivialConsider updating to [email protected] (latest as of May 2026).
Version 7.7.0 is secure with no known vulnerabilities, but 7.8.0 is the current latest version and was published on May 8, 2026. Update to the latest version unless there's a specific reason to pin to 7.7.0.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/utils/checkVersionMismatch.ts` at line 191, The project is using [email protected]; update it to [email protected] by changing the dependency entry for "semver" to "7.8.0" (or a suitable semver range) in your package.json and then reinstalling/updating lockfiles (npm install or yarn install) so packages/cli/src/utils/checkVersionMismatch.ts will use the new version; ensure package-lock.json/yarn.lock is committed and run project tests to confirm no regressions.
packages/cli/src/CLI.ts (1)
9-9:⚠️ Potential issue | 🟡 MinorImport path will need updating when utility file is renamed.
When
checkVersionMismatch.tsis renamed tocheck-version-mismatch.tsper the coding guidelines (flagged in the utility file review), this import will need to be updated accordingly.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/CLI.ts` at line 9, The import in CLI.ts currently references ./utils/checkVersionMismatch which will break when the utility file is renamed; update the import statement in packages/cli/src/CLI.ts to the new kebab-case module path (./utils/check-version-mismatch) and verify the named import checkVersionMismatch matches the exported symbol from that module, and scan for any other imports referencing checkVersionMismatch to update them similarly.
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/utils/checkVersionMismatch.ts`:
- Around line 50-52: The bare catch in checkVersionMismatch (which currently
does "} catch { return { prisma: null, prismaClient: null } }") swallows errors;
change it to catch the error (e.g., "catch (err)") and log it before returning
the null fallback so real failures are visible—use the module's logger if
available (or console.error) and include a brief contextual message referencing
prisma/prismaClient creation so the log reads something like "Failed to check
version / create prisma client:" plus the error, then still return { prisma:
null, prismaClient: null }.
---
Outside diff comments:
In `@packages/cli/src/__tests__/checkVersionMismatch.test.ts`:
- Around line 1-76: The test file name violates the kebab-case rule—rename the
file from checkVersionMismatch.test.ts to check-version-mismatch.test.ts and
update any references to it (e.g., test runner imports or scripts) so the test
suite still picks it up; no code changes inside functions like
checkVersionMismatch or createProject are required, just move/rename the file
and verify CI/jest patterns (e.g., any custom test glob or explicit import
paths) still match the new kebab-case filename.
In `@packages/cli/src/utils/checkVersionMismatch.ts`:
- Around line 1-97: The file name checkVersionMismatch.ts must be renamed to
kebab-case check-version-mismatch.ts; update any imports that reference it
(e.g., change the import in CLI.ts that currently imports { checkVersionMismatch
} from './utils/checkVersionMismatch' to the new path
'./utils/check-version-mismatch') and update test imports similarly; ensure the
named export checkVersionMismatch (and any references to getLocalPrismaVersions,
getMismatchedLocalVersion, normalizeVersion if used elsewhere) remains unchanged
so only the file path needs updating in CLI.ts and the test file(s).
- Line 191: The project is using [email protected]; update it to [email protected] by
changing the dependency entry for "semver" to "7.8.0" (or a suitable semver
range) in your package.json and then reinstalling/updating lockfiles (npm
install or yarn install) so packages/cli/src/utils/checkVersionMismatch.ts will
use the new version; ensure package-lock.json/yarn.lock is committed and run
project tests to confirm no regressions.
---
Duplicate comments:
In `@packages/cli/src/CLI.ts`:
- Line 9: The import in CLI.ts currently references ./utils/checkVersionMismatch
which will break when the utility file is renamed; update the import statement
in packages/cli/src/CLI.ts to the new kebab-case module path
(./utils/check-version-mismatch) and verify the named import
checkVersionMismatch matches the exported symbol from that module, and scan for
any other imports referencing checkVersionMismatch to update them similarly.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: eb4ac2af-88a5-4a55-a8a4-58410dff55c5
pnpm-lock.yaml is excluded by !**/pnpm-lock.yamlAGENTS.mdpackages/cli/package.jsonpackages/cli/src/CLI.tspackages/cli/src/__tests__/checkVersionMismatch.test.tspackages/cli/src/utils/checkVersionMismatch.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@coderabbitai I've addressed the review feedback:
The docstring coverage should now meet the 80% threshold. Please re-run the checks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CodeRabbit chat interactions are restricted to organization members for this repository. Ask an organization member to interact with CodeRabbit, or set |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
📝 Updates MadeI've addressed all review feedback and significantly improved the PR: ✅ Code Quality Improvements
🧪 Enhanced Test Coverage (8 tests total, all passing)
🎯 Why This PR Should Be Merged
Ready for final review! 🚀 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/__tests__/checkVersionMismatch.test.ts`:
- Around line 1-8: The test file for checkVersionMismatch is currently in
src/__tests__; move packages/cli/src/__tests__/checkVersionMismatch.test.ts to
sit alongside its source file packages/cli/src/utils/check-version-mismatch.ts
(e.g., packages/cli/src/utils/checkVersionMismatch.test.ts), update the import
paths to use the relative path to the local module (import {
checkVersionMismatch } from './check-version-mismatch' or equivalent), and
adjust any packageJson import path if needed so the test still imports
'../../package.json' correctly from the new location.
In `@packages/cli/src/utils/checkVersionMismatch.ts`:
- Line 1: Rename the new file from checkVersionMismatch.ts to kebab-case
check-version-mismatch.ts and update every import/require/export that references
the old module name (e.g., any imports like "./utils/checkVersionMismatch" or
similar) to use "./utils/check-version-mismatch"; also update any barrel/index
exports or package exports that mention checkVersionMismatch so build and tests
pick up the renamed module.
- Around line 29-30: Rename the file to kebab-case (check-version-mismatch.ts)
and update the version comparison in getMismatchedLocalVersion (and any other
helper(s) in the same module) to use semver.satisfies(globalVersion, localRange)
when local versions are ranges instead of normalizing with semver.minVersion();
ensure you still fall back to direct equality/semver.eq for exact versions and
treat a globalVersion that satisfies the local range as compatible (no warning).
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 65856aeb-af93-43c8-b69e-56f987e3cf56
packages/cli/src/__tests__/checkVersionMismatch.test.tspackages/cli/src/utils/checkVersionMismatch.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks for working on this. A few fundamental issues need rework before this is reviewable:
We're triaging a large number of overlapping PRs for this issue. If we don't hear back within the next few days, we'll close this PR to keep the queue manageable. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @Christiantyemele — thanks for this, and apologies for the slow reply. We're clearing the open PR backlog ahead of moving this codebase to a We are closing this one: the global/local version warning has already landed in #29593, with any remaining follow-up consolidated in #29546. Keeping another implementation open would duplicate that work. Thanks for the time you put into it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Warn on mismatch between globalprisma and local prisma or @prisma/client
There was an error while loading. Please reload this page.