Skip to content

ref(scope): Remove unused _ScopeManager - #8155

Merged
sentrivana merged 1 commit into
major/3.0from
ivana/remove-scope-manager
Oct 29, 2026
Merged

sentrivana merged 1 commit into
major/3.0from
ivana/remove-scope-manager

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Description

Removes the private _ScopeManager class from sentry_sdk/scope.py. Nothing on major/3.0 uses it anymore.

It was the context manager behind push_scope() and the Hub scope helpers. #6919 ("Drop hub related code in new major") and #6944 ("Remove push_scope, configure_scope in new major") removed those callers and their imports, but left the class behind.

Evidence

  • On major/3.0, git grep -w _ScopeManager matches only the class definition in sentry_sdk/ and tests/. The only other hits are historical CHANGELOG.md and MIGRATION_GUIDE.md entries from 2.0 about it moving out of sentry_sdk.hub.
  • No open PR touches it.

It's underscore-private and isn't exported, so this doesn't touch the public API.

Issues

n/a

via Ivana Kellyer.

--

View Junior Session [Sentry]

Co-Authored-By: Ivana Kellyer <ivana.kellyer@sentry.io>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 29, 2026 11:55
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 57523 passed | ⏭️ 2979 skipped | Total: 60502 | Pass Rate: 95.08% | Execution Time: 154m 51s

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.21% (down 0.12 percentage points from base (3668ba4) to head (dcf0445)).

Files with missing lines (1)
File Coverage % Lines
sentry_sdk/scope.py 94.23% ⚠️ 44 Missing and 33 partials
Coverage diff
@@            Coverage Diff             @@
##        master     #8155       +/-##
==========================================
- Coverage    90.33%    90.21%    -0.12%
==========================================
  Files          203       198        -5
  Tracked lines     26872     21289     -5583
  Branches     10044      7378     -2666
==========================================
- Hits         24272     19204     -5068
+ Misses        2600      2085      -515
+ Partials      1520      1238      -282

Generated by Coverage Action

@sentrivana
sentrivana merged commit f58c75b into major/3.0 Oct 29, 2026
153 checks passed
@sentrivana
sentrivana deleted the ivana/remove-scope-manager branch October 29, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant