Conversation
Add garth_version to every telemetry log entry so we can identify which version a user is running from logfire without asking them. Closes #205 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review WalkthroughAdds the package version to telemetry payloads by importing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #206 +/- ##
=======================================
Coverage 99.97% 99.97%
=======================================
Files 68 68
Lines 3543 3547 +4
=======================================
+ Hits 3542 3546 +4
Misses 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Users should see their session ID without configuring logging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/test_telemetry.py (1)
95-95: Strengthen version assertions to validate the exact source value.These assertions currently only check presence/truthiness. Assert equality to
garth.version.__version__so tests fail if the payload value drifts from the package version.Proposed test hardening
+from garth.version import __version__ @@ - assert "garth_version" in captured_data[0] + assert captured_data[0]["garth_version"] == __version__ @@ - assert data["garth_version"] + assert data["garth_version"] == __version__Also applies to: 185-185
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/test_telemetry.py` at line 95, The test currently only asserts presence of "garth_version" in captured_data[0]; change the assertion to compare the payload value to the package version by asserting captured_data[0]["garth_version"] == garth.version.__version__ (and likewise at the other occurrence around line 185), ensuring you import or reference garth.version.__version__ so the test fails if the telemetry value drifts from the actual package version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/test_telemetry.py`:
- Line 95: The test currently only asserts presence of "garth_version" in
captured_data[0]; change the assertion to compare the payload value to the
package version by asserting captured_data[0]["garth_version"] ==
garth.version.__version__ (and likewise at the other occurrence around line
185), ensuring you import or reference garth.version.__version__ so the test
fails if the telemetry value drifts from the actual package version.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4d3c6d12-9f7a-4f1f-b9e8-1a9ae22617b6
📒 Files selected for processing (3)
src/garth/telemetry.pysrc/garth/version.pytests/test_telemetry.py
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Improvements to make it easier to diagnose auth issues from logfire:
garth_versionto every telemetry span so we can tell which version a user is running without askingWould have helped with the 0.7.0 → 0.7.1
audiencebug — we could have immediately filtered logfire by version to see who was still on the broken release.Test plan
Closes #205
🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
New Features
Tests
Documentation