Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Nov 24, 2025

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 24, 2025

📝 Walkthrough

Walkthrough

Added a runtime Prisma version check to the generate command that emits a yellow warning if the detected Prisma version is 7.0.0 or higher, before plugin execution begins. No public API changes were made.

Changes

Cohort / File(s) Change Summary
Prisma version warning
packages/schema/src/cli/actions/generate.ts
Added dependencies on getPrismaVersion and semver. Introduced conditional version check in generate() that emits a yellow warning if Prisma version >= 7.0.0 prior to plugin execution.

Sequence Diagram(s)

sequenceDiagram
    participant CLI
    participant Generate
    participant Version
    participant Plugins

    CLI->>Generate: generate()
    activate Generate
    
    rect rgb(255, 250, 200)
        Note over Generate,Version: New Version Check
        Generate->>Version: getPrismaVersion()
        Version-->>Generate: version (or undefined)
        
        alt version >= 7.0.0
            Generate->>Generate: Emit yellow warning
        end
    end
    
    Generate->>Plugins: runPlugins()
    Plugins-->>Generate: complete
    deactivate Generate
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single file modification with straightforward version check logic
  • No structural or API changes to review
  • Primary focus: verify version comparison logic and warning message appropriateness

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to evaluate relevance to the changeset. Add a description explaining why this warning is needed and what it communicates to users about Prisma 7 support.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: add CLI warning for Prisma7' accurately describes the main change: adding a warning in the CLI for Prisma 7 compatibility.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/prisma7-warning

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/schema/src/cli/actions/generate.ts (1)

53-56: Prisma ≥7 warning behavior matches the PR objective; consider minor UX polish

The runtime check against 7.0.0 using semver.gte is clear and does exactly what the PR states. Two optional tweaks you might consider:

  • Include the detected version in the warning for clarity, e.g., Detected Prisma ${prismaVersion}. Prisma 7 support ....
  • If you expect pre-release 7 builds (e.g., 7.0.0-beta.1) to also trigger the warning, semver.gte already covers valid 7.x releases, but you could switch to semver.satisfies(prismaVersion, '>=7.0.0-0') if you ever need stricter handling of pre-release semantics.

Otherwise this looks good and is low-risk since it’s a pure warning-side-effect before plugin execution.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bfa40c1 and 74dd748.

📒 Files selected for processing (1)
  • packages/schema/src/cli/actions/generate.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/schema/src/cli/actions/generate.ts (1)
packages/sdk/src/prisma.ts (1)
  • getPrismaVersion (60-79)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build-test (20.x)
  • GitHub Check: build-test (20.x)
  • GitHub Check: dependency-review
  • GitHub Check: build-test (20.x)
🔇 Additional comments (1)
packages/schema/src/cli/actions/generate.ts (1)

3-6: Imports for Prisma version detection and semver look appropriate

The new imports are used correctly later in the file, and the separation of version detection into @zenstackhq/sdk/prisma keeps the CLI logic lean. Just make sure semver is declared as a dependency of this package and that its import style (default import) matches how it’s used elsewhere in the repo / your tsconfig settings (e.g., esModuleInterop).

@ymc9 ymc9 merged commit a78f5a7 into dev Nov 24, 2025
8 checks passed
@ymc9 ymc9 deleted the chore/prisma7-warning branch November 24, 2025 23:26
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.

2 participants