Clarify project workspace mismatch in CLI resolver#67
Conversation
|
Warning Review limit reached
More reviews will be available in 52 minutes and 2 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7a944ca to
a4d3e39
Compare
Overview
This improves the CLI project-resolution failure mode when a local
.prisma/local.jsonpin belongs to a different workspace than the current auth session. It also makesproject listexpose project IDs in human output so users can match errors and recovery commands to listed projects.Changes
LOCAL_PROJECT_WORKSPACE_MISMATCHto the project error contract and emits it beforelistProjects()when the local pin workspace differs from the active workspace.--projectandPRISMA_PROJECT_IDprecedence so those overrides still bypass the local pin.project listhuman output to rendernameandidcolumns while keeping the JSON shape unchanged.branchescolumn is deferred until/v1/projectscan return branch counts in the same response, avoiding per-project branch-list calls.Why
The previous
LOCAL_STATE_STALE/not-found style failure hid the real problem: the checkout was linked to one workspace while the CLI session was scoped to another. This keeps the fix local and cheap by using only the existing local pin and auth workspace state, with no extra project-list network hop on the mismatch path.Validation
pnpm --filter @prisma/cli exec vitest run tests/project.test.ts tests/project-resolution.test.tspnpm --filter @prisma/cli exec vitest run tests/app-controller.test.tspnpm --filter @prisma/cli test