Skip to content

ref(tracing): Remove unused base64_stripped regex - #8148

Merged
sentrivana merged 1 commit into
masterfrom
ref/remove-unused-base64-stripped-regex
Oct 29, 2026
Merged

sentrivana merged 1 commit into
masterfrom
ref/remove-unused-base64-stripped-regex

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Description

Removes the module-level base64_stripped regex string from sentry_sdk/tracing_utils.py. Nothing has used it since 2023.

#1179 (Sep 2021) added it to validate the base64-encoded Sentry entry in the tracestate header. #1907 (Feb 2023, "Remove deprecated tracestate") deleted its only use, re.search("^{b64}$".format(b64=base64_stripped), sentry_value), but left the definition and its comment behind.

Evidence

Why it's safe

  • It's a plain string constant in an internal module. It's not re-exported from sentry_sdk and doesn't appear in docs/, CHANGELOG.md or MIGRATION_GUIDE.md.
  • It was never compiled or read at runtime, so behavior doesn't change.
  • re is still used by SENTRY_TRACE_REGEX and other code in the module.

Checks

  • uv run ruff check and ruff format --check on the file pass.
  • uv run --group typing mypy sentry_sdk passes with no issues.
  • TESTPATH=tests/tracing uv run tox -e py3.14-common: 426 passed.

Issues

None. Found by a dead-code sweep.

via automation sched_65eed06cc199036c2b13411096f412d4 · Run ID sched_65eed06cc199036c2b13411096f412d4:1793269189822.

--

View Junior Session [Sentry]

@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 29, 2026 10:25
@sentrivana
sentrivana enabled auto-merge (squash) October 29, 2026 10:26
@sentrivana
sentrivana merged commit 825ff97 into master Oct 29, 2026
170 checks passed
@sentrivana
sentrivana deleted the ref/remove-unused-base64-stripped-regex branch October 29, 2026 10:37
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 136856 passed | ⏭️ 7456 skipped | Total: 144312 | Pass Rate: 94.83% | Execution Time: 464m 37s

📊 Comparison with Base Branch

Metric Change
Total Tests —
Passed Tests —
Failed Tests —
Skipped Tests —

✨ Test counts unchanged from base.

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.32% (up 0.02 percentage points from base (876a82f) to head (5417911)).

Files with missing lines (1)
File Coverage % Lines
sentry_sdk/tracing_utils.py 93.29% ⚠️ 56 Missing and 45 partials
Coverage diff
@@            Coverage Diff             @@
##        master     #8148       +/-##
==========================================
+ Coverage    90.30%    90.32%    +0.02%
==========================================
  Files          203       203         —
  Tracked lines     26874     26873        -1
  Branches     10044     10044         —
==========================================
+ Hits         24268     24273        +5
+ Misses        2606      2600        -6
- Partials      1519      1520        +1

Generated by Coverage Action

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