Repository navigation
chore(android): spell out that the binding drops every IScopes method - #6018
Conversation
The rule's comment and its [@deprecated] predicate suggested that only the deprecated IScopes methods were removed. api.xml writes a deprecated attribute on every method, so the predicate matched all 90, and the generated IScopes interface has no members. The SDK doesn't use them. Narrowing the rule to the 3 deprecated methods breaks the build. IScopes also references the profiling types removed further down, so the generator drops the whole interface, and with it IIntegration and every integration's register method, which SentrySdk uses. Binding IScopes properly would also need its ISentryClient member and 19 default-method overloads removed, for about 75 KB more binding DLL and no caller. So the path now selects every method, and the comment names the generator behavior. The transformed API and all generated sources are identical before and after. Refs #4671 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR risk: mediumFor commit Main concerns: public contract, reach. Rules that block low also fired:
This label is a hint for reviewers, not an approval. |
There was a problem hiding this comment.
Good to approve, with optional comments
This only changes a comment and a predicate. [@deprecated] already matches every IScopes method, because api.xml writes deprecated="not deprecated" on non-deprecated members (see the compareTo nodes earlier in this file). So the generated binding doesn't change, and the existing behaviour is now explicit.
- Optional:
src/Sentry.Bindings.Android/Transforms/Metadata.xml:110: the new comment gives BG8503 (unboundProfileChunk/ProfilingTraceData) as the only reason. A reader could take it to mean that removing just those methods is enough. Consider adding one line saying that a partial binding also needsbindClientand the default-method overloads removed (the sameglobal::issue as theISpan.startChildrule above). Also say that every method has@deprecated, so a[@deprecated]predicate can't narrow the removal. That stops someone from "fixing" it back to a narrower predicate.
This is an automated preliminary review.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6018 +/- ##
==========================================
+ Coverage 78.14% 78.15% +0.01%
==========================================
Files 537 537
Lines 20077 20077
Branches 4041 4041
==========================================
+ Hits 15689 15692 +3
+ Misses 3544 3542 -2
+ Partials 844 843 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The
IScopesrule inMetadata.xmlnow says what it does: it removes every method, not only the deprecated ones. The generated binding doesn't change. On both Android targets,api.xml.fixedand all generated sources are identical before and after.The rule came from #4671. Its comment and its
[@deprecated]predicate suggest it removes the 3 deprecated methods. Butapi.xmlwrites adeprecatedattribute on every method, as "deprecated" or "not deprecated", so the predicate matches all 90 and the boundIScopesinterface is empty. Nothing in the SDK uses its members.The obvious fix,
[@deprecated='deprecated'], breaks the build. Several remainingIScopesmethods use types the binding doesn't have:IScopeandScopeCallbackon main, andProfileChunk,ProfilingTraceDataandISentryClienteven after #6016. So the generator drops the whole interface, and with itIIntegrationand every integration'sregistermethod.SentrySdkthen fails to compile, because it registers integrations throughIIntegration.Binding
IScopesproperly, on top of #6016, would also needbindClient(ISentryClient)and 19 Java default methods removed. 18 of those are overloads that hit the same missingglobal::bug this file already works around forISpan.startChild. That leaves 65 bound methods for 75 to 78 KB more binding DLL, with no caller, so I left it out. Once #6016 lands,ScopesAdapterhas the scope getters anyway.#skip-changelog