Observed lint failures in
googleapis/google-cloud-java#13928
googleapis/google-cloud-java#13929
However, on the onboarding PR lint did not fail: https://github.com/googleapis/google-cloud-java/pull/13864/changes
(different issue CI is bypassing grpc-* modules for lint - https://github.com/googleapis/google-cloud-java/blob/bfd98cf1b68f706c9847baa86908b196697eaa0c/.kokoro/build.sh#L263)
Several generated gRPC files (e.g., SqlEventsServiceGrpc.java, SqlAvailableDatabaseVersionsServiceGrpc.java) were found to have formatting violations (specifically, extra vertical whitespace between the package declaration and the class Javadoc). These files were generated by Librarian and should have been formatted, but they remained unformatted in the final output.
Root Cause Analysis
- Empty Services in Cloud SQL: The Cloud SQL API defines several services (like SqlEventsService and SqlAvailableDatabaseVersionsService) that have zero methods generated in their gRPC stubs.
- Unused Import Generation: The gRPC Java generator (protoc-gen-grpc-java) blindly prepends import static io.grpc.MethodDescriptor.generateFullMethodName; to all generated service files, which makes it unused in these empty services.
- google-java-format Bug: When GJF (tested on 1.25.2 and the latest 1.35.0) removes this unused import, it fails to collapse the vertical whitespace in the same pass, leaving extra empty lines in the file.
workaround: Running GJF a second time collapses these lines and fixes the formatting. But every invoke of GJF needs starting a new Java Virtual Machine (JVM) instance. Implementing this workaround would add to already long generating time (estimate ~5-10mins for all)
more in thread
Observed lint failures in
googleapis/google-cloud-java#13928
googleapis/google-cloud-java#13929
However, on the onboarding PR lint did not fail: https://github.com/googleapis/google-cloud-java/pull/13864/changes
(different issue CI is bypassing grpc-* modules for lint - https://github.com/googleapis/google-cloud-java/blob/bfd98cf1b68f706c9847baa86908b196697eaa0c/.kokoro/build.sh#L263)
Several generated gRPC files (e.g., SqlEventsServiceGrpc.java, SqlAvailableDatabaseVersionsServiceGrpc.java) were found to have formatting violations (specifically, extra vertical whitespace between the package declaration and the class Javadoc). These files were generated by Librarian and should have been formatted, but they remained unformatted in the final output.
Root Cause Analysis
workaround: Running GJF a second time collapses these lines and fixes the formatting. But every invoke of GJF needs starting a new Java Virtual Machine (JVM) instance. Implementing this workaround would add to already long generating time (estimate ~5-10mins for all)
more in thread