[WRONG BRANCH] fix(logs): preserve apiKeyId, admissionKind, and inboundProtocol when hydrating request logs - #197
Conversation
|
Warning Review limit reached
Next review available in: 26 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: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
Motivation
apiKeyId,admissionKind, andinboundProtocol, but hydrated/api/logsentries lost those fields after restart because the projector did not copy them back.usage.jsonlafter a process restart.Description
apiKeyId,admissionKind, andinboundProtocolfromPersistedUsageEntryinto theRequestLogEntryreturned byrequestLogEntryFromPersistedUsageusing the existing validation helpers. (src/server/request-log.ts)tests/request-log.test.tsto verify the three attribution fields survive the persisted-to-request-log projection. (tests/request-log.test.ts)isKnownAdmissionKindandisKnownInboundProtocolwhen restoring fields.Testing
node_modules/bun/bin/bun.exe test --isolate tests/request-log.test.ts) and the hydrated-log tests passed (45 tests in file all passed).bun run typecheckandbun run privacy:scan, both of which succeeded.bun run test) in this environment and observed the test suite execute with many passing tests; focused coverage for the changed code is green.bun test tests/request-log.test.ts(system Bun v1.2.14) raised anode:zlibexport error, but the repository-managed Bun invocation used for CI reproduced passing results; the failure is environmental and unrelated to the code change.Codex Task