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

fix(halyard-proto): Removed specified version for com.google.protobuf:protobuf-java #1913

Merged
merged 1 commit into from
Dec 10, 2021
Merged

fix(halyard-proto): Removed specified version for com.google.protobuf:protobuf-java #1913

merged 1 commit into from
Dec 10, 2021

Conversation

madhubkk
Copy link
Contributor

Getting below conflict between spring plugin and protobuf plugin while upgrading spring boot 2.2.x(existing kork) to 2.3.x:

Note: /halyard/halyard-core/src/main/java/com/netflix/spinnaker/halyard/core/resource/v1/JarResourceReader.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.FAILURE: Build failed with an exception.* What went wrong:
Execution failed for task ':halyard-proto:generateProto'.
> protoc: stdout: . stderr: google/longrunning/operations.proto:33:8: Option ""php_namespace"" unknown.
  deployments.proto: Import ""google/longrunning/operations.proto"" was not found or had errors.
  deployments.proto:13:50: ""google.longrunning.Operation"" is not defined."

Removing specified version of protobuf-java have no impact on current springboot version however will rectify an upcoming issue with springboot 2.3.12.
It is raised after verifying the effect of upgrading Kork with Springboot version.

…:protobuf-java

Getting below conflict between spring plugin and protobuf plugin while upgrading spring boot 2.2.x(existing kork) to 2.3.x:

"> Task :halyard-proto:generateProto FAILED> Task :halyard-core:compileJava
Note: /halyard/halyard-core/src/main/java/com/netflix/spinnaker/halyard/core/resource/v1/JarResourceReader.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.FAILURE: Build failed with an exception.* What went wrong:
Execution failed for task ':halyard-proto:generateProto'.
> protoc: stdout: . stderr: google/longrunning/operations.proto:33:8: Option ""php_namespace"" unknown.
  deployments.proto: Import ""google/longrunning/operations.proto"" was not found or had errors.
  deployments.proto:13:50: ""google.longrunning.Operation"" is not defined."

Removing specified version of protobuf-java have no impact on current springboot version however will rectify an upcoming issue with springboot 2.3.12.
It is raised after verifying the effect of upgrading Kork with Springboot version.
@j-sandy
Copy link
Contributor

j-sandy commented Dec 10, 2021

Spring dependency management plugin is required with spring boot 2.3.x, in order to enforce constraints. Here, unpinning will make dependency managed by kork-bom.

Copy link
Contributor

@j-sandy j-sandy left a comment

Choose a reason for hiding this comment

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

LGTM !

@@ -1,7 +1,7 @@
apply plugin: 'com.google.protobuf'

dependencies {
implementation 'com.google.protobuf:protobuf-java:3.0.0'
implementation 'com.google.protobuf:protobuf-java'
Copy link
Contributor

Choose a reason for hiding this comment

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

For the record, kork specifies the version here.

@dbyron-sf
Copy link
Contributor

Before this PR:

$ ./gradlew halyard-proto:dependencyInsight --dependency com.google.protobuf:protobuf-java

> Task :halyard-proto:dependencyInsight
com.google.protobuf:protobuf-java:3.11.4
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes+resources)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 11
   ]
   Selection reasons:
      - By constraint
      - By conflict resolution : between versions 3.11.4, 3.0.0, 3.11.0 and 3.7.1

com.google.protobuf:protobuf-java:3.11.4
\--- io.spinnaker.kork:kork-bom:7.127.0
     \--- compileClasspath

com.google.protobuf:protobuf-java:3.0.0 -> 3.11.4
\--- compileClasspath

