Call every presentation, with no defensive calls left - #197
Call every presentation, with no defensive calls left#197wmadden-electric wants to merge 1 commit into
Conversation
…s left `Presentations` requires all four fields, so materializePresentation had no business calling two of them with `?.()`. Those existed to tolerate @prisma/orm-toolchain built against engine 0.0.9, where three of the four were optional — a consumer working around a producer it shares an owner with. The producer was fixed instead (prisma/prisma#30004) and this repo now pins 8.0.0-rc.2, which declares all four. Verified by removing the calls and running tests/orm-mount.test.ts against the pinned package: five pass, including the human-mode case, which is the one the shim was protecting. A command that omits a presentation now fails loudly rather than silently publishing an empty surface. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
Warning Review limit reached
Next review available in: 54 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
commit: |
return { human: presentations.human(ui), - stdout: presentations.stdout?.() ?? [], + stdout: presentations.stdout(), json: undefined, - next: presentations.next?.() ?? [], + next: presentations.next(), };These should never have been there
Presentationsrequires all four fields — that was the whole of #171. Nothing reachesmaterializePresentationthat did not satisfy the type, so calling two of them defensively contradicted the type one line away.They existed for a specific and temporary reason:
@prisma/orm-toolchainwas compiled against engine0.0.9, where three of the four were optional, and its shipped commands took that up —migration listdeclaredhumanandjsonand neither of the others, so a strict call made it exit 2.That was a consumer working around a producer it shares an owner with, which is the wrong direction. The producer was fixed instead — prisma/prisma#30004 declared the missing presentations across 21 files — and this repo now pins
8.0.0-rc.2, which carries that.Verified by removing them and running the thing that would break
tests/orm-mount.test.tsrunsmigration listthrough the assembled command tree in both formats. Five tests pass with the calls made unconditionally, including the human-mode case — which is precisely the one thestdoutshim was protecting, and precisely the case I got wrong earlier by checking only json mode.Also clean:
lint,typecheck,build, 62 CLI and 35 engine test files.What this restores
A command that omits a presentation now fails loudly instead of silently publishing an empty surface on that channel. That is the point of requiring all four, and the shims quietly gave it back for two of them.
deferred.md's ORM entry records the presentations half as resolved. Theorm initconfig mismatch in the same entry is untouched and still live —prisma orm initstill scaffolds a project the binary cannot read.