-
-
Notifications
You must be signed in to change notification settings - Fork 278
refactor: clean up code structure and improve comments across files #2523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis PR is predominantly comment and logging refinements across the codebase. Notable functional modifications include: added validations and restructured batch helpers in Postgres data writer, enhanced logging paths, and introducing/clarifying an unsupported-default path in meter exporter factory. The rest are non-functional updates in tests, docs, telemetry logs, and minor import annotations. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Writer as PostgresDataWriter
participant DB as Postgres
participant Helpers as BatchHelpers
rect rgb(238, 245, 255)
note right of Writer: New/changed flow
Client->>Writer: Write/Delete/RunBundle(request)
Writer->>Writer: Validate sizes (tuples/attributes)
Writer->>DB: BEGIN (tx)
Writer->>DB: SELECT txid_current() // get transaction ID
alt Write flow
Writer->>Helpers: build batches (rels/attrs)
Helpers-->>Writer: batched ops
loop per batch
Writer->>DB: EXEC batch
DB-->>Writer: result or serialization error
opt on serialization error
Writer->>Writer: backoff wait and retry
end
end
else Delete flow
Writer->>Helpers: build delete clauses
Writer->>DB: EXEC deletes
end
Writer->>DB: COMMIT
Writer-->>Client: Encoded snapshot token
end
sequenceDiagram
autonumber
actor App
participant Factory as MeterExporterFactory
App->>Factory: ExporterFactory(kind, cfg)
alt Supported kind
Factory-->>App: exporter instance
else Unsupported kind
note right of Factory: Default case
Factory-->>App: error (unsupported exporter)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (46)
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 |
Summary by CodeRabbit
Bug Fixes
Documentation
Tests
Refactor/Style