com.google.protobuf:protobuf-java:3.7.1 -> 3.11.4
\--- com.google.api.grpc:proto-google-common-protos:1.17.0
     +--- io.spinnaker.kork:kork-bom:7.127.0
     |    \--- compileClasspath
     +--- com.google.api.grpc:grpc-google-common-protos:1.17.0
     |    +--- compileClasspath (requested com.google.api.grpc:grpc-google-common-protos:1.0.5)
     |    \--- io.spinnaker.kork:kork-bom:7.127.0 (*)
     \--- io.grpc:grpc-protobuf:1.27.2
          +--- io.spinnaker.kork:kork-bom:7.127.0 (*)
          +--- com.google.api.grpc:grpc-google-common-protos:1.17.0 (requested io.grpc:grpc-protobuf:1.23.0) (*)
          \--- io.grpc:grpc-all:1.8.0 (requested io.grpc:grpc-protobuf:1.8.0)
               \--- compileClasspath

com.google.protobuf:protobuf-java:3.11.0 -> 3.11.4
\--- io.grpc:grpc-protobuf:1.27.2
     +--- io.spinnaker.kork:kork-bom:7.127.0
     |    \--- compileClasspath
     +--- com.google.api.grpc:grpc-google-common-protos:1.17.0 (requested io.grpc:grpc-protobuf:1.23.0)
     |    +--- compileClasspath (requested com.google.api.grpc:grpc-google-common-protos:1.0.5)
     |    \--- io.spinnaker.kork:kork-bom:7.127.0 (*)
     \--- io.grpc:grpc-all:1.8.0 (requested io.grpc:grpc-protobuf:1.8.0)
          \--- compileClasspath

(*) - dependencies omitted (listed previously)

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 744ms
1 actionable task: 1 executed

and with this PR:

$ ./gradlew halyard-proto:dependencyInsight --dependency com.google.protobuf:protobuf-java

> Task :halyard-proto:dependencyInsight
com.google.protobuf:protobuf-java:3.11.4
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes+resources)
      org.gradle.category            = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 11
   ]
   Selection reasons:
      - By constraint
      - By conflict resolution : between versions 3.11.4, 3.11.0 and 3.7.1

com.google.protobuf:protobuf-java:3.11.4
\--- io.spinnaker.kork:kork-bom:7.127.0
     \--- compileClasspath

com.google.protobuf:protobuf-java -> 3.11.4
\--- compileClasspath

com.google.protobuf:protobuf-java:3.7.1 -> 3.11.4
\--- com.google.api.grpc:proto-google-common-protos:1.17.0
     +--- io.spinnaker.kork:kork-bom:7.127.0
     |    \--- compileClasspath
     +--- com.google.api.grpc:grpc-google-common-protos:1.17.0
     |    +--- compileClasspath (requested com.google.api.grpc:grpc-google-common-protos:1.0.5)
     |    \--- io.spinnaker.kork:kork-bom:7.127.0 (*)
     \--- io.grpc:grpc-protobuf:1.27.2
          +--- io.spinnaker.kork:kork-bom:7.127.0 (*)
          +--- com.google.api.grpc:grpc-google-common-protos:1.17.0 (requested io.grpc:grpc-protobuf:1.23.0) (*)
          \--- io.grpc:grpc-all:1.8.0 (requested io.grpc:grpc-protobuf:1.8.0)
               \--- compileClasspath

com.google.protobuf:protobuf-java:3.11.0 -> 3.11.4
\--- io.grpc:grpc-protobuf:1.27.2
     +--- io.spinnaker.kork:kork-bom:7.127.0
     |    \--- compileClasspath
     +--- com.google.api.grpc:grpc-google-common-protos:1.17.0 (requested io.grpc:grpc-protobuf:1.23.0)
     |    +--- compileClasspath (requested com.google.api.grpc:grpc-google-common-protos:1.0.5)
     |    \--- io.spinnaker.kork:kork-bom:7.127.0 (*)
     \--- io.grpc:grpc-all:1.8.0 (requested io.grpc:grpc-protobuf:1.8.0)
          \--- compileClasspath

(*) - dependencies omitted (listed previously)

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 776ms
1 actionable task: 1 executed

So the net is no change to the version of com.google.protobuf:protobuf-java -- it's 3.11.4 both before and after this PR.

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for a merge label Dec 10, 2021
@mergify mergify bot merged commit b3649f6 into spinnaker:master Dec 10, 2021
@mergify mergify bot added the auto merged label Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants