Configure japicmp classpath to avoid false positives#7945
Merged
jack-berg merged 3 commits intoopen-telemetry:mainfrom Dec 31, 2025
Merged
Configure japicmp classpath to avoid false positives#7945jack-berg merged 3 commits intoopen-telemetry:mainfrom
jack-berg merged 3 commits intoopen-telemetry:mainfrom
Conversation
jack-berg
commented
Dec 31, 2025
jack-berg
commented
Dec 31, 2025
api/all/src/main/java/io/opentelemetry/api/trace/SpanParent.java
Outdated
Show resolved
Hide resolved
jack-berg
commented
Dec 31, 2025
opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/DelegatingSpanTest.java
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7945 +/- ##
============================================
+ Coverage 90.10% 90.14% +0.03%
- Complexity 7439 7467 +28
============================================
Files 834 834
Lines 22546 22586 +40
Branches 2236 2240 +4
============================================
+ Hits 20316 20360 +44
+ Misses 1531 1527 -4
Partials 699 699 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jkwatson
approved these changes
Dec 31, 2025
Contributor
jkwatson
left a comment
There was a problem hiding this comment.
Thanks! Don't forget to revert the things before merging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was working on potential changes to the API and got dragged down a rabbit hole when japicmp was inappropriately flagging a change as breaking binary compatibility. I.e. japicmp had a false positive.
In my case, I was toying with lifting a method from
Spanto a new superinterface. Japicmp flagged the method as deleted even tho it still exists on the new superinterface. After too many hours debugging and inspecting the japicmp source code, I figured out that its because we improperly configure japicmp. Japicmp has config properties that allow you to set the old and new archives to compare, and the old and new classpaths for those archives. We are:The second point causes japicmp to blow up when it tries to resolve superinterfaces / superclasses which come from different artifacts. For example,
Span extends ImplicitKeyedContext- japicmp is unable to resolveImplicitKeyedContextbecauseopentelemetry-contextis not on the classpath.My solution: for each artifact we're comparing, set the classpath to the set of all artifacts published by
opentelemetry-java. If the artifact isn't needed, it doesn't hurt for it to be present. This means we're still exposed to these types of false positives if published classes / interfaces which extended types from external projects (i.e. if we had something in theopentelemetry-exporter-zipkinthat extended something fromzipkin-sender-okhttp3), but this should be rare or non existent.I spent too much time on this for the impact, but I'm pretty sure I've come across these types of false positives in the past. At some point, you just have to bite the bullet and take the time to understand the tools you depend on.