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

Re-enable animalsniffer, fixing violations #11762

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

ejona86
Copy link
Member

@ejona86 ejona86 commented Dec 18, 2024

In 61f19d7 I swapped the signatures to use the version catalog. But I failed to preserve the @signature extension and it all seemed to work... But in fact all the animalsniffer tasks were completing as SKIPPED as they lacked signatures. The build.gradle changes in this commit are to fix that while still using version catalog.

But while it was broken violations crept in. Most violations weren't too important and we're not surprised went unnoticed. For example, Netty with TLS has long required the Java 8 API
setEndpointIdentificationAlgorithm(), so using Optional in the same code path didn't harm anything in particular. I still swapped it to Guava's Optional to avoid overuse of @IgnoreJRERequirement.

One important violation has not been fixed and instead I've disabled the android signature in api/build.gradle for the moment. The violation is in StatusException using the fillInStackTrace overload of Exception. This problem had been noticed, but we couldn't figure out what was going on. AnimalSniffer is now noticing this and agreeing with the internal linter. There is still a question of why our interop tests failed to notice this, but given they are no longer running on pre-API level 24, that may forever be a mystery.

In 61f19d7 I swapped the signatures to use the version catalog. But I
failed to preserve the `@signature` extension and it all seemed to
work... But in fact all the animalsniffer tasks were completing as
SKIPPED as they lacked signatures. The build.gradle changes in this
commit are to fix that while still using version catalog.

But while it was broken violations crept in. Most violations weren't
too important and we're not surprised went unnoticed. For example, Netty
with TLS has long required the Java 8 API
`setEndpointIdentificationAlgorithm()`, so using `Optional` in the same
code path didn't harm anything in particular. I still swapped it to
Guava's `Optional` to avoid overuse of `@IgnoreJRERequirement`.

One important violation has not been fixed and instead I've disabled the
android signature in api/build.gradle for the moment.  The violation is
in StatusException using the `fillInStackTrace` overload of Exception.
This problem [had been noticed][PR11066], but we couldn't figure out
what was going on. AnimalSniffer is now noticing this and agreeing with
the internal linter. There is still a question of why our interop tests
failed to notice this, but given they are no longer running on pre-API
level 24, that may forever be a mystery.

[PR11066]: grpc#11066
Copy link
Contributor

@larry-safran larry-safran left a comment

Choose a reason for hiding this comment

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

Should all of interop-testing check for Java 8 instead of 7?

core/src/test/java/io/grpc/internal/SpiffeUtilTest.java Outdated Show resolved Hide resolved
api/build.gradle Outdated Show resolved Hide resolved
@ejona86
Copy link
Member Author

ejona86 commented Dec 19, 2024

Should all of interop-testing check for Java 8 instead of 7?

It checks for Java 8 and Android. interop-testing is used by android-interop-testing.

@ejona86 ejona86 merged commit 8ea3629 into grpc:master Dec 19, 2024
16 checks passed
@ejona86 ejona86 deleted the animalsniffer-enable branch December 19, 2024 15:54
Copy link
Contributor

@larry-safran larry-safran left a comment

Choose a reason for hiding this comment

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

A couple of nit things I commented on, but seems good.

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.

3 participants