fix(traces): separate entrypoints#4119
fix(traces): separate entrypoints#4119jog1t wants to merge 1 commit into02-05-refactor_rivetkit_migrate_granularly_to_zod_v4from
Conversation
|
🚅 Deployed to the rivet-pr-4119 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
More templates
@rivetkit/cloudflare-workers
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/traces
@rivetkit/workflow-engine
@rivetkit/virtual-websocket
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
Graphite Automations"Test" took an action on this PR • (02/04/26)1 assignee was added to this PR based on Kacper Wojciechowski's automation. |
PR Review: Refactor traces package entry pointsSummaryThis PR refactors the ✅ Positive Aspects
🔍 Issues & Concerns1. Missing Backward Compatibility (Breaking Change)The old Impact: Any code importing from Suggestion: Consider one of these approaches:
2. Inconsistent File Naming ConventionThe new entry point files have different naming patterns:
Suggestion: For consistency, either:
The current naming suggests 3. Potential Type Export IssuesIn export type { ReadRangeWire };However, this type is already exported from the main
Suggestion: Document the intended usage pattern - should users import types from the main entry point or from subpaths? 4. Missing DocumentationThe PR description mentions "I have made corresponding changes to the documentation" is checked, but:
5. Index.ts Still Exports OTLP TypesThe main Question: Is the intention to:
📋 Minor Issues
🧪 TestingPositive: The existing test suite should catch any breaking changes since it imports from Gap: No tests verify the new entry points work correctly. Consider adding: // Test that new entry points export expected functions
import { encodeReadRangeWire, decodeReadRangeWire } from '@rivetkit/traces/encoding';
import { readRangeWireToOtlp } from '@rivetkit/traces/otlp';🔒 SecurityNo security concerns identified. ⚡ PerformanceNo performance impact. The refactoring is purely organizational. 📝 RecommendationsMust Fix:
Should Fix: Nice to Have: VerdictThe refactoring direction is sound and improves code organization, but the breaking change needs proper handling and the naming inconsistency should be resolved before merging. |
828baf3 to
a316801
Compare
a316801 to
3d621b9
Compare
432fcd6 to
7bb6306
Compare
3d621b9 to
940cd33
Compare
940cd33 to
9c70402
Compare
| import type { | ||
| OtlpAnyValue, | ||
| OtlpExportTraceServiceRequestJson, | ||
| OtlpKeyValue, | ||
| OtlpSpan, | ||
| OtlpSpanEvent, | ||
| } from "@rivetkit/traces"; | ||
| import { readRangeWireToOtlp } from "@rivetkit/traces/otlp"; | ||
| import { useQuery } from "@tanstack/react-query"; | ||
| import { format } from "date-fns"; | ||
| import { | ||
| useMemo, | ||
| useState, | ||
| type ReactElement, | ||
| } from "react"; | ||
| import { type ReactElement, useMemo, useState } from "react"; |
There was a problem hiding this comment.
Import ordering violates Biome linter rules. Imports should be grouped and sorted alphabetically. Move the React imports to the top, followed by external libraries, then local imports.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
| const rangeStartMs = isLive | ||
| ? now - presetMs | ||
| : customRange?.from?.getTime() ?? now - presetMs; | ||
| : (customRange?.from?.getTime() ?? now - presetMs); |
There was a problem hiding this comment.
Unnecessary parentheses around the conditional expression. Remove the parentheses around 'customRange?.from?.getTime() ?? now - presetMs'.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
9c70402 to
0ad0c4d
Compare
0ad0c4d to
df3efc4
Compare
| enabled: | ||
| inspector.isInspectorAvailable && | ||
| inspector.features.traces.supported, |
There was a problem hiding this comment.
The 'enabled' property is formatted inconsistently with line breaks. Run 'biome format --write' to ensure consistent formatting.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
| import { type ReactElement, useMemo, useState } from "react"; | ||
| import type { DateRange } from "../datepicker"; | ||
| import { RangeDatePicker } from "../datepicker"; | ||
| import { cn } from "../lib/utils"; |
There was a problem hiding this comment.
The 'cn' import was moved from its original position. Move it back to where it was (after the UI component imports) to maintain the expected import ordering.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
Merge activity
|
# Description Refactored the traces package to improve module organization by: 1. Creating dedicated entry points for specific functionality: - Added `encoding.ts` for ReadRangeWire encoding/decoding functions - Added `otlp-entry.ts` for OTLP-related functionality 2. Updated imports across the codebase to use these new entry points: - Changed imports from `@rivetkit/traces/reader` to `@rivetkit/traces/encoding` - Added path mappings in tsconfig.json for the new entry points - Updated package.json exports to expose the new entry points 3. Updated the build script to include the new entry points in the build process ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ## How Has This Been Tested? Verified that all imports resolve correctly and the application builds successfully. ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes

Description
Refactored the traces package to improve module organization by:
Creating dedicated entry points for specific functionality:
encoding.tsfor ReadRangeWire encoding/decoding functionsotlp-entry.tsfor OTLP-related functionalityUpdated imports across the codebase to use these new entry points:
@rivetkit/traces/readerto@rivetkit/traces/encodingUpdated the build script to include the new entry points in the build process
Type of change
How Has This Been Tested?
Verified that all imports resolve correctly and the application builds successfully.
Checklist: