Skip to content

Remove all Prisma Optimize examples#8514

Open
AmanVarshney01 wants to merge 6 commits intolatestfrom
remove-optimize-examples
Open

Remove all Prisma Optimize examples#8514
AmanVarshney01 wants to merge 6 commits intolatestfrom
remove-optimize-examples

Conversation

@AmanVarshney01
Copy link
Member

@AmanVarshney01 AmanVarshney01 commented Mar 25, 2026

Summary

  • Removes the entire optimize/ directory containing 6 example projects (starter, excessive-rows, full-table-scan, repeated-query, select-returning-all, unindexed-column)
  • Removes the Prisma Optimize section from the root README

Test plan

  • Verified no remaining references to @prisma/extension-optimize or PRISMA_OPTIMIZE in the repo
  • Confirm no CI/CD pipelines reference the removed examples

Summary by CodeRabbit

  • Chores
    • Removed the Prisma Optimize starter and multiple example/demo projects.
  • Documentation
    • Deleted all Optimize-related READMEs and setup guides.
  • Configuration
    • Removed example environment templates, ignore rules, TypeScript configs, and package manifests for the demos.
  • Tests
    • Updated test fixtures to allocate unique ports per run and adjusted test runner fork behavior.

Prisma Optimize is being discontinued. This removes the entire
optimize/ directory (6 example projects) and the corresponding
section from the root README.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Removed the entire Prisma Optimize section and all optimize example/demo projects (including the starter workspace), deleted associated configs/schemas/scripts/docs, and updated tests to allocate unique ports for Prisma dev server startup.

Changes

Cohort / File(s) Summary
Main documentation
README.md
Removed the "Prisma Optimize" section and its examples table referencing ./optimize.
Optimize example projects (all demos)
optimize/... (e.g. optimize/optimize-excessive-rows/..., optimize/optimize-full-table-scan/..., optimize/optimize-repeated-query/..., optimize/optimize-select-returning-all/..., optimize/optimize-unindexed-column/...)
Deleted example project directories: READMEs, .env.example, .gitignore, package.json, prisma.config.ts, prisma/schema.prisma, prisma/seed.ts, scripts (*.ts), tsconfig.json, and utils/*. Review removed Prisma schemas, seeds, and exported prisma clients.
Starter workspace (client & server)
optimize/starter/..., optimize/starter/packages/client/..., optimize/starter/packages/server/...
Removed starter workspace and packages: workspace package.json, client/server package manifests, source (React app, tRPC client/server), routers, Prisma schemas/seeds, build configs (Vite, Tailwind, PostCSS), tsconfigs, and exports. Check CI/workspace references.
Tests fixture
tests/fixtures.ts
Modified to allocate unique ports per prisma setup run via getUniquePorts() and pass port, databasePort, shadowDatabasePort into startPrismaDevServer; added logging of requested/returned ports.
Test runner config
vitest.config.ts
Changed poolOptions.forks.singleFork from false to true (fork pool behavior adjusted).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove all Prisma Optimize examples' clearly and concisely summarizes the main change: deletion of all Prisma Optimize-related example projects from the repository.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 25, 2026
The concurrent tests all called startPrismaDevServer() with the default
name "default" in stateless mode. On slow CI runners, multiple tests
would scan for servers simultaneously, find none, and all try to bind
the same port (51216), causing EADDRINUSE failures.

Passing a unique name per test lets the port allocator see other
servers and pick distinct ports.
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 25, 2026
The previous approach of using unique names didn't work because
stateless mode never writes server state to disk, so concurrent
tests still race on the same default port range.

Instead, assign each test its own set of 3 ports (server, database,
shadow database) from a counter starting at 52000. Since all tests
in a file share a single Node.js event loop, the synchronous counter
increment is atomic against concurrent async calls.
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 25, 2026
With singleFork: false, vitest distributes concurrent tests across
separate worker processes. Each worker re-imports the module, resetting
the port counter, so multiple workers race on the same ports.

Setting singleFork: true ensures all tests in a file share one process,
making the portOffset counter effective. Combined with explicit unique
ports per test (starting at 52000, 3 ports each), concurrent tests
never collide.
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 25, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 25, 2026
@prisma/dev internally allocates ports beyond the 3 user-configurable
ones (port, databasePort, shadowDatabasePort). When many PGLite
instances start concurrently, they race on these internal ports
(51216+), causing EADDRINUSE.

Run tests sequentially (maxConcurrency: 1, remove describe.concurrent)
to ensure only one @prisma/dev server runs at a time. This is slower
(~4min vs ~1min per test file) but eliminates the flaky port conflicts
that have been failing CI consistently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants