Skip to content

Removed @Nullable annotation to maintain binary compatibility with 1.49.0 for Kotlin users #7359

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

Closed

Conversation

bidetofevil
Copy link

This reverts PR #7271, thereby addressing #7358, which broke binary compatibility in for Kotlin users in release 1.50.0

Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.84%. Comparing base (cc7d085) to head (8a7fa09).
Report is 49 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7359      +/-   ##
============================================
- Coverage     89.87%   89.84%   -0.03%     
+ Complexity     6899     6897       -2     
============================================
  Files           786      786              
  Lines         20793    20793              
  Branches       2026     2026              
============================================
- Hits          18687    18682       -5     
- Misses         1465     1468       +3     
- Partials        641      643       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@@ -110,7 +110,7 @@ public void end(long timestamp, TimeUnit unit) {
}

@Override
public io.opentelemetry.api.trace.Span setAttribute(String key, @Nullable String value) {
public io.opentelemetry.api.trace.Span setAttribute(String key, @Nonnull String value) {
Copy link
Author

Choose a reason for hiding this comment

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

I restored this despite it being inconsistent with the API, but I didn't want to make any additional changes on a PR that is essentially a revert.

@bidetofevil bidetofevil changed the title Revert "Clarify that AttributesBuilder.put allows nulls (#7271)" Removed @Nullable annotation to maintain binary compatibility with 1.49.0 for Kotlin users May 21, 2025
@bidetofevil bidetofevil marked this pull request as ready for review May 21, 2025 19:39
@bidetofevil bidetofevil requested a review from a team as a code owner May 21, 2025 19:39
Copy link
Contributor

@jkwatson jkwatson left a comment

Choose a reason for hiding this comment

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

Thanks! We should release a patch to fix this.

@bidetofevil
Copy link
Author

Let me know when y'all plan to merge this

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

I don't think we should merge this.

Reasoning:

  • This doesn't affect users, only implementations of the API.
  • At the otel project level, we're actually not under any obligation to ensure API implementations are not broken across releases. If we were, then interfaces would be unable to be evolved with additional methods in languages that don't have features like java's interface default implementations. In java, we do provide default implementations of interfaces as a convenience, but there's an argument that we're doing a disservice by obscuring / hiding API additions from implementations who would otherwise receive compilation errors upon upgrading.
  • This change of an argument from non-null to null is an edge which seems specific to kotlin implementations of the API, and my read of VERSIONING.md is that we don't make any guarantees about this type of thing. I don't think we're obligated to patch this. I'm more open to amending the VERSIONING.md, but also am not in favor of that.
  • Overall, I like that attribute values are now @Nullable and think it meaningfully improves the API ergonomics. That harm caused by this introduction seems small and localized to kotlin implementations of the API, of which there may just be one in existence. From my perspective, the benefit exceeds the harm by quite a large margin.

@jack-berg
Copy link
Member

Closing since I haven't heard any strong strong push back against my comment

@jack-berg jack-berg closed this Jun 20, 2025
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.

5 participants