Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ITransaction and ISpan null-safety compatibility #1161

Merged
merged 4 commits into from
Jan 13, 2021
Merged

Conversation

maciejwalkowiak
Copy link
Contributor

📜 Description

Improve ITransaction and ISpan null-safety compatibility. Also makes contexts on SentryBaseEvent immutable which prevents cases when someone would set context to null on transactions.

💡 Motivation and Context

Fixes #1159

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing
  • No breaking changes

🔮 Next steps

Since in case of SentryEvents trace can be null, where for SentryTransactions trace cannot be null, I am considering refactoring Contexts class and create separate class for TransactionContext. The drawback would be the code duplication.

@codecov-io
Copy link

Codecov Report

Merging #1161 (9dd38ad) into main (8159439) will increase coverage by 0.03%.
The diff coverage is 50.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1161      +/-   ##
============================================
+ Coverage     75.25%   75.29%   +0.03%     
+ Complexity     1661     1660       -1     
============================================
  Files           173      173              
  Lines          5808     5800       -8     
  Branches        568      567       -1     
============================================
- Hits           4371     4367       -4     
+ Misses         1173     1170       -3     
+ Partials        264      263       -1     
Impacted Files Coverage Δ Complexity Δ
...entry/src/main/java/io/sentry/NoOpTransaction.java 29.16% <0.00%> (+1.16%) 7.00 <0.00> (ø)
sentry/src/main/java/io/sentry/SentryEvent.java 68.75% <ø> (-0.33%) 43.00 <0.00> (ø)
sentry/src/main/java/io/sentry/Span.java 89.47% <ø> (ø) 11.00 <0.00> (ø)
sentry/src/main/java/io/sentry/SpanContext.java 94.11% <ø> (ø) 15.00 <0.00> (ø)
sentry/src/main/java/io/sentry/Hub.java 75.52% <100.00%> (+0.67%) 74.00 <0.00> (ø)
...entry/src/main/java/io/sentry/SentryBaseEvent.java 92.10% <100.00%> (-0.21%) 21.00 <1.00> (-1.00)
...try/src/main/java/io/sentry/SentryTransaction.java 98.21% <100.00%> (-0.07%) 26.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8159439...9dd38ad. Read the comment docs.

@bruno-garcia bruno-garcia changed the title Enhancement: Improve ITransaction and ISpan null-safety compatibility Improve ITransaction and ISpan null-safety compatibility Jan 13, 2021
@bruno-garcia bruno-garcia merged commit ac92322 into main Jan 13, 2021
@bruno-garcia bruno-garcia deleted the gh-1159 branch January 13, 2021 18: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.

Annotate ITransaction and ISpan for better null-safety compatibility.
3 participants