-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: broken tests #8401
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
base: latest
Are you sure you want to change the base?
fix: broken tests #8401
Conversation
WalkthroughReplaces legacy per-example Bash test runners and a central .github get-ppg-dev helper with a TypeScript/Vitest-based test harness and configs; removes many Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GHA as GitHub Actions
participant Vitest as Vitest Runner (tests/fixtures.ts)
participant Example as Example Project
participant PrismaDev as Prisma Dev Server
participant DB as Provisioned Database
GHA->>Vitest: start test job (matrix entry)
Vitest->>Example: npm install
Vitest->>PrismaDev: start Prisma Dev (background)
PrismaDev-->>DB: provision/connect
Vitest->>PrismaDev: poll for DATABASE_URL
PrismaDev-->>Vitest: emit DATABASE_URL
Vitest->>Example: run prisma generate / push / migrate / db seed
Vitest->>Example: run example test steps
Vitest->>PrismaDev: teardown (close)
Vitest-->>GHA: report results
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
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.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/get-ppg-dev/index.js:
- Around line 10-12: The code currently reads the undocumented unstable property
server.ppg.url from the startPrismaDevServer result; replace that usage with the
stable documented property server.database.connectionString by updating the
reference to use server.database.connectionString wherever server.ppg.url is
accessed (keep startPrismaDevServer call unchanged and only swap the property
access).
In @CLAUDE.md:
- Line 90: The doc line "Uses Node.js LTS/Hydrogen (v22)" is inaccurate; update
that sentence in CLAUDE.md to match .nvmrc by removing the wrong codename and
referencing v22 (e.g., change to "Uses Node.js v22" or "Uses Node.js 22.x") so
the Node version statement is correct and consistent with .nvmrc.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/get-ppg-dev/index.js.nvmrcCLAUDE.mddatabases/mongodb/prisma/schema.prismaorm/ai-sdk-nextjs/package.json
🧰 Additional context used
🪛 LanguageTool
CLAUDE.md
[uncategorized] ~39-~39: The official name of this software platform is spelled with a capital “H”.
Context: ...y migrations ## Testing Tests run via .github/scripts/test-all.sh. Each example has ...
(GITHUB)
[uncategorized] ~39-~39: The official name of this software platform is spelled with a capital “H”.
Context: ...mple has a corresponding test script at .github/tests/{category}/{example}/run.sh. ##...
(GITHUB)
[uncategorized] ~60-~60: The official name of this software platform is spelled with a capital “H”.
Context: ...ealth checks or Postman collections (in .github/tests/postman_collections/) 6. Cleanup...
(GITHUB)
⏰ 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). (12)
- GitHub Check: test (orm/hapi-graphql-sdl-first)
- GitHub Check: test (orm/hapi-graphql)
- GitHub Check: test (orm/astro)
- GitHub Check: test (orm/clerk-astro)
- GitHub Check: test (orm/clerk-nextjs)
- GitHub Check: test (orm/authjs-nextjs)
- GitHub Check: test (orm/betterauth-astro)
- GitHub Check: test (orm/nest-graphql)
- GitHub Check: test (orm/grpc)
- GitHub Check: test (orm/betterauth-nextjs)
- GitHub Check: test (orm/nuxt)
- GitHub Check: test (orm/solid-start)
🔇 Additional comments (4)
databases/mongodb/prisma/schema.prisma (1)
2-5: LGTM! Essential configuration added.Adding
url = env("DATABASE_URL")to the MongoDB datasource is necessary and follows Prisma best practices. This was likely causing test failures and is correctly fixed here..github/get-ppg-dev/index.js (1)
4-4: API migration from unstable to stable API is appropriate and verified.The migration from
unstable_startServertostartPrismaDevServeris correctly implemented and the@prisma/devpackage version (set to "latest") supports this stable API. The import and usage are correct..nvmrc (1)
1-1: The Node.js version upgrade from 18 (Hydrogen, EOL as of April 30, 2024) to 22 (LTS as of October 2024) is justified and aligns with the PR's purpose of fixing broken tests. Since 87 of 91 package.json files in the examples repository lack explicit Node engine constraints, they will use the .nvmrc version. A few examples already specify Node 22+ in their engines fields. No compatibility verification is needed—this is the fix itself.Likely an incorrect or invalid review comment.
orm/ai-sdk-nextjs/package.json (1)
14-15: The Prisma v7 migration appears properly implemented.The upgrade to v7.2.0 is consistent across all three packages (
@prisma/client,@prisma/adapter-pg, andprisma), and the codebase is using v7-compatible patterns:
lib/prisma.tscorrectly initializesPrismaPgadapter with connection stringprisma.config.tsuses the v7defineConfigAPI- The schema is straightforward with no deprecated patterns
Since this PR is titled "fix: broken tests," the v7 migration appears intentional to resolve test failures. Verify that the test suite passes end-to-end to confirm the migration resolved the underlying issues.
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.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/tests/orm/authjs-nextjs/run.sh:
- Line 55: Remove the redundant second "npm install" call in the script: keep
the initial npm install earlier in the file (the one at line ~18) and delete the
later standalone "npm install" invocation (the one shown in the diff) so
dependencies are not reinstalled unnecessarily; ensure no other logic depends on
a postinstall by verifying there are no postinstall hooks in package.json and
that the script still succeeds after removing the duplicate.
In @.github/tests/orm/graphql/run.sh:
- Around line 56-59: The PR introduced duplicate seeding: `npx prisma migrate
reset --force` now runs the seed automatically (because `--skip-seed` was
removed), and then `npx prisma db seed` runs again causing unique constraint
failures; fix by restoring `--skip-seed` to the `npx prisma migrate reset
--force` invocation to prevent automatic seeding, or alternatively remove the
explicit `npx prisma db seed` line; also consider removing the redundant `npx
prisma migrate dev --name init` line since `migrate reset` already applies
migrations—update the script accordingly.
🧹 Nitpick comments (4)
.github/tests/orm/cloudflare-workers/run.sh (2)
56-57: Good addition! Consider adding--schemaflag for consistency.The
npx prisma generatestep is correctly placed before the migration. However, the migrate command on line 57 explicitly specifies--schema prisma/schema.prisma, while the generate command doesn't. For consistency and clarity, consider adding the same flag to the generate command.♻️ Suggested improvement for consistency
-npx prisma generate +npx prisma generate --schema prisma/schema.prisma npx prisma migrate dev --name init --schema prisma/schema.prisma
55-55: Remove redundantnpm install.This
npm installappears redundant since the same command already ran on line 18 in the same directory (before thepushdon line 22). After thepopdon line 53, you're back in the original directory where dependencies were already installed.♻️ Proposed fix to remove redundancy
popd > /dev/null -npm install npx prisma generate npx prisma migrate dev --name init --schema prisma/schema.prisma.github/tests/orm/clerk-nextjs/run.sh (1)
3-3: Consider adding trap-based cleanup for background processes.While
set -euprovides good error handling, consider adding a trap to ensure the background NODE_PID process is cleaned up even if commands fail:trap 'kill "$NODE_PID" 2>/dev/null || true' EXITThis would ensure cleanup happens regardless of how the script exits. This is a broader script improvement, not specific to the current change.
.github/tests/orm/react-router-7/run.sh (1)
59-59: Consider adding DATABASE_URL prefix for consistency.Lines 57, 58, and 60 explicitly prefix their Prisma commands with
DATABASE_URL="$DATABASE_URL", but line 59 relies solely on the exported variable from line 50. While this works, adding the prefix would improve consistency and defensive coding practices.🔄 Suggested change for consistency
-npx prisma migrate dev --name init +DATABASE_URL="$DATABASE_URL" npx prisma migrate dev --name init
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (38)
.github/tests/data-modeling/delegated-types/run.sh.github/tests/databases/prisma-postgres/run.sh.github/tests/orm/ai-sdk-nextjs/run.sh.github/tests/orm/astro/run.sh.github/tests/orm/authjs-nextjs/run.sh.github/tests/orm/betterauth-astro/run.sh.github/tests/orm/betterauth-nextjs/run.sh.github/tests/orm/clerk-astro/run.sh.github/tests/orm/clerk-nextjs/run.sh.github/tests/orm/cloudflare-workers/run.sh.github/tests/orm/express/run.sh.github/tests/orm/fastify-graphql-sdl-first/run.sh.github/tests/orm/fastify-graphql/run.sh.github/tests/orm/fastify/run.sh.github/tests/orm/graphql-auth/run.sh.github/tests/orm/graphql-nexus/run.sh.github/tests/orm/graphql-sdl-first/run.sh.github/tests/orm/graphql-subscriptions/run.sh.github/tests/orm/graphql/run.sh.github/tests/orm/grpc/run.sh.github/tests/orm/hapi-graphql-sdl-first/run.sh.github/tests/orm/hapi-graphql/run.sh.github/tests/orm/hapi/run.sh.github/tests/orm/hono/run.sh.github/tests/orm/koa/run.sh.github/tests/orm/nest-graphql-sdl-first/run.sh.github/tests/orm/nest-graphql/run.sh.github/tests/orm/nest/run.sh.github/tests/orm/nextjs-graphql/run.sh.github/tests/orm/nextjs-trpc/run.sh.github/tests/orm/nextjs/run.sh.github/tests/orm/nuxt/run.sh.github/tests/orm/react-router-7/run.sh.github/tests/orm/script/run.sh.github/tests/orm/solid-start/run.sh.github/tests/orm/sveltekit/run.sh.github/tests/orm/testing-express/run.sh.github/tests/orm/typedsql/run.sh
✅ Files skipped from review due to trivial changes (1)
- .github/tests/data-modeling/delegated-types/run.sh
🚧 Files skipped from review as they are similar to previous changes (3)
- .github/tests/orm/fastify-graphql/run.sh
- .github/tests/orm/koa/run.sh
- .github/tests/orm/nest/run.sh
🧰 Additional context used
🧬 Code graph analysis (17)
.github/tests/orm/nest-graphql-sdl-first/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/hapi/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/typedsql/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/script/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/express/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/astro/run.sh (1)
orm/react-router-7/app/lib/prisma.ts (1)
prisma(11-11)
.github/tests/orm/hapi-graphql-sdl-first/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/hapi-graphql/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/nest-graphql/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/nextjs-graphql/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/testing-express/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/fastify-graphql-sdl-first/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/graphql/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/fastify/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/authjs-nextjs/run.sh (1)
orm/authjs-nextjs/lib/prisma.ts (1)
prisma(7-7)
.github/tests/orm/graphql-nexus/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/sveltekit/run.sh (5)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/react-router-7/app/lib/prisma.ts (1)
prisma(11-11)orm/graphql/src/db.ts (1)
prisma(5-5)
⏰ 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). (36)
- GitHub Check: test (orm/authjs-nextjs)
- GitHub Check: test (orm/script)
- GitHub Check: test (orm/hono)
- GitHub Check: test (orm/astro)
- GitHub Check: test (orm/fastify-graphql)
- GitHub Check: test (orm/express)
- GitHub Check: test (orm/hapi-graphql-sdl-first)
- GitHub Check: test (orm/graphql)
- GitHub Check: test (orm/clerk-astro)
- GitHub Check: test (orm/fastify)
- GitHub Check: test (orm/betterauth-astro)
- GitHub Check: test (orm/nest-graphql)
- GitHub Check: test (orm/graphql-sdl-first)
- GitHub Check: test (orm/clerk-nextjs)
- GitHub Check: test (orm/betterauth-nextjs)
- GitHub Check: test (orm/ai-sdk-nextjs)
- GitHub Check: test (orm/graphql-nexus)
- GitHub Check: test (orm/cloudflare-workers)
- GitHub Check: test (orm/nextjs-trpc)
- GitHub Check: test (orm/postgis-express)
- GitHub Check: test (orm/hapi-graphql)
- GitHub Check: test (orm/fastify-graphql-sdl-first)
- GitHub Check: test (orm/koa)
- GitHub Check: test (orm/react-router-7)
- GitHub Check: test (orm/hapi)
- GitHub Check: test (orm/nextjs-graphql)
- GitHub Check: test (orm/graphql-subscriptions)
- GitHub Check: test (orm/nest)
- GitHub Check: test (orm/nextjs)
- GitHub Check: test (orm/grpc)
- GitHub Check: test (orm/graphql-auth)
- GitHub Check: test (orm/nest-graphql-sdl-first)
- GitHub Check: test (orm/solid-start)
- GitHub Check: test (orm/nuxt)
- GitHub Check: test (orm/testing-express)
- GitHub Check: test (orm/sveltekit)
🔇 Additional comments (34)
.github/tests/orm/hono/run.sh (1)
56-56: Good addition for test reliability.Explicitly generating the Prisma Client before migrations ensures it's available for the seed script and any other code that might reference it. While
prisma migrate devtypically auto-generates the client, being explicit in test scripts improves reliability and makes the setup steps clearer..github/tests/orm/nuxt/run.sh (1)
56-56: LGTM! Explicit client generation ensures availability before migrations.The addition of
npx prisma generatebefore running migrations is a valid fix. Whileprisma migrate devtypically auto-generates the Prisma Client, explicitly generating it beforehand ensures the client is available for any pre-migration hooks or seed scripts that might depend on it..github/tests/orm/nest-graphql-sdl-first/run.sh (1)
56-56: LGTM! Client generation step addresses test failures.The explicit
npx prisma generatebefore migrations ensures the Prisma client is available when needed. Whileprisma migrate devtypically auto-generates the client, this explicit step appears necessary for the test environment and aligns with the PR's objective to fix broken tests..github/tests/orm/betterauth-astro/run.sh (1)
56-56: LGTM! Prisma client generation correctly added.The addition of
npx prisma generateis necessary and correctly placed after dependency installation but before running migrations. This ensures the Prisma client is available when needed.For consistency with line 57, you could optionally add the
--schemaflag:-npx prisma generate +npx prisma generate --schema prisma/schema.prismaHowever, since
prisma/schema.prismais the default location, the current implementation works fine..github/tests/orm/nest-graphql/run.sh (1)
56-58: LGTM! Defensive client generation ensures availability.Adding the explicit
npx prisma generatebefore migrations ensures the Prisma Client is available for downstream operations. Whileprisma migrate devautomatically generates the client after applying migrations, this defensive approach guarantees the client exists beforehand, which can prevent timing or dependency issues—especially for the seed script on line 58.This change aligns with the PR objective to fix broken tests.
.github/tests/orm/clerk-nextjs/run.sh (1)
56-56: LGTM! Essential addition for Prisma workflow.Adding
npx prisma generatebefore running migrations is necessary to ensure the Prisma client is generated. The placement is correct—after dependencies are installed and before migrations execute..github/tests/orm/react-router-7/run.sh (1)
55-60: Remove or reconsider this review comment—the underlying assumptions are incorrect.The concerns about double seeding and unusual migration sequence are based on faulty assumptions. This project has no migration files and no seed script. The sequence of
migrate reset --force→generate→migrate dev --name initis actually correct for initializing a fresh database from scratch:
migrate reset --forcedrops and recreates the databasegeneratecreates the Prisma Clientmigrate dev --name initgenerates the initial schema and migration fromschema.prismadb seedattempts to seed (which will be a no-op since no seed script is configured)The migration sequence is not unusual for a fresh project; it's the standard approach.
Likely an incorrect or invalid review comment.
.github/tests/orm/testing-express/run.sh (1)
56-58: LGTM: Prisma client generation added before migrations.The addition of
npx prisma generatebefore migrations ensures the Prisma client is available for subsequent operations. This pattern is consistently applied across all test scripts in the PR and aligns with the objective of fixing broken tests..github/tests/orm/script/run.sh (1)
56-57: LGTM: Consistent client generation pattern.The Prisma client generation step is correctly placed before migrations, matching the pattern used across other test scripts in this PR.
.github/tests/orm/graphql-subscriptions/run.sh (1)
56-58: LGTM: Client generation properly sequenced.The Prisma client generation is correctly positioned before migrations and seeding operations, ensuring all database operations have access to the generated client.
.github/tests/orm/typedsql/run.sh (1)
6-8: LGTM: Client generation properly sequenced for TypedSQL workflow.The initial
npx prisma generateat line 6 correctly precedes migrations, while line 8'snpx prisma generate --sqlis appropriately placed for TypedSQL-specific code generation after migrations are applied..github/tests/orm/authjs-nextjs/run.sh (1)
56-58: LGTM: Client generation correctly added.The
npx prisma generatecommand is properly positioned before migrations and seeding, consistent with the pattern across all test scripts in this PR..github/tests/orm/solid-start/run.sh (1)
56-56: LGTM! Prisma client generation added before migrations.This addition ensures the Prisma client is generated before running migrations, fixing the broken tests. The placement is correct—after the DATABASE_URL is exported and before migrations are applied.
.github/tests/orm/fastify/run.sh (1)
56-56: LGTM! Consistent with the repository-wide fix.The Prisma client generation step is correctly placed before migrations and seeding, matching the pattern applied across other ORM test scripts in this PR.
.github/tests/orm/nextjs-graphql/run.sh (1)
56-56: LGTM! Proper sequencing of Prisma operations.The client generation step is correctly positioned before migrations and seeding, ensuring the Prisma client is available when needed.
.github/tests/orm/sveltekit/run.sh (1)
56-57: No action needed — schema configuration is correct.The schema path is already defined in
prisma.config.ts(schema: "prisma/schema.prisma"), so bothnpx prisma generateandnpx prisma migrate devwill correctly resolve the schema location. While the explicit--schemaflag on line 57 is technically redundant, it causes no issues. There is no inconsistency or configuration problem.Likely an incorrect or invalid review comment.
.github/tests/orm/betterauth-nextjs/run.sh (1)
56-57: No action needed. Thenpx prisma generatecommand (line 56) correctly omits the--schemaflag. Prisma's generate command automatically discovers the schema at default locations (./prisma/schema.prisma) or via package.json configuration—the--schemaflag is optional and unnecessary in this case. The--schemaflag on the migrate command (line 57) is specific to that command's requirements, not a consistency requirement for generate.Likely an incorrect or invalid review comment.
.github/tests/orm/clerk-astro/run.sh (1)
56-56: LGTM: Prisma client generation added.The addition of
npx prisma generatebefore migrations follows the correct initialization sequence and aligns with the PR-wide pattern to fix broken tests..github/tests/orm/grpc/run.sh (1)
56-56: LGTM: Prisma client generation added.The addition of
npx prisma generatebefore migrations and seeding follows the correct sequence and is consistent with the PR-wide fix pattern..github/tests/orm/graphql-auth/run.sh (1)
56-56: LGTM: Prisma client generation added.The addition of
npx prisma generateensures the Prisma client is available before migrations and seeding, consistent with the PR-wide test fixes..github/tests/orm/nextjs-trpc/run.sh (1)
56-56: LGTM: Prisma client generation added.The addition of
npx prisma generatebefore migrations aligns with the PR-wide pattern and ensures the correct initialization sequence..github/tests/orm/hapi/run.sh (1)
56-56: LGTM: Prisma client generation added.The addition of
npx prisma generatebefore migrations and seeding follows the correct initialization sequence, consistent with the PR-wide test fixes..github/tests/orm/hapi-graphql-sdl-first/run.sh (1)
56-56: LGTM: Explicit client generation ensures reliability.Adding
npx prisma generatebefore migrations is the correct approach to ensure the Prisma Client is available for subsequent steps (migrations and seeding). This fixes the broken test setup flow..github/tests/orm/fastify-graphql-sdl-first/run.sh (1)
56-56: LGTM: Consistent with PR-wide pattern.The addition of explicit Prisma Client generation before migrations aligns with the systematic fix applied across all test scripts in this PR. This ensures the client is available for the test setup workflow.
.github/tests/orm/hapi-graphql/run.sh (1)
56-56: LGTM: Proper setup sequence.Generating the Prisma Client before running migrations ensures all necessary artifacts are in place before database operations. This is the correct fix for the broken test setup.
.github/tests/orm/graphql-sdl-first/run.sh (1)
56-56: LGTM: Ensures client availability before migrations.This explicit generation step addresses the broken test scenario by guaranteeing that the Prisma Client is generated before any database operations occur. The implementation is consistent with the broader PR fix pattern.
.github/tests/orm/nextjs/run.sh (1)
56-56: LGTM: Completes the systematic test fix.The addition of
npx prisma generatebefore migrations ensures the Next.js test setup has the Prisma Client ready for subsequent operations. This change is consistent with the pattern applied across all test scripts in this PR and addresses the broken test issue..github/tests/orm/ai-sdk-nextjs/run.sh (1)
56-56: LGTM! Correct Prisma workflow order.Adding
npx prisma generatebefore migrations ensures the Prisma client is available before running migrations and seeds, which is the recommended workflow..github/tests/orm/astro/run.sh (1)
56-56: LGTM! Consistent Prisma workflow pattern.The addition aligns with the PR-wide pattern of ensuring Prisma client generation before migrations, which is the correct workflow order.
.github/tests/databases/prisma-postgres/run.sh (1)
48-49: LGTM! Proper Prisma workflow with automatic seeding.The changes correctly:
- Generate the Prisma client before migrations
- Allow automatic seeding during migration (by removing
--skip-seed)This is appropriate since there's no explicit seed command afterwards, unlike other test scripts in the PR.
.github/tests/orm/graphql-nexus/run.sh (1)
56-57: LGTM! Clean workflow with explicit client generation.The changes improve the workflow:
- Remove
--skip-seedfrom reset (appropriate since explicit seeding follows)- Add
npx prisma generateafter reset and before migrations (ensures fresh client)This follows the PR-wide pattern and maintains the explicit seeding step on line 59.
.github/tests/orm/express/run.sh (1)
55-56: LGTM! Well-documented workflow addition.The changes properly:
- Update the comment to reflect the new generation step (good documentation practice)
- Add
npx prisma generatebefore migrations (correct workflow)This follows the consistent pattern across all test scripts in the PR.
.github/tests/orm/graphql/run.sh (2)
57-57: Good addition—ensures Prisma client is available.Explicitly generating the Prisma client after migrations is the correct approach and likely fixes client availability issues that were causing test failures.
58-58: Consider removing or replacingmigrate devfor this test environment.While
migrate dev --name initmatches the documented user workflow in the README, this test script's actual purpose is to validate the GraphQL API, not to test migration creation. Since no migration files exist in the project,migrate reset --forcealready initializes the database schema. Creating a migration file here is redundant for testing purposes.For a CI/test environment, consider using
migrate deployto apply existing migrations (once they exist), or removing this line entirely if migration testing is not required.
- Change URL pattern from prisma+postgres:// to postgres:// for @prisma/adapter-pg - Add npx prisma generate to starter and postgis-express tests
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.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/tests/orm/fastify-graphql/run.sh:
- Around line 56-59: The reset script currently seeds the DB twice because `npx
prisma migrate reset` no longer uses `--skip-seed` and you also call `npx prisma
db seed`; fix by choosing one approach: either add back `--skip-seed` to the
`migrate reset` invocation so only the explicit `npx prisma db seed` runs, or
remove the standalone `npx prisma db seed` line and let `migrate reset` perform
the seeding; update the script accordingly so the seed script runs exactly once.
In @.github/tests/orm/koa/run.sh:
- Around line 56-59: Remove the redundant explicit seeding command by deleting
the standalone "npx prisma db seed" invocation; the seed already runs as part of
"npx prisma migrate reset --force", so keep the migrate reset, generate, and
migrate dev steps and remove the separate "npx prisma db seed" line to avoid
duplicative seeding.
🧹 Nitpick comments (5)
.github/tests/orm/nest-graphql/run.sh (1)
56-58: Good addition ofprisma generatestep.Generating the Prisma Client before running migrations ensures the client is available and up-to-date. This aligns well with the PR's goal of fixing test reliability.
Optional: Add error handling for Prisma commands
Consider adding
set -eeffect or explicit error checks so the script fails fast if any Prisma command fails:# Run migrations and seed npx prisma generate +if [ $? -ne 0 ]; then + echo "❌ Prisma generate failed" + kill "$NODE_PID" || true + exit 1 +fi npx prisma migrate dev --name init npx prisma db seedNote:
set -eis already set on line 3, but some npm scripts may mask exit codes. Explicit checks can improve clarity..github/tests/orm/betterauth-astro/run.sh (1)
55-57: Consider removing the redundantnpm install.The addition of
npx prisma generateat line 56 is correct and necessary to generate the Prisma Client before running migrations.However, the
npm installat line 55 appears redundant since the same command already ran at line 18 in the same directory (betterauth-astro). Removing it would improve CI/CD performance without affecting functionality.♻️ Suggested refactor
-npm install npx prisma generate npx prisma migrate dev --name init --schema prisma/schema.prisma.github/tests/orm/clerk-astro/run.sh (1)
55-57: Good addition ofnpx prisma generatebefore migrations.Running
npx prisma generatebeforemigrate devis necessary to ensure the Prisma client is available. However, note thatnpm installis called twice in this script (lines 18 and 55), which may be redundant and slow down CI/CD pipelines.⚡ Consider removing the redundant npm install
If the dependencies haven't changed between line 18 and line 55, the second
npm installat line 55 may be unnecessary:popd > /dev/null -npm install npx prisma generate npx prisma migrate dev --name initHowever, keep it if there's a specific reason (e.g., package.json is modified by the Node script).
.github/tests/orm/astro/run.sh (1)
55-55: Consider removing the redundantnpm install.Line 18 already installs dependencies in the same directory (
$REPO_ROOT/orm/astro). The intervening lines (20-53) work in a different directory and popd returns here at line 53. Sincepackage.jsonhasn't changed, this secondnpm installis unnecessary.♻️ Proposed fix
-npm install npx prisma generate npx prisma migrate dev --name init --schema prisma/schema.prisma.github/tests/orm/grpc/run.sh (1)
56-58: The explicitnpx prisma generatecall is redundant.
prisma migrate devautomatically runs client generation by default, so the explicit generation step before it is unnecessary. While this redundancy is harmless and doesn't break anything, the scripts can be simplified by removing this line sincemigrate devhandles it.If the team intentionally added this as a safeguard, consider adding a comment explaining why, or remove it for cleaner scripts.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (38)
.github/tests/databases/prisma-postgres/run.sh.github/tests/orm/ai-sdk-nextjs/run.sh.github/tests/orm/astro/run.sh.github/tests/orm/authjs-nextjs/run.sh.github/tests/orm/betterauth-astro/run.sh.github/tests/orm/betterauth-nextjs/run.sh.github/tests/orm/clerk-astro/run.sh.github/tests/orm/clerk-nextjs/run.sh.github/tests/orm/cloudflare-workers/run.sh.github/tests/orm/express/run.sh.github/tests/orm/fastify-graphql-sdl-first/run.sh.github/tests/orm/fastify-graphql/run.sh.github/tests/orm/fastify/run.sh.github/tests/orm/graphql-auth/run.sh.github/tests/orm/graphql-nexus/run.sh.github/tests/orm/graphql-sdl-first/run.sh.github/tests/orm/graphql-subscriptions/run.sh.github/tests/orm/graphql/run.sh.github/tests/orm/grpc/run.sh.github/tests/orm/hapi-graphql-sdl-first/run.sh.github/tests/orm/hapi-graphql/run.sh.github/tests/orm/hapi/run.sh.github/tests/orm/hono/run.sh.github/tests/orm/koa/run.sh.github/tests/orm/nest-graphql-sdl-first/run.sh.github/tests/orm/nest-graphql/run.sh.github/tests/orm/nest/run.sh.github/tests/orm/nextjs-graphql/run.sh.github/tests/orm/nextjs-trpc/run.sh.github/tests/orm/nextjs/run.sh.github/tests/orm/nuxt/run.sh.github/tests/orm/postgis-express/run.sh.github/tests/orm/react-router-7/run.sh.github/tests/orm/script/run.sh.github/tests/orm/solid-start/run.sh.github/tests/orm/starter/run.sh.github/tests/orm/sveltekit/run.sh.github/tests/orm/testing-express/run.sh
🚧 Files skipped from review as they are similar to previous changes (17)
- .github/tests/orm/fastify-graphql-sdl-first/run.sh
- .github/tests/orm/hapi-graphql-sdl-first/run.sh
- .github/tests/orm/solid-start/run.sh
- .github/tests/orm/nest/run.sh
- .github/tests/orm/cloudflare-workers/run.sh
- .github/tests/orm/express/run.sh
- .github/tests/orm/react-router-7/run.sh
- .github/tests/orm/graphql-nexus/run.sh
- .github/tests/orm/graphql-sdl-first/run.sh
- .github/tests/orm/betterauth-nextjs/run.sh
- .github/tests/orm/graphql-subscriptions/run.sh
- .github/tests/orm/nuxt/run.sh
- .github/tests/orm/graphql/run.sh
- .github/tests/orm/hapi-graphql/run.sh
- .github/tests/orm/sveltekit/run.sh
- .github/tests/orm/graphql-auth/run.sh
- .github/tests/orm/nextjs/run.sh
🧰 Additional context used
🧬 Code graph analysis (9)
.github/tests/orm/hapi/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/testing-express/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/astro/run.sh (1)
orm/react-router-7/app/lib/prisma.ts (1)
prisma(11-11)
.github/tests/orm/grpc/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/koa/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/authjs-nextjs/run.sh (1)
orm/authjs-nextjs/lib/prisma.ts (1)
prisma(7-7)
.github/tests/orm/fastify-graphql/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
.github/tests/orm/clerk-nextjs/run.sh (1)
orm/react-router-7/app/lib/prisma.ts (1)
prisma(11-11)
.github/tests/orm/nextjs-graphql/run.sh (4)
orm/prisma-mocking-javascript/client.js (1)
prisma(5-5)orm/testing-express/src/app.ts (1)
prisma(7-7)orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/graphql/src/db.ts (1)
prisma(5-5)
⏰ 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). (36)
- GitHub Check: test (orm/astro)
- GitHub Check: test (orm/betterauth-nextjs)
- GitHub Check: test (orm/betterauth-astro)
- GitHub Check: test (orm/cloudflare-workers)
- GitHub Check: test (orm/fastify-graphql)
- GitHub Check: test (orm/clerk-nextjs)
- GitHub Check: test (orm/clerk-astro)
- GitHub Check: test (orm/graphql-subscriptions)
- GitHub Check: test (orm/ai-sdk-nextjs)
- GitHub Check: test (orm/fastify-graphql-sdl-first)
- GitHub Check: test (orm/graphql-nexus)
- GitHub Check: test (orm/authjs-nextjs)
- GitHub Check: test (orm/fastify)
- GitHub Check: test (orm/graphql-auth)
- GitHub Check: test (orm/express)
- GitHub Check: test (orm/graphql)
- GitHub Check: test (orm/graphql-sdl-first)
- GitHub Check: test (orm/nest-graphql-sdl-first)
- GitHub Check: test (orm/nest)
- GitHub Check: test (orm/nextjs)
- GitHub Check: test (orm/hapi-graphql-sdl-first)
- GitHub Check: test (orm/nextjs-graphql)
- GitHub Check: test (orm/grpc)
- GitHub Check: test (orm/nextjs-trpc)
- GitHub Check: test (orm/nest-graphql)
- GitHub Check: test (orm/koa)
- GitHub Check: test (orm/hapi-graphql)
- GitHub Check: test (orm/script)
- GitHub Check: test (orm/hapi)
- GitHub Check: test (orm/react-router-7)
- GitHub Check: test (orm/solid-start)
- GitHub Check: test (orm/testing-express)
- GitHub Check: test (orm/hono)
- GitHub Check: test (orm/nuxt)
- GitHub Check: test (orm/sveltekit)
- GitHub Check: test-prisma-postgres
🔇 Additional comments (47)
.github/tests/orm/nest-graphql/run.sh (2)
38-47: LGTM! Verify log file format.The updated pattern correctly waits for plain
postgres://URLs. The caret anchor ensures only lines starting with the URL are matched.However, if the log file contains multiple lines starting with
postgres://, the loop will exit on the first occurrence, while line 49 extracts the last one withtail -1. Ensure the Prisma Dev server emits exactly one URL line.
49-51: URL extraction updated correctly.The extraction pattern matches the updated wait condition and correctly uses
tail -1to handle potential multiple URL emissions..github/tests/orm/testing-express/run.sh (2)
56-56: LGTM! Good addition of Prisma Client generation.Adding
npx prisma generatebefore running migrations is a best practice. This ensures the Prisma Client is properly generated and available before the migration and seeding steps execute.
38-38: Pattern change is correct—the Prisma Dev server emits plainpostgres://URLs.The grep pattern change from
'^prisma+postgres://'to'^postgres://'reflects the updated Prisma Dev server API, which now emits the connection string directly viaserver.database.connectionString. This change is consistent across all test scripts in.github/tests/orm/and is safe in practice because the Prisma Dev server intentionally emits only the database URL, eliminating false-positive risk..github/tests/orm/betterauth-astro/run.sh (2)
38-47: LGTM! URL pattern updated correctly.The change from
^prisma+postgres://to^postgres://correctly implements the switch to plain PostgreSQL URLs. The timeout logic and error handling remain appropriate.
49-51: LGTM! DATABASE_URL extraction updated consistently.The pattern change is consistent with the wait loop above and correctly extracts the plain PostgreSQL URL.
.github/tests/orm/fastify-graphql/run.sh (1)
38-38: LGTM on URL pattern updates.The detection and extraction patterns are correctly updated to match the new
postgres://prefix, and they're consistent with each other.Also applies to: 49-49
.github/tests/orm/clerk-astro/run.sh (2)
49-51: LGTM!The DB_URL extraction is consistent with the updated wait condition on line 38, and using
tail -1is a good defensive practice in case multiple URLs appear in the log.
38-38: The URL pattern change is correct and intentional for Prisma v7 compatibility. The Prisma Dev server emitsserver.database.connectionString, which is a standard PostgreSQL connection string starting withpostgres://. The grep pattern^postgres://correctly captures this format in both the wait loop and the URL extraction. No action needed..github/tests/orm/starter/run.sh (1)
5-7: LGTM! Essential addition of Prisma Client generation.The explicit
npx prisma generatestep ensures the Prisma Client is available before the build phase, which is necessary when the application imports@prisma/client..github/tests/orm/postgis-express/run.sh (1)
5-7: LGTM! Improved test pipeline with explicit generation step.The refactoring from a single-line command to separate steps improves clarity and adds the necessary Prisma Client generation before tests execute.
.github/tests/orm/fastify/run.sh (2)
56-56: Essential Prisma Client generation added.The
npx prisma generatestep is correctly placed before migrations, ensuring the Prisma Client is available for subsequent migration and seed operations.
38-38: URL detection pattern updated correctly.The change from
prisma+postgres://to plainpostgres://is applied consistently in both the wait condition (line 38) and the URL extraction logic (line 49). The Prisma Dev server (.github/get-ppg-dev/index.js) outputsserver.database.connectionString, which produces a standard PostgreSQL URL in thepostgres://format. Thenpx prisma generatestep (line 56) is also correctly placed before migrations..github/tests/orm/ai-sdk-nextjs/run.sh (2)
38-38: URL detection pattern updated consistently.The grep patterns correctly changed from
prisma+postgres://to plainpostgres://in both the wait loop and extraction logic, maintaining consistency with the updated Prisma Dev server output format.Also applies to: 49-49
56-56: Prisma Client generation properly positioned.The generate step is correctly placed after the second
npm installand before migrations, ensuring the client is available for database operations..github/tests/orm/nest-graphql-sdl-first/run.sh (2)
38-38: URL detection pattern updated correctly.Both grep operations now use the plain
postgres://prefix, consistent with the updated Prisma Dev server output format and matching the pattern applied across all test scripts in this PR.Also applies to: 49-49
56-56: Prisma Client generation step added correctly.The
npx prisma generatecommand is properly sequenced before migrations and seeding, ensuring the Prisma Client artifacts exist for subsequent database operations..github/tests/orm/koa/run.sh (3)
38-38: LGTM: URL pattern updated to plain postgres://The change from
^prisma+postgres://to^postgres://correctly aligns with the Prisma Dev server now emitting plain PostgreSQL URLs instead of the prisma+ prefixed format.
49-49: LGTM: DB_URL extraction updated consistentlyThe grep pattern for extracting the DATABASE_URL is correctly updated to match lines starting with
postgres://.
57-57: LGTM: Prisma Client generation addedAdding
npx prisma generatebefore migrations ensures the Prisma Client is available. This is a good practice and aligns with the pattern across all test scripts in this PR..github/tests/orm/clerk-nextjs/run.sh (3)
38-38: LGTM: URL pattern updated to plain postgres://The wait condition correctly detects the new plain PostgreSQL URL format.
49-49: LGTM: DB_URL extraction updated consistentlyThe extraction pattern is correctly updated to match the new URL format.
56-56: LGTM: Prisma Client generation added at correct positionThe
npx prisma generatestep is properly placed afternpm installand beforenpx prisma migrate dev, ensuring the Prisma Client is generated before running migrations..github/tests/databases/prisma-postgres/run.sh (3)
29-29: LGTM: URL pattern updated to plain postgres://The wait condition correctly uses the new plain PostgreSQL URL format.
40-40: LGTM: DB_URL extraction updated consistentlyThe extraction correctly targets lines starting with
postgres://.
48-49: LGTM: Prisma Client generation added before migrationThe generate step is correctly positioned before the migrate command, ensuring the client is available.
.github/tests/orm/hono/run.sh (3)
38-38: LGTM: URL pattern updated to plain postgres://The wait condition is correctly updated to detect the new URL format.
49-49: LGTM: DB_URL extraction updated consistentlyThe extraction pattern correctly matches the new format.
56-58: LGTM: Clean migration flow with generate stepThe migration sequence is well-structured:
- Generate Prisma Client
- Run migrations
- Seed database
This ensures all necessary artifacts are in place before each subsequent step.
.github/tests/orm/hapi/run.sh (3)
38-38: LGTM: URL pattern updated to plain postgres://The wait condition correctly detects the new plain PostgreSQL URL format.
49-49: LGTM: DB_URL extraction updated consistentlyThe extraction pattern is correctly updated to match lines starting with
postgres://.
56-58: LGTM: Proper migration sequence establishedThe generate → migrate → seed flow is correctly implemented, ensuring Prisma Client is available before running migrations and seeding.
.github/tests/orm/astro/run.sh (3)
38-38: LGTM! Pattern updated correctly.The wait condition now detects
postgres://URLs instead ofprisma+postgres://, aligning with the updated Prisma Dev server API.
49-49: LGTM! Extraction pattern updated correctly.The DATABASE_URL extraction now matches the updated wait condition pattern.
56-56: LGTM! Generate step added correctly.Adding
npx prisma generatebefore migrations ensures the Prisma Client is generated, which is essential for the subsequent migration and application execution..github/tests/orm/authjs-nextjs/run.sh (3)
38-38: LGTM! Pattern updated correctly.The wait condition now detects
postgres://URLs instead ofprisma+postgres://, consistent with the Prisma Dev server API update.
49-49: LGTM! Extraction pattern updated correctly.The DATABASE_URL extraction now matches the updated wait condition pattern.
56-56: LGTM! Generate step added correctly.Adding
npx prisma generatebefore migrations ensures the Prisma Client is generated, which is essential for the subsequent migration, seeding, and application execution..github/tests/orm/nextjs-trpc/run.sh (2)
56-56: Good addition of Prisma Client generation.Adding
npx prisma generatebefore running migrations is a best practice that ensures the Prisma Client is properly generated before schema changes are applied. This aligns with the updated test flow pattern across the repository.
38-38: No issues found. The Node.js script at.github/get-ppg-dev/index.jscorrectly emitsserver.database.connectionStringviaconsole.log()without additional prefixes, and the connection string output starts withpostgres://. The regex patterns on lines 38 and 49 (^postgres://) correctly match this format. The change fromprisma+postgres://to^postgres://aligns with the PR's migration to plain postgres URLs. Additionally, addingnpx prisma generateon line 56 before migrations is a Prisma best practice..github/tests/orm/nextjs-graphql/run.sh (3)
49-51: LGTM!The URL extraction correctly uses the updated pattern and
tail -1to capture the last emitted connection string, which is the expected behavior.
56-58: Essential addition of Prisma Client generation step.Adding
npx prisma generatebefore migrations is the correct approach and ensures the Prisma Client is up-to-date before running database operations. The order (generate → migrate → seed) follows best practices.
38-47: URL pattern update is correct. The grep pattern change fromprisma+postgres://topostgres://aligns with the new Prisma Dev server output format, which now emits standard PostgreSQL connection strings viaserver.database.connectionString. The pattern is properly anchored and timeout logic is well-implemented..github/tests/orm/grpc/run.sh (2)
49-51: LGTM! Consistent pattern for URL extraction.The extraction logic correctly uses the same pattern as the wait loop and appropriately handles multiple matches by selecting the last one with
tail -1.
38-47: Pattern change is correct and properly implemented.The
^postgres://pattern correctly matches the connection strings emitted by the Prisma Dev server. The server'sindex.jsexplicitly outputsserver.database.connectionStringviaconsole.log(), which produces standard PostgreSQL URLs starting withpostgres://. The^anchor appropriately constrains matching to the line start, and usingtail -1safely handles any multiple matches. The grep logic and timeout handling are sound..github/tests/orm/script/run.sh (2)
56-56: Note:prisma migrate devtypically auto-generates the client.The explicit
npx prisma generatecommand is added before running migrations. Whileprisma migrate devusually generates the Prisma Client automatically, this pattern appears intentional across the PR's test script updates. The explicit generation step is harmless and may provide additional reliability in the test environment.
38-38: The grep pattern changes appear correct and have been applied consistently across the entire test suite. All 30+ test scripts in.github/tests/orm/use the identical pattern'^postgres://', which indicates this is an intentional and coordinated update to match the Prisma Dev server's output format. No references to the oldprisma+postgres://pattern remain in the codebase.
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @orm/typedsql/src/index.ts:
- Line 3: The import/class name was renamed to PrismaBetterSqlite3 but other
files still import/use the old PrismaBetterSQLite3; update all occurrences of
the old symbol PrismaBetterSQLite3 to the new PrismaBetterSqlite3 (both import
statements and any instantiation/usage) so the imported class name and
references match the updated export.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
generator-prisma-client/basic-typedsql/src/index.tsorm/typedsql/prisma/seed.tsorm/typedsql/src/index.ts
🧰 Additional context used
🧬 Code graph analysis (3)
orm/typedsql/prisma/seed.ts (1)
orm/prisma-mocking-javascript/client.js (1)
adapter(4-4)
orm/typedsql/src/index.ts (1)
orm/prisma-mocking-javascript/client.js (1)
adapter(4-4)
generator-prisma-client/basic-typedsql/src/index.ts (1)
orm/prisma-mocking-javascript/client.js (1)
adapter(4-4)
⏰ 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). (36)
- GitHub Check: test (orm/authjs-nextjs)
- GitHub Check: test (orm/astro)
- GitHub Check: test (orm/ai-sdk-nextjs)
- GitHub Check: test (orm/betterauth-astro)
- GitHub Check: test (orm/betterauth-nextjs)
- GitHub Check: test (orm/express)
- GitHub Check: test (orm/cloudflare-workers)
- GitHub Check: test (orm/graphql)
- GitHub Check: test (orm/fastify-graphql-sdl-first)
- GitHub Check: test (orm/graphql-nexus)
- GitHub Check: test (orm/nest-graphql)
- GitHub Check: test (orm/graphql-auth)
- GitHub Check: test (orm/clerk-astro)
- GitHub Check: test (orm/graphql-sdl-first)
- GitHub Check: test (orm/fastify-graphql)
- GitHub Check: test (orm/clerk-nextjs)
- GitHub Check: test (orm/fastify)
- GitHub Check: test (orm/hapi-graphql-sdl-first)
- GitHub Check: test (orm/hapi-graphql)
- GitHub Check: test (orm/graphql-subscriptions)
- GitHub Check: test (orm/script)
- GitHub Check: test (orm/nextjs)
- GitHub Check: test (orm/nextjs-graphql)
- GitHub Check: test (orm/nest-graphql-sdl-first)
- GitHub Check: test (orm/koa)
- GitHub Check: test (orm/grpc)
- GitHub Check: test (orm/nest)
- GitHub Check: test (orm/nuxt)
- GitHub Check: test (orm/nextjs-trpc)
- GitHub Check: test (orm/hono)
- GitHub Check: test (orm/hapi)
- GitHub Check: test (orm/sveltekit)
- GitHub Check: test (orm/testing-express)
- GitHub Check: test (orm/react-router-7)
- GitHub Check: test (orm/solid-start)
- GitHub Check: test-prisma-postgres
🔇 Additional comments (3)
orm/typedsql/prisma/seed.ts (1)
3-3: LGTM!The adapter class rename is consistently applied to both the import statement and instantiation, matching the changes in other files.
Also applies to: 21-21
orm/typedsql/src/index.ts (1)
3-3: LGTM!The adapter class rename is consistently applied to both the import statement and instantiation.
Also applies to: 9-9
generator-prisma-client/basic-typedsql/src/index.ts (1)
2-2: The adapter class namePrismaBetterSqlite3is correct for Prisma v7.0.0.The rename from
PrismaBetterSQLite3toPrismaBetterSqlite3is properly applied to both the import (line 2) and instantiation (line 6).
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.
Actionable comments posted: 6
🤖 Fix all issues with AI agents
In @orm/hapi-graphql/src/schema.js:
- Around line 256-274: The resolver for the 'author' field calls
context.prisma.post.findUnique and then returns post.author without checking for
null, which can throw if the post is not found; update the resolve function (the
'author' field resolver) to check if the result of
context.prisma.post.findUnique (post) is null/undefined before accessing
post.author and return null (or an appropriate fallback) when post is missing,
e.g., after awaiting context.prisma.post.findUnique({ where: { id: parent.id ||
undefined }, include: { author: true } }) verify post and then return
post.author only if post exists.
In @package.json:
- Line 17: Replace the non-deterministic dependency value for "@prisma/dev":
"latest" with a specific semantic version range (e.g., a caret or exact version
like "^X.Y.Z" or "X.Y.Z") to ensure reproducible builds; update the package.json
entry for "@prisma/dev" accordingly and run npm/yarn install (and update
package-lock.json/Yarn.lock) to commit the resolved, deterministic version.
In @tests/orm/ai-sdk-nextjs.test.ts:
- Around line 7-14: Test may leak a running Prisma server if startPrismaDev()
throws before db is assigned; wrap the test body in a try/finally or move setup
to beforeAll with error handling so db is always cleaned in afterAll.
Specifically, in the test 'prisma setup and build' ensure you assign db before
awaiting startPrismaDev() completes or use try { db = await startPrismaDev();
await runExample('orm/ai-sdk-nextjs', db.url); } finally { if (db) await
db.stop(); } (or perform startPrismaDev() in beforeAll with a safe fallback) so
the cleanup path always sees the db instance; reference startPrismaDev(), db,
runExample and afterAll for where to apply the change.
In @tests/orm/graphql-subscriptions.test.ts:
- Around line 7-14: The test can leak the Prisma server if startPrismaDev()
throws before assigning db; wrap the test body in a try/finally so db is stopped
even on failure (e.g., assign db = await startPrismaDev() inside the try and
call await db?.stop() in the finally), or move initialization into beforeAll
with equivalent error-safe cleanup in afterAll; update the test that calls
startPrismaDev(), runExample(), and relies on afterAll to ensure the server is
always stopped by referencing db in the finally block.
In @tests/orm/starter.test.ts:
- Around line 7-14: The test risk is that startPrismaDev() may throw before
assigning db so afterAll cannot stop the server; wrap the test body to ensure
cleanup by assigning a local variable or calling startPrismaDev inside a try
block and call await db?.stop() in a finally block, or move startPrismaDev into
beforeAll and ensure afterAll stops db even if beforeAll failed; update the test
named 'prisma setup and build' and the surrounding afterAll/test logic to
guarantee db (the variable tracked) is stopped on failure.
🧹 Nitpick comments (16)
tests/orm/nuxt-prisma-module.test.ts (1)
4-6: Track this disabled test as technical debt.The skipped test indicates missing functionality. Consider creating a GitHub issue to track the special setup requirements and enable this test in the future.
Do you want me to help draft an issue description that outlines the special setup requirements for this test?
.github/workflows/test.yaml (1)
47-47: Consider pinning a specific Node.js minor version.Using
'22'will always fetch the latest Node 22.x, which provides automatic updates but could introduce subtle inconsistencies between CI runs. For reproducible builds, you might consider pinning to a specific version (e.g.,'22.12.0').tests/utils/prisma-dev.ts (2)
96-98: URL hostname replacement could affect other parts of the URL.Using
String.replace('localhost', '127.0.0.1')could unintentionally modify the password or database name if they happen to contain "localhost". Consider using the URL object for a safer replacement:♻️ Safer hostname replacement
- // Replace localhost with 127.0.0.1 for consistency - const fixedUrl = url.replace('localhost', '127.0.0.1') - url = fixedUrl + // Replace localhost with 127.0.0.1 for consistency + if (urlObj.hostname === 'localhost') { + urlObj.hostname = '127.0.0.1' + } + url = urlObj.toString()
113-116: Potential resource leak in stop() timeout handling.The timeout on line 115 will fire even if the process exits cleanly, leaving a dangling timer. Consider clearing the timeout when the 'exit' event fires:
♻️ Clear timeout on exit
stop: async () => { console.log('Stopping Prisma Dev server...') childProcess.kill('SIGTERM') // Wait for process to exit await new Promise<void>((res) => { - childProcess.on('exit', () => res()) - setTimeout(res, 5000) // Timeout after 5s + const timeoutId = setTimeout(res, 5000) // Timeout after 5s + childProcess.on('exit', () => { + clearTimeout(timeoutId) + res() + }) })tests/orm/hapi-graphql.test.ts (1)
3-7: Consider tracking this skipped test with an issue.The test is skipped due to
prisma generatefailures. To ensure this doesn't get forgotten, consider either:
- Linking to a GitHub issue tracking the fix
- Adding a TODO comment with more context about the root cause
This helps prevent skipped tests from becoming permanent fixtures.
Would you like me to help draft an issue to track fixing this test?
tests/orm/hapi.test.ts (1)
1-15: Test structure is clean and functional.The test follows a consistent pattern with proper cleanup. The optional chaining in
afterAllappropriately handles cases wheredbmight be undefined.Consider using beforeAll for server initialization
Moving the server initialization to
beforeAllwould better align with conventional test structure patterns and make the setup/teardown lifecycle more explicit:describe('orm/hapi', () => { let db: PrismaDevServer + beforeAll(async () => { + db = await startPrismaDev() + }) + afterAll(async () => { await db?.stop() }) test('prisma setup and build', async () => { - db = await startPrismaDev() await runExample('orm/hapi', db.url) }) })This would also make it easier to add additional tests in the future without duplicating server initialization.
tests/orm/nextjs-trpc.test.ts (1)
1-15: Test structure follows the established pattern.The implementation is consistent with other ORM test files in this PR. The cleanup logic with optional chaining is appropriate.
Consider moving server initialization to
beforeAllto align with conventional test structure patterns (same suggestion as other ORM tests):describe('orm/nextjs-trpc', () => { let db: PrismaDevServer + beforeAll(async () => { + db = await startPrismaDev() + }) + afterAll(async () => { await db?.stop() }) test('prisma setup and build', async () => { - db = await startPrismaDev() await runExample('orm/nextjs-trpc', db.url) }) })tests/orm/solid-start.test.ts (1)
1-15: Test implementation follows the consistent pattern.The structure is clean with appropriate cleanup handling via optional chaining in the
afterAllhook.For consistency with test best practices, consider moving server initialization to
beforeAll:describe('orm/solid-start', () => { let db: PrismaDevServer + beforeAll(async () => { + db = await startPrismaDev() + }) + afterAll(async () => { await db?.stop() }) test('prisma setup and build', async () => { - db = await startPrismaDev() await runExample('orm/solid-start', db.url) }) })tests/orm/nextjs.test.ts (1)
1-15: Test follows the established pattern with proper cleanup.The implementation is consistent and functional, with appropriate use of optional chaining for safe cleanup.
Consider moving server initialization to
beforeAllfor better test structure:describe('orm/nextjs', () => { let db: PrismaDevServer + beforeAll(async () => { + db = await startPrismaDev() + }) + afterAll(async () => { await db?.stop() }) test('prisma setup and build', async () => { - db = await startPrismaDev() await runExample('orm/nextjs', db.url) }) })tests/orm/fastify.test.ts (1)
1-15: Test implementation is consistent and functional.The cleanup logic appropriately uses optional chaining, and the test structure follows the pattern established across all ORM integration tests in this PR.
For improved test structure, consider using
beforeAllfor server initialization:describe('orm/fastify', () => { let db: PrismaDevServer + beforeAll(async () => { + db = await startPrismaDev() + }) + afterAll(async () => { await db?.stop() }) test('prisma setup and build', async () => { - db = await startPrismaDev() await runExample('orm/fastify', db.url) }) })tests/orm/betterauth-astro.test.ts (1)
1-15: LGTM! Consider extracting common test pattern.The implementation is correct. Given the repeated pattern across multiple test files (clerk-astro, script, hapi-graphql-sdl-first, betterauth-astro, betterauth-nextjs, and likely others), consider creating a helper factory function to reduce duplication.
♻️ Optional refactor: shared test factory
Add a helper in
tests/utils/test-factory.ts:export function createOrmExampleTest( examplePath: string, options?: { skipSeed?: boolean; skipMigrate?: boolean } ) { return () => { let db: PrismaDevServer afterAll(async () => { await db?.stop() }) test('prisma setup and build', async () => { db = await startPrismaDev() await runExample(examplePath, db.url, options) }) } }Then simplify each test file:
import { describe } from 'vitest' import { createOrmExampleTest } from '../utils/test-factory.js' describe('orm/betterauth-astro', createOrmExampleTest('orm/betterauth-astro'))tests/orm/typedsql.test.ts (2)
12-14: Prefer async file operations.The synchronous
fs.existsSyncandfs.unlinkSyncblock the event loop. Consider using async alternatives.♻️ Suggested async refactor
+import { access, unlink } from 'node:fs/promises' + describe('orm/typedsql', () => { test('prisma setup and build', async () => { const cwd = path.join(process.cwd(), 'orm/typedsql') // Remove existing SQLite database to ensure clean state const dbPath = path.join(cwd, 'dev.db') - if (fs.existsSync(dbPath)) { - fs.unlinkSync(dbPath) - } + try { + await access(dbPath) + await unlink(dbPath) + } catch { + // File doesn't exist, which is fine + }
7-38: Consider cleanup after test completion.The test leaves
dev.dbbehind. Adding cleanup inafterAllor at test end would ensure a clean state for subsequent runs.♻️ Optional cleanup addition
describe('orm/typedsql', () => { + const dbPath = path.join(process.cwd(), 'orm/typedsql', 'dev.db') + + afterAll(async () => { + try { + await fs.promises.unlink(dbPath) + } catch { + // Ignore if file doesn't exist + } + }) + test('prisma setup and build', async () => { const cwd = path.join(process.cwd(), 'orm/typedsql') // Remove existing SQLite database to ensure clean state - const dbPath = path.join(cwd, 'dev.db') if (fs.existsSync(dbPath)) { fs.unlinkSync(dbPath) }tests/orm/fastify-graphql-sdl-first.test.ts (1)
1-15: LGTM! Consistent test implementation.This test follows the same reliable pattern as the other ORM integration tests, ensuring uniformity across the test suite.
Optional: Consider a test helper to reduce boilerplate.
All five test files follow an identical pattern. If this pattern continues to grow, consider extracting a helper function:
// tests/utils/orm-test-helper.ts export function createOrmTest(examplePath: string) { return () => { let db: PrismaDevServer afterAll(async () => { await db?.stop() }) test('prisma setup and build', async () => { db = await startPrismaDev() await runExample(examplePath, db.url) }) } } // Usage in test files: describe('orm/fastify-graphql-sdl-first', createOrmTest('orm/fastify-graphql-sdl-first'))However, given the simplicity of the current implementation, the explicit pattern may be more maintainable for now.
orm/hapi-graphql/src/context.js (1)
6-7: Consider adding validation forDATABASE_URL.If
DATABASE_URLis undefined, the adapter will receiveundefinedas the connection string, which may cause cryptic errors at runtime. For example code this is often acceptable, but a guard could improve developer experience.♻️ Optional validation
+if (!process.env.DATABASE_URL) { + throw new Error('DATABASE_URL environment variable is required'); +} var pool = new adapter_pg_1.PrismaPg({ connectionString: process.env.DATABASE_URL });tests/utils/example-runner.ts (1)
33-41: Seed detection may missprisma.config.jsfiles.The detection only checks for
prisma.config.ts, but Prisma v7+ also supportsprisma.config.js. Examples using JavaScript config files won't have seeding executed.♻️ Suggested improvement
// Check for seed configuration in prisma.config.ts (Prisma v7+) - const configPath = path.join(cwd, 'prisma.config.ts') let hasSeed = false - if (fs.existsSync(configPath)) { - const configContent = fs.readFileSync(configPath, 'utf-8') - // Check if seed is configured in migrations.seed - hasSeed = configContent.includes('seed:') || configContent.includes('seed :') + for (const configFile of ['prisma.config.ts', 'prisma.config.js']) { + const configPath = path.join(cwd, configFile) + if (fs.existsSync(configPath)) { + const configContent = fs.readFileSync(configPath, 'utf-8') + // Check if seed is configured in migrations.seed + hasSeed = configContent.includes('seed:') || configContent.includes('seed :') + break + } }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
orm/hapi-graphql/src/generated/nexus.tsis excluded by!**/generated/**
📒 Files selected for processing (116)
.github/get-ppg-dev/.gitignore.github/get-ppg-dev/index.js.github/get-ppg-dev/package.json.github/scripts/get-packages.js.github/scripts/package.json.github/scripts/test-all.sh.github/tests/README.md.github/tests/data-modeling/delegated-types/run.sh.github/tests/databases/postgresql-supabase/run.sh.github/tests/databases/prisma-postgres/run.sh.github/tests/databases/sql-server/run.sh.github/tests/orm/ai-sdk-nextjs/run.sh.github/tests/orm/astro/run.sh.github/tests/orm/authjs-nextjs/run.sh.github/tests/orm/betterauth-astro/run.sh.github/tests/orm/betterauth-nextjs/run.sh.github/tests/orm/clerk-astro/run.sh.github/tests/orm/clerk-nextjs/run.sh.github/tests/orm/cloudflare-workers/run.sh.github/tests/orm/express/run.sh.github/tests/orm/fastify-graphql-sdl-first/run.sh.github/tests/orm/fastify-graphql/run.sh.github/tests/orm/fastify/run.sh.github/tests/orm/graphql-auth/run.sh.github/tests/orm/graphql-nexus/run.sh.github/tests/orm/graphql-sdl-first/run.sh.github/tests/orm/graphql-subscriptions/run.sh.github/tests/orm/graphql/run.sh.github/tests/orm/grpc/run.sh.github/tests/orm/hapi-graphql-sdl-first/run.sh.github/tests/orm/hapi-graphql/run.sh.github/tests/orm/hapi/run.sh.github/tests/orm/hono/run.sh.github/tests/orm/koa/run.sh.github/tests/orm/nest-graphql-sdl-first/run.sh.github/tests/orm/nest-graphql/run.sh.github/tests/orm/nest/run.sh.github/tests/orm/nextjs-graphql/run.sh.github/tests/orm/nextjs-trpc/run.sh.github/tests/orm/nextjs/run.sh.github/tests/orm/nuxt-prisma-module/run.sh.github/tests/orm/nuxt/run.sh.github/tests/orm/postgis-express/run.sh.github/tests/orm/prisma-mocking-javascript/run.sh.github/tests/orm/react-router-7/run.sh.github/tests/orm/script/run.sh.github/tests/orm/solid-start/run.sh.github/tests/orm/starter/run.sh.github/tests/orm/sveltekit/run.sh.github/tests/orm/testing-express/run.sh.github/tests/orm/typedsql/run.sh.github/tests/postman_collections/graphql-hapi.json.github/tests/postman_collections/graphql-nestjs.json.github/tests/postman_collections/graphql-typegraphql.json.github/tests/postman_collections/graphql.json.github/tests/postman_collections/rest.json.github/workflows/test.yaml.gitignoreaccelerate/remix-starter/prisma.config.tsorm/graphql/lib/pothos-prisma-types.tsorm/hapi-graphql/prisma.config.jsorm/hapi-graphql/prisma/seed.jsorm/hapi-graphql/schema.graphqlorm/hapi-graphql/src/context.jsorm/hapi-graphql/src/schema.jsorm/hapi-graphql/src/server.jsorm/solid-start/prisma/seed.tspackage.jsontests/databases/postgresql-supabase.test.tstests/databases/prisma-postgres.test.tstests/databases/sql-server.test.tstests/orm/ai-sdk-nextjs.test.tstests/orm/astro.test.tstests/orm/authjs-nextjs.test.tstests/orm/betterauth-astro.test.tstests/orm/betterauth-nextjs.test.tstests/orm/clerk-astro.test.tstests/orm/clerk-nextjs.test.tstests/orm/cloudflare-workers.test.tstests/orm/express.test.tstests/orm/fastify-graphql-sdl-first.test.tstests/orm/fastify-graphql.test.tstests/orm/fastify.test.tstests/orm/graphql-auth.test.tstests/orm/graphql-nexus.test.tstests/orm/graphql-sdl-first.test.tstests/orm/graphql-subscriptions.test.tstests/orm/graphql.test.tstests/orm/grpc.test.tstests/orm/hapi-graphql-sdl-first.test.tstests/orm/hapi-graphql.test.tstests/orm/hapi.test.tstests/orm/hono.test.tstests/orm/koa.test.tstests/orm/nest-graphql-sdl-first.test.tstests/orm/nest-graphql.test.tstests/orm/nest.test.tstests/orm/nextjs-graphql.test.tstests/orm/nextjs-trpc.test.tstests/orm/nextjs.test.tstests/orm/nuxt-prisma-module.test.tstests/orm/nuxt.test.tstests/orm/postgis-express.test.tstests/orm/prisma-mocking-javascript.test.tstests/orm/react-router-7.test.tstests/orm/script.test.tstests/orm/solid-start.test.tstests/orm/starter.test.tstests/orm/sveltekit.test.tstests/orm/testing-express.test.tstests/orm/typedsql.test.tstests/utils/example-runner.tstests/utils/index.tstests/utils/prisma-dev.tstsconfig.jsonvitest.config.ts
💤 Files with no reviewable changes (55)
- .github/scripts/get-packages.js
- .github/tests/postman_collections/graphql-typegraphql.json
- .github/tests/orm/fastify-graphql-sdl-first/run.sh
- .github/tests/orm/betterauth-astro/run.sh
- .github/tests/orm/prisma-mocking-javascript/run.sh
- .github/tests/README.md
- .github/tests/orm/ai-sdk-nextjs/run.sh
- .github/tests/orm/astro/run.sh
- .github/tests/orm/graphql-sdl-first/run.sh
- .github/tests/orm/express/run.sh
- .github/tests/postman_collections/graphql-nestjs.json
- .github/tests/data-modeling/delegated-types/run.sh
- .github/scripts/test-all.sh
- .github/tests/databases/sql-server/run.sh
- .github/tests/orm/fastify/run.sh
- .github/get-ppg-dev/package.json
- .github/tests/postman_collections/graphql-hapi.json
- .github/tests/postman_collections/rest.json
- .github/tests/orm/nextjs-trpc/run.sh
- .github/tests/databases/prisma-postgres/run.sh
- .github/tests/orm/react-router-7/run.sh
- .github/tests/orm/cloudflare-workers/run.sh
- .github/tests/orm/script/run.sh
- .github/tests/orm/solid-start/run.sh
- .github/tests/orm/starter/run.sh
- .github/tests/orm/graphql/run.sh
- .github/tests/postman_collections/graphql.json
- .github/tests/databases/postgresql-supabase/run.sh
- .github/tests/orm/postgis-express/run.sh
- .github/tests/orm/nuxt-prisma-module/run.sh
- .github/tests/orm/nest/run.sh
- .github/tests/orm/hapi-graphql/run.sh
- .github/tests/orm/nextjs-graphql/run.sh
- .github/tests/orm/nuxt/run.sh
- .github/tests/orm/nest-graphql-sdl-first/run.sh
- .github/tests/orm/nest-graphql/run.sh
- .github/tests/orm/nextjs/run.sh
- .github/tests/orm/sveltekit/run.sh
- .github/tests/orm/betterauth-nextjs/run.sh
- .github/tests/orm/clerk-nextjs/run.sh
- .github/tests/orm/fastify-graphql/run.sh
- .github/tests/orm/graphql-auth/run.sh
- .github/tests/orm/testing-express/run.sh
- .github/tests/orm/hapi-graphql-sdl-first/run.sh
- .github/get-ppg-dev/index.js
- .github/tests/orm/graphql-subscriptions/run.sh
- .github/tests/orm/koa/run.sh
- .github/tests/orm/graphql-nexus/run.sh
- .github/tests/orm/hapi/run.sh
- .github/scripts/package.json
- .github/tests/orm/hono/run.sh
- .github/tests/orm/typedsql/run.sh
- .github/tests/orm/grpc/run.sh
- .github/tests/orm/authjs-nextjs/run.sh
- .github/tests/orm/clerk-astro/run.sh
✅ Files skipped from review due to trivial changes (9)
- .gitignore
- accelerate/remix-starter/prisma.config.ts
- tsconfig.json
- tests/databases/postgresql-supabase.test.ts
- tests/orm/grpc.test.ts
- tests/orm/hono.test.ts
- tests/databases/sql-server.test.ts
- orm/hapi-graphql/schema.graphql
- tests/orm/authjs-nextjs.test.ts
🧰 Additional context used
🧬 Code graph analysis (1)
orm/solid-start/prisma/seed.ts (2)
orm/nuxt/prisma/db.ts (1)
prisma(16-16)orm/react-router-7/app/lib/prisma.ts (1)
prisma(11-11)
🪛 Biome (2.1.2)
orm/hapi-graphql/prisma/seed.js
[error] 95-98: This case is falling through to the next case.
Add a break or return statement to the end of this case to prevent fallthrough.
(lint/suspicious/noFallthroughSwitchClause)
[error] 105-108: This case is falling through to the next case.
Add a break or return statement to the end of this case to prevent fallthrough.
(lint/suspicious/noFallthroughSwitchClause)
orm/hapi-graphql/src/schema.js
[error] 179-179: This array contains an empty slots..
The presences of empty slots may cause incorrect information and might be a typo.
Unsafe fix: Replace hole with undefined
(lint/suspicious/noSparseArray)
🔇 Additional comments (39)
tests/orm/postgis-express.test.ts (2)
1-2: LGTM!Standard vitest imports are correctly configured.
3-7: This test skip follows a standard repo pattern; suggestions require context.The permanently skipped test is consistent with 7 other test files in this repository that skip tests due to external dependencies (
sql-server,postgresql-supabase,nuxt,grpc,authjs-nextjs,nuxt-prisma-module,hapi-graphql). The skip message already documents the issue—no additional TODO is needed.More importantly, the
orm/postgis-expressexample includes real infrastructure to handle PostGIS:
test-environment.jsautomatically creates the extension viaCREATE EXTENSION IF NOT EXISTS postgisdocker-compose.ymlprovides a postgis-ready container- Complete documentation and working example code
The test skip appears justified for the
@prisma/devCI environment, but if PostGIS support is desired, investigate whytest-environment.jsdoesn't enable the test to run in CI rather than adding placeholder comments.orm/graphql/lib/pothos-prisma-types.ts (1)
2-2: Reconcile import paths for consistency with db.ts in the same directory.The import path change to
../prisma/generated/client/client.jscreates an inconsistency:db.tsin the same directory (orm/graphql/src/) imports from../prisma/generated/clientwithout the/client.jssuffix. Before merging, verify that:
- The Prisma-generated client structure actually exports from
prisma/generated/client/client.js(not justprisma/generated/client);- Both
db.tsandpothos-prisma-types.tsuse the same import path pattern for consistency.If the schema's
clientOutput = "../prisma/generated/client"generates a single entry point, both files should import from the same location.tests/orm/prisma-mocking-javascript.test.ts (2)
7-9: LGTM: Proper cleanup with defensive optional chaining.The
afterAllhook correctly uses optional chaining to handle cases where the Prisma Dev server may not have been initialized.
11-14: LGTM: Clean test structure follows established pattern.The test properly starts the Prisma Dev server and runs the example. This pattern aligns with other ORM tests in the codebase.
tests/orm/sveltekit.test.ts (1)
1-15: LGTM: Consistent test structure.The test follows the same pattern as other ORM tests in the PR, ensuring consistency across the test suite.
package.json (1)
13-22: LGTM: Well-structured devDependencies for test infrastructure.The dependencies appropriately support the new Vitest-based testing setup with TypeScript, OpenTelemetry tracing, and Prisma development tooling.
tests/databases/prisma-postgres.test.ts (1)
1-15: LGTM! Clean test structure with proper cleanup.The test suite follows a clear pattern: start a Prisma dev server, run the example, and ensure cleanup via
afterAll. The optional chaining in the cleanup hook safely handles cases where the test fails before server initialization.tests/orm/cloudflare-workers.test.ts (1)
1-15: LGTM! Consistent test pattern.The test structure matches the other test files in the suite, which promotes consistency and maintainability across the test infrastructure.
tests/orm/koa.test.ts (1)
1-15: LGTM! Follows established test pattern.Consistent with the other test files, maintaining a uniform testing approach across the suite.
vitest.config.ts (1)
1-17: LGTM! Configuration is appropriate for integration tests.The timeout values (5 minutes for tests, 2 minutes for hooks) are well-suited for integration tests that start Prisma dev servers and run complete examples. The fork pool with limited concurrency (4) ensures test isolation while preventing resource exhaustion.
orm/hapi-graphql/prisma/seed.js (1)
1-142: File does not exist in repository.The file
orm/hapi-graphql/prisma/seed.jsdoes not exist. The directory contains onlyseed.ts, which is clean TypeScript source code with the correct imports (./generated/client) that follow the standard pattern used across 40+ examples in this repository.Likely an incorrect or invalid review comment.
orm/hapi-graphql/prisma.config.js (1)
1-13: LGTM - Standard Prisma configuration.The configuration correctly sets up the schema path, migrations directory, and datasource URL using the
env()helper. This follows Prisma 7.x conventions.tests/orm/react-router-7.test.ts (1)
1-15: LGTM - Test follows established pattern.The test correctly initializes the Prisma Dev server and ensures cleanup in
afterAll. The optional chaining ondb?.stop()safely handles cases wherestartPrismaDevmight fail..github/workflows/test.yaml (1)
30-34: Matrix generation approach is reasonable.The shell pipeline correctly extracts test names from file paths. One edge case: if test files exist in nested directories (e.g.,
tests/orm/nested/example.test.ts), the matrix entry will include the subdirectory path, which appears to be the intended behavior based on how the test command reconstructs the path on line 53.tests/utils/prisma-dev.ts (1)
35-152: Overall implementation looks solid for test infrastructure.The utility correctly manages the Prisma Dev server lifecycle with proper cleanup in error paths. The OpenTelemetry bootstrapping in the spawned script and the port-wait mechanism are appropriate for ensuring the server is ready before tests run.
tests/orm/graphql-nexus.test.ts (1)
1-15: LGTM - Consistent with repository test patterns.The test correctly follows the established pattern of starting a Prisma Dev server, running the example, and cleaning up in
afterAll.tests/orm/nextjs-graphql.test.ts (1)
1-15: LGTM! Clean test structure.The test properly initializes the Prisma dev server, runs the Next.js GraphQL example, and ensures cleanup with optional chaining in
afterAll. The pattern is clear and handles edge cases correctly.tests/orm/nest.test.ts (1)
1-15: LGTM! Consistent test pattern.The test follows the same solid pattern as other ORM tests, properly managing Prisma dev server lifecycle and cleanup.
tests/orm/testing-express.test.ts (1)
1-15: LGTM!Test structure is consistent with the established pattern and properly handles server lifecycle management.
tests/orm/graphql.test.ts (1)
1-15: LGTM!The test implementation is clean and follows the consistent pattern established across all ORM tests.
tests/orm/clerk-nextjs.test.ts (1)
1-15: LGTM!Test implementation is consistent with the established pattern and correctly handles resource cleanup.
tests/orm/script.test.ts (1)
1-15: LGTM! Appropriate use of skipSeed option.The test correctly uses
skipSeed: truefor the script example, which is appropriate when the example doesn't require seeded data or handles seeding differently.tests/orm/hapi-graphql-sdl-first.test.ts (1)
1-15: LGTM!Test implementation is clean and follows the established pattern correctly.
tests/orm/betterauth-nextjs.test.ts (1)
1-15: LGTM!Clean implementation following the established pattern.
tests/orm/clerk-astro.test.ts (1)
1-15: Consistent test pattern looks good.The test structure follows a clean pattern with proper cleanup. The optional chaining in
afterAllsafely handles cases where the test fails before server initialization. Vitest is configured with a 5-minute test timeout and 2-minute hook timeout invitest.config.ts, which is appropriate for integration tests that start development servers and run builds.tests/utils/index.ts (1)
1-2: LGTM!Clean re-export pattern for test utilities.
tests/orm/nest-graphql.test.ts (1)
1-15: LGTM! Consistent with the test pattern.This test follows the same clean structure as the other ORM tests, ensuring consistency across the test suite.
tests/orm/graphql-sdl-first.test.ts (1)
1-15: LGTM! Follows the established test pattern.The implementation is clean and consistent with the other ORM integration tests.
tests/orm/nest-graphql-sdl-first.test.ts (1)
1-15: LGTM! Maintains test consistency.The test structure is clean and aligns with the established pattern for ORM integration tests.
tests/orm/astro.test.ts (1)
1-15: LGTM! Clean test structure with proper resource management.The test follows Vitest best practices with appropriate lifecycle management. The optional chaining in
afterAllsafely handles cases where the server isn't initialized. Test utilities and theorm/astroexample directory are properly configured and follow the established pattern used across the test suite.tests/orm/fastify-graphql.test.ts (1)
1-15: LGTM!The test follows a clean and consistent pattern. The optional chaining
db?.stop()inafterAllsafely handles cases wheredbwas never assigned.tests/orm/graphql-auth.test.ts (1)
1-15: LGTM!Consistent test structure matching the project pattern.
tests/orm/express.test.ts (1)
1-15: LGTM!Consistent test structure for the Express example.
orm/hapi-graphql/src/server.js (1)
45-85: LGTM!The server setup correctly orchestrates Apollo and Hapi startup in sequence. The async flow is properly handled with awaits for each initialization step.
tests/utils/example-runner.ts (1)
10-14: LGTM on the function signature and options interface.Clean interface design with sensible defaults for
skipSeedandskipMigrate.orm/hapi-graphql/src/schema.js (3)
179-179: Static analysis false positive - sparse array in compiler helper.The
[0, 2, , 3]pattern at this line is part of TypeScript's__generatorhelper for try-catch state tracking. This is expected compiler output, not a bug.
326-329: No issue: Context type export is correct.The
contextType.exportis correctly set to'Context', which references the exported interface incontext.ts. Nexus typegen expects the export name of a type/interface (not a runtime value), andcontext.tsproperly exports both theContextinterface and thecontextobject that implements it.Likely an incorrect or invalid review comment.
1-53: No action needed—TypeScript source is already committed correctly.The repository follows best practices: only
schema.ts(TypeScript source) is committed to git, and compiled output is generated in thedist/directory at build time via the build script (npm run build→tsc). There is noschema.jsin the source tree.
tests/orm/nuxt.test.ts
Outdated
| test.skip('disabled - Prisma Dev server has race condition issues', async () => { | ||
| // This test has intermittent failures with Prisma Dev server | ||
| }) |
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.
Track the Prisma Dev server race condition.
The skipped test indicates a known race condition causing intermittent failures. This should be tracked as a bug to ensure it's addressed.
Do you want me to help investigate the race condition or open an issue to track this problem? Understanding and fixing race conditions is critical for test reliability.
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
tests/fixtures.ts (2)
43-51: Seed detection via string matching is fragile.The
content.includes('seed:')check could match commented-out code or other occurrences. For this use case it's likely acceptable, but consider using a more robust check if false positives become an issue.♻️ Alternative using regex for slightly more precision
// Check for seed in prisma.config.ts (Prisma v7+) const configPath = path.join(cwd, 'prisma.config.ts') if (!options?.skipSeed && fs.existsSync(configPath)) { const content = fs.readFileSync(configPath, 'utf-8') - if (content.includes('seed:')) { + // Match seed: that's not in a comment + if (/^\s*seed\s*:/m.test(content)) { console.log(`\n[${examplePath}] Running prisma db seed...`) await execa('npx', ['prisma', 'db', 'seed'], { cwd, env, stdio: 'inherit' }) } }
59-68: Consider addingskipSeedoption for API consistency withtestExample.The
testSqliteExamplefunction lacks theskipSeedoption thattestExamplehas. If an example needs to skip seeding, this option would be useful.Also,
fs.unlinkSyncwill throw if the file is locked. Consider usingfs.rmSyncwith{ force: true }for robustness.♻️ Proposed improvements
-export function testSqliteExample(examplePath: string, options?: { generateSql?: boolean }) { +export function testSqliteExample(examplePath: string, options?: { generateSql?: boolean; skipSeed?: boolean }) { describe.concurrent(examplePath, () => { test('prisma setup', async () => { const cwd = path.join(process.cwd(), examplePath) // Remove existing SQLite database to ensure clean state const dbPath = path.join(cwd, 'dev.db') - if (fs.existsSync(dbPath)) { - fs.unlinkSync(dbPath) - } + fs.rmSync(dbPath, { force: true })And update the seed check around line 89:
// Check for seed in prisma.config.ts (Prisma v7+) const configPath = path.join(cwd, 'prisma.config.ts') - if (fs.existsSync(configPath)) { + if (!options?.skipSeed && fs.existsSync(configPath)) {
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tests/databases.test.tstests/fixtures.tstests/orm.test.ts
🧰 Additional context used
🧬 Code graph analysis (2)
tests/databases.test.ts (1)
tests/fixtures.ts (1)
testExample(14-56)
tests/orm.test.ts (1)
tests/fixtures.ts (2)
testExample(14-56)testSqliteExample(59-100)
⏰ 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). (1)
- GitHub Check: test (orm)
🔇 Additional comments (3)
tests/databases.test.ts (1)
1-14: LGTM!The test file correctly imports and uses the
testExamplehelper for the prisma-postgres example, and properly documents why other database examples are skipped. The structure is clean and follows the pattern established in the fixtures.tests/orm.test.ts (1)
1-63: LGTM!Comprehensive ORM test coverage with appropriate use of
testExampleandtestSqliteExamplehelpers. The skipped tests are properly documented with their reasons, making it clear what setup is required or what issues need resolution.tests/fixtures.ts (1)
1-12: LGTM!Clean imports with proper
node:prefix for built-in modules, and well-typed interface for test options.
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/test.yaml (2)
21-34: Consider adding validation for empty test matrix.The matrix generation logic is sound, but if no test files are found, GitHub Actions will silently skip the test job. Consider adding explicit validation to fail early if no tests exist.
🔍 Proposed enhancement with validation
- id: set-matrix run: | # Find all test files and create matrix JSON tests=$(find tests -name "*.test.ts" | sed 's|tests/||' | sed 's|\.test\.ts||' | jq -R -s -c 'split("\n") | map(select(length > 0))') + # Validate that tests were found + if [ "$(echo "$tests" | jq '. | length')" -eq 0 ]; then + echo "Error: No test files found in tests/ directory" + exit 1 + fi echo "matrix={\"test\":$tests}" >> $GITHUB_OUTPUT
46-52: Consider adding npm caching to improve workflow performance.The Node.js setup and test execution look good. However, adding npm caching would speed up subsequent workflow runs.
⚡ Proposed enhancement with npm caching
- uses: actions/setup-node@v4 with: node-version: '22' + cache: 'npm' - name: Install root dependencies run: npm install
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/test.yaml
⏰ 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). (1)
- GitHub Check: test (orm)
🔇 Additional comments (2)
.github/workflows/test.yaml (2)
6-9: LGTM! Path filtering aligns with the new test structure.The expanded path filtering appropriately triggers the workflow for test-related changes including the new Vitest configuration and test files.
36-41: LGTM! Job dependency and matrix usage are correct.The test job correctly depends on the test-matrix job and properly consumes the generated matrix.
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.