refactor(schema): defer builder validation to build - #443
Conversation
📝 WalkthroughWalkthroughThe schema builder APIs now use infallible ChangesBuilder and lowering refactor
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/schema/src/builder/entity.rs (1)
59-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression tests for deferred event validation.
Please cover duplicate event names being rejected by
build()and distinct events retaining declaration order. The shown test only exercises the empty-events case, leaving the primary behavior changed here unverified.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/schema/src/builder/entity.rs` around lines 59 - 72, Add regression tests for EntityBuilder::build covering duplicate event names returning the expected BuilderError and distinct events preserving their declaration order in the resulting Entity. Keep the existing empty-events test, and construct events through the same test helpers or public APIs already used in the entity builder tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/schema/src/builder/entity.rs`:
- Around line 59-72: Add regression tests for EntityBuilder::build covering
duplicate event names returning the expected BuilderError and distinct events
preserving their declaration order in the resulting Entity. Keep the existing
empty-events test, and construct events through the same test helpers or public
APIs already used in the entity builder tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: QUIET
Plan: Enterprise
Run ID: dcad4fd0-7890-4a88-bbfb-96b122a35bd3
📒 Files selected for processing (1)
crates/schema/src/builder/entity.rs
|
/merge |
Description
Now that a signficant portion of the YAML path has been trodden, clean some collateral slop up and solve #401 as well.
Migrates schema, FSM, and resource builders to infallible
with_*setters. Builders preserve declaration order and validate duplicate or empty names during the falliblebuild()step.Updates YAML lowering, code generation, and workspace callers. Removes obsolete fallible setters and unused builder APIs.
Related Issues
Closes #401.
Written by Codex.