fix: Fix --pre test by stopping using the deprecated sentry_sdk method #1304
fix: Fix --pre test by stopping using the deprecated sentry_sdk method #1304
--pre test by stopping using the deprecated sentry_sdk method #1304Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR updates the Sentry test to stop using the deprecated capture_event method and adjusts the assertion logic to work with enveloped data, while also enhancing the GitHub Actions prerelease workflow with environment variables for improved test output formatting. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughAdded CI environment defaults to a GitHub Actions workflow; refactored Sentry scope usage to call Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as Application
participant Sdk as sentry_sdk
participant Scope as Current Scope
participant Transport as Transport
participant Test as Test
App->>Sdk: exception occurs / capture
Sdk->>Scope: get_current_scope()
Scope-->>Scope: set_user({...})
Sdk->>Transport: capture_envelope(envelope)
Transport-->>Test: deliver envelope
Test->>Test: assert envelope.items[0].payload.json contains frames
Test->>Test: mark done = True
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
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.
Hey there - I've reviewed your changes - here's some feedback:
- The new test uses a manual done flag to verify capture_envelope was called; consider using pytest’s mock or monkeypatch call_count assertions for a cleaner invocation check.
- check_event only inspects envelope.items[0]; to make the test more robust, filter envelope.items by their payload type so it doesn’t break if Sentry’s item ordering changes.
- Review whether forcing color output (FORCE_COLOR) in the CI workflow is necessary—ANSI codes in logs can cause readability issues on some systems.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new test uses a manual done flag to verify capture_envelope was called; consider using pytest’s mock or monkeypatch call_count assertions for a cleaner invocation check.
- check_event only inspects envelope.items[0]; to make the test more robust, filter envelope.items by their payload type so it doesn’t break if Sentry’s item ordering changes.
- Review whether forcing color output (FORCE_COLOR) in the CI workflow is necessary—ANSI codes in logs can cause readability issues on some systems.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
--pre test by stop using deprecated sentry_sdk method --pre test by stopping using the deprecated sentry_sdk method
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1304 +/- ##
===========================================
+ Coverage 93.14% 93.16% +0.01%
===========================================
Files 210 210
Lines 33270 33270
===========================================
+ Hits 30991 30996 +5
+ Misses 2279 2274 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



Summary by Sourcery
Migrate the Sentry integration test to the new capture_envelope API and update the GitHub Actions prerelease workflow for better output formatting
Enhancements:
CI:
Summary by CodeRabbit