Skip to content
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

chore: bump prisma dependency to 6.0.x #1896

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

chore: bump prisma dependency to 6.0.x #1896

wants to merge 1 commit into from

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Nov 29, 2024

No description provided.

Copy link
Contributor

coderabbitai bot commented Nov 29, 2024

📝 Walkthrough

Walkthrough

This pull request updates the version numbers of the prisma and @prisma/client packages from 5.22.x to 6.0.x in two files: script/test-scaffold.ts and tests/integration/tests/cli/plugins.test.ts. The changes ensure that the test scaffold and integration tests for CLI plugins utilize the latest versions of these packages. The overall structure and logic of the affected files remain unchanged, maintaining existing error handling and control flow.

Changes

File Path Change Summary
script/test-scaffold.ts Updated prisma and @prisma/client versions from 5.22.x to 6.0.x in the run function.
tests/integration/tests/cli/plugins.test.ts Updated @prisma/client and prisma versions from 5.22.x to 6.0.x in the initProject function.

Possibly related PRs

  • chore: Prisma 5.22 support #1829: The changes in this PR involve updating the version numbers of the prisma and @prisma/client packages in the same files as the main PR, indicating a direct relationship in the versioning updates.
  • chore: upgrade to Prisma 5.21 #1777: This PR also updates the version numbers of the prisma and @prisma/client packages in the same files, showing a similar context of dependency management.
  • chore: Prisma 5.20 support #1741: This PR modifies the version numbers of the prisma and @prisma/client packages in the same files, establishing a connection through the version updates.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 2

🧹 Outside diff range and nitpick comments (2)
script/test-scaffold.ts (1)

22-22: Consider adding package.json version constraints

Since this is a test scaffold, consider adding these version constraints to the project's package.json to ensure consistent testing environments.

tests/integration/tests/cli/plugins.test.ts (1)

78-78: ⚠️ Review impact of Prisma 6.0 breaking changes

Upgrading to Prisma 6.0.x introduces breaking changes that might affect the tests. Please review the Prisma 6.0 release notes to ensure the test suite remains compatible.

Key areas to verify:

  1. Changes in client API
  2. Schema validation rules
  3. Migration engine behavior
  4. Query engine behavior

Consider adding test cases specifically for Prisma 6.0 features and breaking changes to ensure compatibility.

Also applies to: 88-88

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a747d95 and 3807189.

