test(catalog/op_bridge): D-AR-6 end-to-end feature matrix regression#41
Conversation
|
Warning Review limit reached
More reviews will be available in 6 minutes and 30 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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 |
The 16 existing tests cover individual mapping primitives (`Kind::String → CatalogKind::String`, `Option<T> → Either(None, T)`, ASSERT lowering in isolation, etc.). What was missing: a single test that exercises every nexgen-rs-producer feature together through `bridge_schema`, which is the actual ingress point for downstream ingestors. Build one `ast::Schema` containing a `WorkPackage` table with all four kinds of fields the producer side now emits: - `subject` : `option<string>` + `ASSERT $value != NONE` (typed scalar with validates_presence — both Kind + assert flow through D-AR-6.2/6.3) - `position` : `option<int>` (typed scalar, no assert) - `project_id` : `option<record<Project>>` (belongs_to FK after the #33 direction-gating) - `assignable_id` : `option<any>` (polymorphic FK after the #30 fallback) - A companion `idx_WorkPackage_project_id` index - A table comment with AR-shape annotations Assertions probe the catalog SQL render (the internal field accessors are `pub(crate)`) and check each feature is preserved: typed kinds present, ASSERT clauses render for validated fields only, record-link semantics carry the target table, polymorphic fallback renders as `any`, index name preserved. This locks the bridge contract against drift as the producer side keeps evolving — a single broken arm in `From<ast::*>` would fail this test loudly. 17 tests pass.
50224c5 to
b10fab0
Compare
Summary
The 16 existing bridge tests cover individual mapping primitives (
Kind::String → CatalogKind::String,Option<T> → Either(None, T), ASSERT lowering in isolation, etc.). What was missing: a single test that exercises every nexgen-rs-producer feature together throughbridge_schema, which is the actual ingress point for downstream ingestors.What this PR adds
One
ast::Schemacontaining aWorkPackagetable with all four kinds of fields the producer side now emits:subjectoption<string>+ASSERT $value != NONEpositionoption<int>(no assert)project_idoption<record<Project>>assignable_idoption<any>Plus a companion
idx_WorkPackage_project_idand table comment with AR-shape annotations.Why SQL-based assertions
The catalog
FieldDefinitioninternals arepub(crate), so the bridge's catalog output is only observable viato_sql()rendering at the test scope. Assertions probe the rendered SurrealQL: typed kinds present, ASSERT clauses render for validated fields only (not for un-validated ones), record-link semantics carry the target table, polymorphic fallback renders asany, index name preserved.This locks the bridge contract against drift — a single broken arm in
From<ast::*>would fail this test loudly.Test plan
cargo test --features op-bridge -p surrealdb-core --lib op_bridge::tests::d_ar_6_end_to_endpasses