Skip to content

Error-reference follow-ups: one code per condition, doc sync, legacy retirement - #238

Merged
wmadden-electric merged 4 commits into
mainfrom
claude/error-reference-follow-ups
Aug 26, 2026
Merged

Error-reference follow-ups: one code per condition, doc sync, legacy retirement#238
wmadden-electric merged 4 commits into
mainfrom
claude/error-reference-follow-ups

Conversation

@wmadden-electric

Copy link
Copy Markdown
Contributor

Follow-ups to #234, per the operator's brief.

One code for a missing project. SERVICE.PROJECT_NOT_FOUND and PROJECT.NOT_FOUND described the same user-facing condition; which one you got depended on the command you entered through. The service raise site now carries PROJECT.NOT_FOUND, keeping its own message and next actions (project show, project link), and the registry folds the services-API case into the PROJECT.NOT_FOUND entry. 125 codes now.

Style guide flag list synced. The "Shared global flags for the MVP" list still described the plan: --trace never shipped, and --format, --log-level, --confirm, and --config were missing. The list now mirrors SHARED_FLAG_PARAMETERS and names it as the source of truth.

Event-driven docs sync. prisma/web has listened for the error-reference-updated repository_dispatch since the sync workflow was added, but nothing ever sent it, so the hosted page lagged registry changes by up to a day. A push to main touching docs/reference/error-reference.md now sends the event. Needs the WEB_DISPATCH_TOKEN repo secret — a token allowed to send repository dispatches to prisma/web (fine-grained PAT on prisma/web with Contents read/write, or classic repo scope). Until it exists the job fails harmlessly and the daily cron still covers.

src/legacy/ retired. The last types named after the deleted command shell move to their users: CliRuntime/CommandContext to controllers/context.ts, CommandSuccess into controllers/app-env-file.ts; unused CliOutput deleted; legacyOperationContext renamed to operationContext.

Verified: pnpm check:error-reference (registry and source agree, 125 codes), pnpm typecheck, npx biome check . --error-on-warnings, pnpm --filter @prisma/cli test (960 passed, 1 skipped).

🤖 Generated with Claude Code

wmadden-electric and others added 4 commits August 26, 2026 09:17
SERVICE.PROJECT_NOT_FOUND and PROJECT.NOT_FOUND described the same user-facing condition, and which code you got depended on the command you entered through. The service raise site keeps its own message and next actions (project show, project link) but now carries the project group's code, and the registry folds the services-API case into the PROJECT.NOT_FOUND entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
The list still described the MVP plan: --trace never shipped, and --format, --log-level, --confirm, and --config were missing. The list now mirrors SHARED_FLAG_PARAMETERS in packages/cli-engine/src/execution/shared-flags.ts and names that as the source of truth.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
prisma/web's sync-error-reference-docs.yml has listened for this repository_dispatch since it was added, but nothing ever sent it, so the hosted page could lag a registry change by up to a day until the cron fired. A push to main touching docs/reference/error-reference.md now sends the event. Needs the WEB_DISPATCH_TOKEN secret: a token allowed to send repository dispatches to prisma/web.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
src/legacy/ held the last types named after the deleted command shell. CliRuntime and CommandContext move to controllers/context.ts, CommandSuccess moves into its only user, controllers/app-env-file.ts, and the unused CliOutput is gone. The legacyOperationContext adapter is now operationContext, and its test file follows the rename.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b92ad5dc-8f00-47be-a2c6-6fb92d3a6437

📥 Commits

Reviewing files that changed from the base of the PR and between 1dd27c6 and bfc129d.

📒 Files selected for processing (18)
  • .github/workflows/notify-error-reference-docs.yml
  • docs/product/cli-style-guide.md
  • docs/reference/error-reference.md
  • packages/cli/src/commands/project/context.ts
  • packages/cli/src/commands/project/delete.ts
  • packages/cli/src/commands/project/env-add.ts
  • packages/cli/src/commands/project/env-update.ts
  • packages/cli/src/commands/project/show.ts
  • packages/cli/src/commands/project/transfer.ts
  • packages/cli/src/commands/service/errors.ts
  • packages/cli/src/controllers/app-env-file.ts
  • packages/cli/src/controllers/app-env.ts
  • packages/cli/src/controllers/context.ts
  • packages/cli/src/controllers/project.ts
  • packages/cli/src/legacy/output.ts
  • packages/cli/tests/helpers.ts
  • packages/cli/tests/operation-context.test.ts
  • packages/cli/tests/service-list.test.ts
💤 Files with no reviewable changes (1)
  • packages/cli/src/legacy/output.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Summary by CodeRabbit

  • Documentation

    • Updated the CLI style guide with current shared flags, including formatting, configuration, confirmation, quiet mode, and log-level guidance.
    • Expanded PROJECT.NOT_FOUND documentation with recovery steps for inaccessible projects.
    • Removed the separate service-specific project-not-found error entry.
  • Bug Fixes

    • Standardized project lookup failures under the PROJECT.NOT_FOUND error code for consistent CLI and JSON output.
  • Chores

    • Added automated notifications when the error reference documentation changes.

Walkthrough

The PR migrates project commands from the legacy runtime context to the controller operation context. It moves the CommandSuccess interface into the environment-file controller and updates related imports and tests. Service project lookup failures now use PROJECT.NOT_FOUND, with updated reference documentation and tests. A workflow dispatches documentation updates to prisma/web. The CLI style guide now reflects engine-defined shared flags.

Merge Risk: ⚪ Minimal · up to bfc12

The PR updates error references, documentation, synchronization, and legacy naming without a remaining actionable merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 14 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the pull request’s main changes: error-code consolidation, documentation synchronization, and legacy code retirement.
Description check ✅ Passed The description directly explains all four changes, required workflow configuration, and reported verification results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 14 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/error-reference-follow-ups
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/error-reference-follow-ups

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@prisma/cli@238
npx https://pkg.pr.new/@prisma/cli-engine@238

commit: bfc129d

@wmadden-electric
wmadden-electric merged commit 137d35c into main Aug 26, 2026
15 checks passed
@wmadden-electric
wmadden-electric deleted the claude/error-reference-follow-ups branch August 26, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant