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

services: Deprecate V1alpha #11681

Merged
merged 4 commits into from
Nov 12, 2024
Merged

Conversation

shivaspeaks
Copy link
Member

No description provided.

@shivaspeaks
Copy link
Member Author

The jobs are failing with warning, Deprecated Gradle features were used in this build.
Is it fine merge? @ejona86

@ejona86
Copy link
Member

ejona86 commented Nov 11, 2024

The jobs are failing with warning, Deprecated Gradle features were used in this build.

That's not why. Javac is failing:

/home/runner/work/grpc-java/grpc-java/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java:39: warning: [deprecation] ProtoReflectionService in io.grpc.protobuf.services has been deprecated
import io.grpc.protobuf.services.ProtoReflectionService;
                                ^
/home/runner/work/grpc-java/grpc-java/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestClient.java:46: warning: [deprecation] ProtoReflectionService in io.grpc.protobuf.services has been deprecated
import io.grpc.protobuf.services.ProtoReflectionService;
                                ^
error: warnings found and -Werror specified

/home/runner/work/grpc-java/grpc-java/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java:223: warning: [deprecation] ProtoReflectionService in io.grpc.protobuf.services has been deprecated
              .addService(ProtoReflectionService.newInstance())
                          ^
/home/runner/work/grpc-java/grpc-java/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java:275: warning: [deprecation] ProtoReflectionService in io.grpc.protobuf.services has been deprecated
              .addService(ProtoReflectionService.newInstance())
                          ^
/home/runner/work/grpc-java/grpc-java/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestClient.java:280: warning: [deprecation] ProtoReflectionService in io.grpc.protobuf.services has been deprecated
            .addService(ProtoReflectionService.newInstance())
                        ^
1 error
5 warnings

> Task :grpc-interop-testing:compileJava FAILED

Is it fine merge?

No, because the test status is failing, and it isn't even flaky. (This would be true regardless of the error/warning.)

@shivaspeaks
Copy link
Member Author

shivaspeaks commented Nov 11, 2024

To resolve this, can we use @SuppressWarnings("deprecation") wherever this v1alpha is getting used?

@ejona86
Copy link
Member

ejona86 commented Nov 11, 2024

You can, but you can't put @SuppressWarnings on an import. So you need to either fully-qualify the usage or move the @Deprecated annotation to the methods, like newInstance() (still keeping the deprecation no the javadoc, probably).

@shivaspeaks shivaspeaks requested a review from ejona86 November 11, 2024 21:28
@@ -260,6 +260,7 @@ private static RpcType parseRpc(String rpc) {
}
}

@SuppressWarnings("deprecation")
Copy link
Member

Choose a reason for hiding this comment

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

This suppressed deprecation for many things. We do want deprecation warnings. It is better to put the annotation on an assignment:

@SuppressWarnings("deprecation")
BindableService oldReflectionService = ProtoReflectionService.newInstance();

Ditto for the other files.

@shivaspeaks shivaspeaks requested a review from ejona86 November 11, 2024 21:57
@@ -71,7 +71,8 @@ public class ProtoReflectionServiceTest {

private static final String TEST_HOST = "localhost";
private MutableHandlerRegistry handlerRegistry = new MutableHandlerRegistry();
private BindableService reflectionService;
@SuppressWarnings("deprecation")
BindableService reflectionService = ProtoReflectionService.newInstance();
Copy link
Member

Choose a reason for hiding this comment

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

Why remove private?

@shivaspeaks shivaspeaks merged commit 921f88a into grpc:master Nov 12, 2024
15 checks passed
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