You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: replace removed sentry push_scope with new_scope - #1857
sentry-sdk 3.0 removed push_scope, which sentry_log_retry in config/celery_app.py uses. This replaces it with new_scope, which exists in both 2.x and 3.x. The lock pins 2.x today, so this only matters on upgrade.
Documentation
None.
Safety Assurance
Safety story
A one-line replacement; the tags and extra stay limited to the retry message.
Automated test coverage
No existing test calls sentry_log_retry. The handler was run against sentry-sdk 2.77.0 and 3.0.1.
QA Plan
Not needed.
Deployment
No configuration or manual steps are required.
This PR can be deployed: any required configuration, commands, or other manual steps required before this PR can be deployed are done.
Labels & Review
The set of people pinged as reviewers is appropriate for the level of risk of the change
No actionable comments were generated in the recent review.
Walkthrough
The Celery retry signal handler now uses sentry_sdk.new_scope() to create a Sentry scope. Its tagging, extra data, and warning-message behavior remain unchanged.
Changes: Retry logging
Layer / File(s)
Summary
Create a Sentry scope config/celery_app.py
sentry_log_retry uses sentry_sdk.new_scope() instead of sentry_sdk.push_scope().
The retry logging handler now uses a Sentry API that exists in both 2.x and 3.x, so a future SDK upgrade will not break it. Tags, extra data, and the warning message are unchanged, and no production impact is expected.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title states the main change: the removed Sentry push_scope call is replaced with new_scope. The raw summary confirms the single-line change in config/celery_app.py matches this. The title is spec…
Description check
The description explains the reason for the change (sentry-sdk 3.0 removed push_scope, new_scope exists in 2.x and 3.x), the scope of the change in sentry_log_retry, the tested SDK versions, and the l…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title states the main change: the removed Sentry push_scope call is replaced with new_scope. The raw summary confirms the single-line change in config/celery_app.py matches this. The title is specific and accurate.
Full details: Description check
Explanation
The description explains the reason for the change (sentry-sdk 3.0 removed push_scope, new_scope exists in 2.x and 3.x), the scope of the change in sentry_log_retry, the tested SDK versions, and the lack of user-facing impact. It is related to the changeset.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between 6c86417 and 2c7e44d.
Files selected for processing: 1
config/celery_app.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Product Description
None. No user-facing change.
Technical Summary
sentry-sdk 3.0 removed
push_scope, whichsentry_log_retryinconfig/celery_app.pyuses. This replaces it withnew_scope, which exists in both 2.x and 3.x. The lock pins 2.x today, so this only matters on upgrade.Documentation
None.
Safety Assurance
Safety story
A one-line replacement; the tags and extra stay limited to the retry message.
Automated test coverage
No existing test calls
sentry_log_retry. The handler was run against sentry-sdk 2.77.0 and 3.0.1.QA Plan
Not needed.
Deployment
No configuration or manual steps are required.
Labels & Review