⛔ Files ignored due to path filters (7)
  • packages/runtime/package.json is excluded by !**/*.json
  • packages/schema/package.json is excluded by !**/*.json
  • packages/sdk/package.json is excluded by !**/*.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !**/*.yaml
  • tests/integration/test-run/package.json is excluded by !**/*.json
  • tests/integration/tests/frameworks/nextjs/test-project/package.json is excluded by !**/*.json
  • tests/integration/tests/frameworks/trpc/test-project/package.json is excluded by !**/*.json
📒 Files selected for processing (2)
  • script/test-scaffold.ts (1 hunks)
  • tests/integration/tests/cli/plugins.test.ts (2 hunks)
🔇 Additional comments (1)
script/test-scaffold.ts (1)

22-22: Verify compatibility with other dependencies

The command also installs other dependencies like zod and decimal.js. Please verify that these packages are compatible with Prisma 6.0.x.

Let's check for any potential compatibility issues:

✅ Verification successful

Let me gather more information about the specific versions and usage patterns.


Based on the gathered information, I can now provide a final response:

Dependencies are compatible with Prisma 6.0.x

The codebase shows proper integration between Prisma, Zod, and decimal.js:

  • decimal.js is used at version ^10.4.2 which is fully compatible with Prisma 6.0.x
  • Zod is used at version ^3.22.4 and is properly integrated with Prisma's types including Decimal
  • The codebase includes proper type handling and serialization for Decimal types between Prisma and Zod
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for compatibility between dependencies

# Search for Zod usage with Prisma
echo "Checking Zod integration with Prisma:"
rg -g '!node_modules' 'zod.*prisma|prisma.*zod'

# Search for decimal.js usage with Prisma
echo "Checking decimal.js integration with Prisma:"
rg -g '!node_modules' 'decimal.*prisma|prisma.*decimal'

Length of output: 3006


Script:

#!/bin/bash
# Check package.json files for dependency versions
echo "Checking package.json files:"
fd package.json --exec cat {}

# Check for decimal.js type usage
echo -e "\nChecking decimal.js type usage:"
rg -g '!node_modules' 'Decimal|decimal\.js' -A 2

# Check for Zod schema definitions
echo -e "\nChecking Zod schema definitions:"
ast-grep --pattern 'z.object({
  $$$
})'

Length of output: 93785

@@ -19,6 +19,6 @@ function run(cmd: string) {
}

run('npm init -y');
run('npm i --no-audit --no-fund typescript prisma@5.22.x @prisma/client@5.22.x zod decimal.js @types/node');
run('npm i --no-audit --no-fund typescript prisma@6.0.x @prisma/client@6.0.x zod decimal.js @types/node');
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Version upgrade requires attention to dependency ranges

The codebase shows mixed version ranges that need alignment:

  • packages/schema/package.json has "prisma": "5.0.0 - 6.0.x" and "@prisma/client": "6.0.x"
  • packages/runtime/package.json has "@prisma/client": "5.0.0 - 6.0.x"
  • The test scaffold is setting both to 6.0.x

These inconsistencies in version ranges could lead to compatibility issues:

  • The schema package allows both v5 and v6 for Prisma but restricts client to v6
  • The runtime package allows both v5 and v6 for the client
  • The test scaffold strictly uses v6

Please:

  1. Align version ranges across all dependencies to either support the transition period (5.0.0 - 6.0.x) or commit fully to v6 (6.0.x)
  2. Update the schema.prisma files in the test projects if they require changes for Prisma v6 compatibility
🔗 Analysis chain

Verify breaking changes for Prisma 6.0 upgrade

This is a major version upgrade from 5.x to 6.0.x which likely includes breaking changes. Please ensure that:

  1. All breaking changes have been reviewed
  2. Required migrations are planned
  3. Test scaffolding remains compatible with the production environment

Let's verify the version consistency across the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any mismatched Prisma versions or migration guides

# Search for other Prisma version specifications
echo "Checking Prisma version specifications:"
rg -g '!node_modules' -g '!package-lock.json' -A 1 -B 1 'prisma[@\"].*5\.|prisma[@\"].*6\.'

# Search for Prisma schema files that might need updates
echo "Checking Prisma schema files:"
fd 'schema.prisma$'

Length of output: 665


Script:

#!/bin/bash
# Let's fix the regex and check for Prisma versions in package files and other relevant locations
echo "Checking Prisma version specifications in package files:"
rg -g '!node_modules' -g '!package-lock.json' '"prisma":|"@prisma/client":' package.json packages/*/package.json

echo -e "\nChecking schema.prisma files for provider and version info:"
for f in $(fd 'schema.prisma$'); do
    echo "=== $f ==="
    head -n 10 "$f"
done

echo -e "\nChecking for Prisma-related migration or setup files:"
fd -e ts -e js -g '*prisma*'

Length of output: 4470

@@ -75,7 +75,7 @@ describe('CLI Plugins Tests', () => {
'swr',
'@tanstack/[email protected]',
'@trpc/server',
'@prisma/client@5.22.x',
'@prisma/client@6.0.x',
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Prisma version mismatch detected across the codebase

The version update to Prisma 6.0.x is inconsistent across the codebase:

  • Most test projects and schema package use Prisma 6.0.x
  • However, tRPC test projects are still using Prisma 5.x versions:
    • packages/plugins/trpc/tests/projects/t3-trpc-v11: ^5.14.0
    • packages/plugins/trpc/tests/projects/nuxt-trpc-v11: ^5.19.1
    • packages/plugins/trpc/tests/projects/nuxt-trpc-v10: ^5.19.1

These tRPC test projects should also be updated to maintain version consistency across the codebase.

🔗 Analysis chain

Verify coordination with main package dependencies

The Prisma dependencies are being bumped from 5.22.x to 6.0.x in the test files. As this is a major version upgrade, we should ensure this is coordinated with the main package dependencies.

Also applies to: 88-88

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check main package.json files for Prisma dependencies to ensure version alignment

# Search for prisma dependencies in package.json files
echo "Checking Prisma dependencies in package.json files:"
fd 'package.json' --type f --exclude 'node_modules' --exec sh -c 'echo "=== $1 ==="; cat "$1" | jq -r ".dependencies.\"@prisma/client\", .dependencies.prisma, .devDependencies.\"@prisma/client\", .devDependencies.prisma"' sh {}

Length of output: 1833

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.

1 participant