feat(querier): rfc 0025 green b — rendering distinguishes absent from empty - #381
Conversation
… empty LogBody gains an Absent variant (the enum is non_exhaustive, so additive); render_log_body short-circuits on BodyKind::Absent; the HTTP row DTO omits the body key entirely for absent rows (RFC 0025 §3.2) — never an empty string, which is a different legal record. Discharges RFC0025.3, with a server-side DTO test pinning the JSON omission in both directions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds an explicit ChangesAbsent-body rendering and DTO handling
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
This PR implements RFC 0025 green slice .3 in the read/query path by ensuring the system distinguishes an absent log body from an empty-string body, and reflects that distinction in both querier rendering and server JSON output.
Changes:
- Add
LogBody::Absentand makerender_log_bodyreturn it immediately forBodyKind::Absent. - Update the server’s HTTP row DTO to represent
bodyasOptionand omit the JSON key entirely when absent (skip_serializing_if). - Add coverage in both querier integration tests (full query path) and server unit tests (DTO JSON shape) to pin the absent-vs-empty behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/ourios-server/src/querier.rs | Makes body optional in the response DTO and omits it for absent-body rows; adds a unit test asserting the JSON key omission. |
| crates/ourios-querier/tests/rfc0025_rendering.rs | Implements RFC0025.3 integration test to ensure query results distinguish empty-string bodies from absent bodies end-to-end. |
| crates/ourios-querier/src/log_row.rs | Introduces LogBody::Absent and updates render_log_body to short-circuit for BodyKind::Absent. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@crates/ourios-querier/src/log_row.rs`:
- Around line 147-158: Add a co-located unit test in the log_row.rs test module
to cover the new BodyKind::Absent early return in render_log_body. Reuse the
existing record(body_kind: BodyKind) helper already present in this file’s
tests, construct a record with BodyKind::Absent and a registry, and assert that
render_log_body returns LogBody::Absent. Keep the test next to render_log_body
so the branch is directly covered here rather than only by rfc0025_rendering.rs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 13c8cb71-96c2-4a09-b0ea-3f2dc2ed30b1
📒 Files selected for processing (3)
crates/ourios-querier/src/log_row.rscrates/ourios-querier/tests/rfc0025_rendering.rscrates/ourios-server/src/querier.rs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Second RFC 0025 green slice, discharging RFC0025.3.
LogBody::Absentvariant (additive — the enum is#[non_exhaustive]);render_log_bodyshort-circuits onBodyKind::Absentbefore any template walk.bodybecomesOptionwithskip_serializing_if: an absent-body row's JSON omits the key entirely — never"", which is a different legal record (per the OTel data model, Body is optional; absence and empty-string are distinct states).LogRow::from_record.Verification: fmt clean, clippy clean (querier + server, RC checked), querier 21 suites / 160 tests, server 12 suites / 76 tests, all green.
Remaining for RFC 0025: slice c (sink quarantine + telemetry, .4/.5) — which closes #362.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
bodyfield when no body is present, instead of sending an empty value.Tests