Skip to content

feat: Expose StringOrRegex discriminator - #5543

Open
limbonaut wants to merge 2 commits into
getsentry:mainfrom
limbonaut:limbonaut/feat/string-or-regex-type
Open

feat: Expose StringOrRegex discriminator#5543
limbonaut wants to merge 2 commits into
getsentry:mainfrom
limbonaut:limbonaut/feat/string-or-regex-type

Conversation

@limbonaut

Copy link
Copy Markdown

Exposes whether a StringOrRegex contains a literal string or a regular expression through a new public discriminator. This allows SDK integrations to preserve trace propagation target semantics across interop boundaries without reflection or treating regex patterns as literal strings.

The Godot SDK reads these targets from the .NET SDK and passes them to its native layer. Without this discriminator, it cannot tell a plain string from a regex. Reflection is not an option because Godot supports AOT on iOS, while treating regex patterns as strings would be incorrect.

@limbonaut limbonaut changed the title [WIP] feat: Expose StringOrRegex discriminator feat: Expose StringOrRegex discriminator Sep 4, 2026
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Sep 4, 2026
@limbonaut

Copy link
Copy Markdown
Author

Can’t tag you for review, so I’ll just ping you, @jamescrosswell and @Flash0ver 🙂

@jamescrosswell jamescrosswell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @limbonaut - Generally OK with the change but I think we could simplify it. I don't think we need to add a new enum to do what you want.

Comment thread src/Sentry/StringOrRegex.cs Outdated
@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.70%. Comparing base (6c51ea5) to head (7d1ec8e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5543      +/-   ##
==========================================
- Coverage   74.72%   74.70%   -0.02%     
==========================================
  Files         515      515              
  Lines       18948    18949       +1     
  Branches     3696     3696              
==========================================
- Hits        14158    14156       -2     
- Misses       3906     3910       +4     
+ Partials      884      883       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell
jamescrosswell self-requested a review September 7, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants