From 64c5eb9188999754b1939d7faaef73c03b91dea7 Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 6 Feb 2024 10:48:00 +0100 Subject: [PATCH 01/13] Enable scala3_sources --- .../scala/org/apache/pekko/grpc/gen/ProtocSettings.scala | 3 ++- .../apache/pekko/grpc/gen/scaladsl/ScalaCodeGenerator.scala | 1 + .../scala/org/apache/pekko/grpc/gen/scaladsl/Service.scala | 6 ++++-- .../src/main/twirl/templates/ScalaClient/Client.scala.txt | 2 +- .../src/main/twirl/templates/ScalaCommon/ApiTrait.scala.txt | 2 +- .../src/main/twirl/templates/ScalaServer/Handler.scala.txt | 2 +- project/plugins.sbt | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/codegen/src/main/scala/org/apache/pekko/grpc/gen/ProtocSettings.scala b/codegen/src/main/scala/org/apache/pekko/grpc/gen/ProtocSettings.scala index 00f7dad8..ac97ba2b 100644 --- a/codegen/src/main/scala/org/apache/pekko/grpc/gen/ProtocSettings.scala +++ b/codegen/src/main/scala/org/apache/pekko/grpc/gen/ProtocSettings.scala @@ -26,5 +26,6 @@ object ProtocSettings { "ascii_format_to_string", "no_lenses", "retain_source_code_info", - "grpc") + "grpc", + "scala3_sources") } diff --git a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCodeGenerator.scala b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCodeGenerator.scala index 65a61c0a..3aa7ea16 100644 --- a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCodeGenerator.scala +++ b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCodeGenerator.scala @@ -99,6 +99,7 @@ abstract class ScalaCodeGenerator extends CodeGenerator { case (p, "no_lenses") => p.copy(lenses = false) case (p, "retain_source_code_info") => p.copy(retainSourceCodeInfo = true) case (p, "grpc") => p.copy(grpc = true) + case (p, "scala3_sources") => p.copy(scala3Sources = true) case (x, _) => x } } diff --git a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Service.scala b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Service.scala index 94961807..00fe6f6e 100644 --- a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Service.scala +++ b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/Service.scala @@ -28,7 +28,8 @@ case class Service( serverPowerApi: Boolean, usePlayActions: Boolean, options: com.google.protobuf.DescriptorProtos.ServiceOptions, - comment: Option[String] = None) { + comment: Option[String] = None, + scalaCompatConstants: ScalaCompatConstants) { def serializers: Seq[Serializer] = (methods.map(_.deserializer) ++ methods.map(_.serializer)).distinct def packageDir = packageName.replace('.', '/') } @@ -56,6 +57,7 @@ object Service { serverPowerApi, usePlayActions, serviceDescriptor.getOptions, - serviceDescriptor.comment) + serviceDescriptor.comment, + new ScalaCompatConstants(fileDesc.emitScala3Sources)) } } diff --git a/codegen/src/main/twirl/templates/ScalaClient/Client.scala.txt b/codegen/src/main/twirl/templates/ScalaClient/Client.scala.txt index 312f0e18..e60fc962 100644 --- a/codegen/src/main/twirl/templates/ScalaClient/Client.scala.txt +++ b/codegen/src/main/twirl/templates/ScalaClient/Client.scala.txt @@ -59,7 +59,7 @@ object @{service.name}Client { new Default@{service.name}Client(channel, isChannelOwned = false) private class Default@{service.name}Client(channel: GrpcChannel, isChannelOwned: Boolean)(implicit sys: ClassicActorSystemProvider) extends @{service.name}Client { - import @{service.name}.MethodDescriptors._ + import @{service.name}.MethodDescriptors.@{service.scalaCompatConstants.WildcardImport} private implicit val ex: ExecutionContext = sys.classicSystem.dispatcher private val settings = channel.settings diff --git a/codegen/src/main/twirl/templates/ScalaCommon/ApiTrait.scala.txt b/codegen/src/main/twirl/templates/ScalaCommon/ApiTrait.scala.txt index 7de502e1..8ec7796c 100644 --- a/codegen/src/main/twirl/templates/ScalaCommon/ApiTrait.scala.txt +++ b/codegen/src/main/twirl/templates/ScalaCommon/ApiTrait.scala.txt @@ -58,7 +58,7 @@ object @{service.name} extends pekko.grpc.ServiceDescription { object MethodDescriptors { import pekko.grpc.internal.Marshaller import io.grpc.MethodDescriptor - import Serializers._ + import Serializers.@{service.scalaCompatConstants.WildcardImport} @for(method <- service.methods) { val @{method.name}Descriptor: MethodDescriptor[@method.inputTypeUnboxed, @method.outputTypeUnboxed] = diff --git a/codegen/src/main/twirl/templates/ScalaServer/Handler.scala.txt b/codegen/src/main/twirl/templates/ScalaServer/Handler.scala.txt index a5ce7393..697f8741 100644 --- a/codegen/src/main/twirl/templates/ScalaServer/Handler.scala.txt +++ b/codegen/src/main/twirl/templates/ScalaServer/Handler.scala.txt @@ -121,7 +121,7 @@ object @{serviceName}Handler { implicit val ec: ExecutionContext = mat.executionContext val spi = TelemetryExtension(system).spi - import @{service.name}.Serializers._ + import @{service.name}.Serializers.@{service.scalaCompatConstants.WildcardImport} def handle(request: model.HttpRequest, method: String): scala.concurrent.Future[model.HttpResponse] = GrpcMarshalling.negotiated(request, (reader, writer) => diff --git a/project/plugins.sbt b/project/plugins.sbt index 97de791a..9429feb2 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -51,4 +51,4 @@ libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit" % "5.13.1.2022061 // scripted testing libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value -libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.13" +libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.15" From 94a4831289b5da3435fe8f4f3bc1f1cc2d77c396 Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 6 Feb 2024 11:04:20 +0100 Subject: [PATCH 02/13] Add missing class --- .../pekko/grpc/gen/scaladsl/ScalaCompatConstants.scala | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCompatConstants.scala diff --git a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCompatConstants.scala b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCompatConstants.scala new file mode 100644 index 00000000..8bb9fa9b --- /dev/null +++ b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCompatConstants.scala @@ -0,0 +1,6 @@ +package org.apache.pekko.grpc.gen.scaladsl + +private[scaladsl] class ScalaCompatConstants(emitScala3Sources: Boolean = false) { + // val WildcardType: String = if (emitScala3Sources) "?" else "_" + val WildcardImport: String = if (emitScala3Sources) "*" else "_" +} From 597122cb919c2f7cde213d9f45ad1a26decf766d Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 6 Feb 2024 11:08:45 +0100 Subject: [PATCH 03/13] Add header --- .../gen/scaladsl/ScalaCompatConstants.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCompatConstants.scala b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCompatConstants.scala index 8bb9fa9b..1389f359 100644 --- a/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCompatConstants.scala +++ b/codegen/src/main/scala/org/apache/pekko/grpc/gen/scaladsl/ScalaCompatConstants.scala @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.pekko.grpc.gen.scaladsl private[scaladsl] class ScalaCompatConstants(emitScala3Sources: Boolean = false) { From ba2179490633a5463f5211eb0310d83f690236ee Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 6 Feb 2024 16:01:07 +0100 Subject: [PATCH 04/13] Attempt to fix tests --- benchmark-java/build.sbt | 2 +- build.sbt | 1 + .../pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy | 4 ++-- .../pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala | 4 +--- maven-plugin/src/main/maven/plugin.xml | 4 ++-- plugin-tester-java/pom.xml | 2 +- plugin-tester-scala/pom.xml | 2 +- project/Dependencies.scala | 6 +++--- project/plugins.sbt | 2 +- .../org/apache/pekko/grpc/internal/NettyClientUtils.scala | 1 + .../internal/PekkoDiscoveryNameResolverProvider.scala | 8 ++++---- .../internal/PekkoDiscoveryNameResolverProviderSpec.scala | 1 + .../src/sbt-test/gen-scala-server/00-interop/build.sbt | 2 +- 13 files changed, 20 insertions(+), 19 deletions(-) diff --git a/benchmark-java/build.sbt b/benchmark-java/build.sbt index fb9f93b1..2a8ab2f1 100644 --- a/benchmark-java/build.sbt +++ b/benchmark-java/build.sbt @@ -14,7 +14,7 @@ run / javaOptions ++= List("-Xms1g", "-Xmx1g", "-XX:+PrintGCDetails", "-XX:+Prin // generate both client and server (default) in Java pekkoGrpcGeneratedLanguages := Seq(PekkoGrpc.Java) -val grpcVersion = "1.54.2" // checked synced by VersionSyncCheckPlugin +val grpcVersion = "1.60.0" // checked synced by VersionSyncCheckPlugin val runtimeProject = ProjectRef(file("../"), "runtime") diff --git a/build.sbt b/build.sbt index 603e7532..96605947 100644 --- a/build.sbt +++ b/build.sbt @@ -283,6 +283,7 @@ lazy val pluginTesterJava = Project(id = "plugin-tester-java", base = file("plug .settings( name := s"$pekkoPrefix-plugin-tester-java", fork := true, + PB.protocVersion := Dependencies.Versions.googleProtoc, ReflectiveCodeGen.generatedLanguages := Seq("Java"), crossScalaVersions := Dependencies.Versions.CrossScalaForLib, scalaVersion := scala212, diff --git a/gradle-plugin/src/main/groovy/org/apache/pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy b/gradle-plugin/src/main/groovy/org/apache/pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy index fcfd8f79..0df1f646 100644 --- a/gradle-plugin/src/main/groovy/org/apache/pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy +++ b/gradle-plugin/src/main/groovy/org/apache/pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy @@ -14,11 +14,11 @@ import org.gradle.api.Project class PekkoGrpcPluginExtension { - static final String PROTOC_VERSION = "3.20.1" // checked synced by VersionSyncCheckPlugin + static final String PROTOC_VERSION = "3.24.0" // checked synced by VersionSyncCheckPlugin static final String PROTOC_PLUGIN_SCALA_VERSION = "2.12" - static final String GRPC_VERSION = "1.54.2" // checked synced by VersionSyncCheckPlugin + static final String GRPC_VERSION = "1.60.0" // checked synced by VersionSyncCheckPlugin static final String PLUGIN_CODE = 'org.apache.pekko.grpc.gradle' diff --git a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala index 6eedbee5..1c3079f8 100644 --- a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala +++ b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala @@ -17,7 +17,6 @@ import java.net.InetSocketAddress import org.apache.pekko import pekko.actor.ActorSystem import pekko.grpc.GrpcClientSettings -import pekko.grpc.internal.ClientConnectionException import pekko.grpc.scaladsl.tools.MutableServiceDiscovery import pekko.http.scaladsl.Http import pekko.stream.{ Materializer, SystemMaterializer } @@ -184,8 +183,7 @@ class NonBalancingIntegrationSpec(backend: String) val failure = client.sayHello(HelloRequest(s"Hello friend")).failed.futureValue.asInstanceOf[StatusRuntimeException] - failure.getStatus.getCode should be(Code.UNAVAILABLE) - client.closed.failed.futureValue shouldBe a[ClientConnectionException] + failure.getStatus.getCode should (equal(Code.UNKNOWN).or(equal(Code.UNAVAILABLE))) } "not fail when no valid endpoints are provided but no limit on attempts is set" in { diff --git a/maven-plugin/src/main/maven/plugin.xml b/maven-plugin/src/main/maven/plugin.xml index 00f9767f..6c01eec6 100644 --- a/maven-plugin/src/main/maven/plugin.xml +++ b/maven-plugin/src/main/maven/plugin.xml @@ -95,7 +95,7 @@ ${pekko-grpc.protoPaths} ${pekko-grpc.outputDirectory} - ${pekko-grpc.protoc-version} + ${pekko-grpc.protoc-version} @@ -187,7 +187,7 @@ ${pekko-grpc.protoPaths} ${pekko-grpc.outputDirectory} - ${pekko-grpc.protoc-version} + ${pekko-grpc.protoc-version} diff --git a/plugin-tester-java/pom.xml b/plugin-tester-java/pom.xml index b0c96b03..201addb4 100644 --- a/plugin-tester-java/pom.xml +++ b/plugin-tester-java/pom.xml @@ -25,7 +25,7 @@ 3.1.2 3.0.0 1.0.0 - 1.54.2 + 1.60.0 UTF-8 diff --git a/plugin-tester-scala/pom.xml b/plugin-tester-scala/pom.xml index b8052c33..afba16af 100644 --- a/plugin-tester-scala/pom.xml +++ b/plugin-tester-scala/pom.xml @@ -24,7 +24,7 @@ 1.8 1.0.2 1.0.0 - 1.54.2 + 1.60.0 UTF-8 diff --git a/project/Dependencies.scala b/project/Dependencies.scala index cc713168..6491a035 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -32,12 +32,12 @@ object Dependencies { val pekkoHttp = PekkoHttpDependency.version val pekkoHttpBinary = pekkoHttp.take(3) - val grpc = "1.54.2" // checked synced by VersionSyncCheckPlugin + val grpc = "1.60.0" // checked synced by VersionSyncCheckPlugin // Even referenced explicitly in the sbt-plugin's sbt-tests // If changing this, remember to update protoc plugin version to align in // maven-plugin/src/main/maven/plugin.xml and org.apache.pekko.grpc.sbt.PekkoGrpcPlugin - val googleProtoc = "3.20.1" // checked synced by VersionSyncCheckPlugin - val googleProtobufJava = "3.21.12" + val googleProtoc = "3.24.0" // checked synced by VersionSyncCheckPlugin + val googleProtobufJava = "3.24.0" val scalaTest = "3.2.15" diff --git a/project/plugins.sbt b/project/plugins.sbt index 9429feb2..89066d60 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -51,4 +51,4 @@ libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit" % "5.13.1.2022061 // scripted testing libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value -libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.15" +libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.14" diff --git a/runtime/src/main/scala/org/apache/pekko/grpc/internal/NettyClientUtils.scala b/runtime/src/main/scala/org/apache/pekko/grpc/internal/NettyClientUtils.scala index 07b1d8a3..8a9c3f24 100644 --- a/runtime/src/main/scala/org/apache/pekko/grpc/internal/NettyClientUtils.scala +++ b/runtime/src/main/scala/org/apache/pekko/grpc/internal/NettyClientUtils.scala @@ -58,6 +58,7 @@ object NettyClientUtils { new PekkoDiscoveryNameResolverProvider( settings.serviceDiscovery, settings.defaultPort, + settings.serviceName, settings.servicePortName, settings.serviceProtocol, settings.resolveTimeout)) diff --git a/runtime/src/main/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverProvider.scala b/runtime/src/main/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverProvider.scala index 66b5735a..2982ce8d 100644 --- a/runtime/src/main/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverProvider.scala +++ b/runtime/src/main/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverProvider.scala @@ -24,6 +24,7 @@ import scala.concurrent.duration.FiniteDuration class PekkoDiscoveryNameResolverProvider( discovery: ServiceDiscovery, defaultPort: Int, + serviceName: String, portName: Option[String], protocol: Option[String], resolveTimeout: FiniteDuration)(implicit ec: ExecutionContext) @@ -34,8 +35,7 @@ class PekkoDiscoveryNameResolverProvider( override def getDefaultScheme: String = "http" - override def newNameResolver(targetUri: URI, args: NameResolver.Args): PekkoDiscoveryNameResolver = { - require(targetUri.getAuthority != null, s"target uri should not have null authority, got [$targetUri]") - new PekkoDiscoveryNameResolver(discovery, defaultPort, targetUri.getAuthority, portName, protocol, resolveTimeout) - } + override def newNameResolver(targetUri: URI, args: NameResolver.Args): PekkoDiscoveryNameResolver = + new PekkoDiscoveryNameResolver(discovery, defaultPort, serviceName, portName, protocol, resolveTimeout) + } diff --git a/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverProviderSpec.scala b/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverProviderSpec.scala index ba19adbd..aef2c346 100644 --- a/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverProviderSpec.scala +++ b/runtime/src/test/scala/org/apache/pekko/grpc/internal/PekkoDiscoveryNameResolverProviderSpec.scala @@ -61,6 +61,7 @@ class PekkoDiscoveryNameResolverProviderSpec val provider = new PekkoDiscoveryNameResolverProvider( discovery, 443, + serviceName, portName = None, protocol = None, resolveTimeout = 3.seconds) diff --git a/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt b/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt index 6e6e3523..89d2df4c 100644 --- a/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt +++ b/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt @@ -13,7 +13,7 @@ scalaVersion := "2.12.18" organization := "org.apache.pekko" -val grpcVersion = "1.54.2" // checked synced by VersionSyncCheckPlugin +val grpcVersion = "1.60.0" // checked synced by VersionSyncCheckPlugin libraryDependencies ++= Seq( "io.grpc" % "grpc-interop-testing" % grpcVersion % "protobuf-src", From d67c5cc2545e1f2c0b504471b47e6d84c8ba4178 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Tue, 6 Feb 2024 20:44:24 +0100 Subject: [PATCH 05/13] bin compat issue --- .../io.grpc-upgrade.backwards.excludes | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 runtime/src/main/mima-filters/1.1.x.backwards.excludes/io.grpc-upgrade.backwards.excludes diff --git a/runtime/src/main/mima-filters/1.1.x.backwards.excludes/io.grpc-upgrade.backwards.excludes b/runtime/src/main/mima-filters/1.1.x.backwards.excludes/io.grpc-upgrade.backwards.excludes new file mode 100644 index 00000000..218a9f55 --- /dev/null +++ b/runtime/src/main/mima-filters/1.1.x.backwards.excludes/io.grpc-upgrade.backwards.excludes @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Upgrade to io.grpc 1.60 caused this bin compat issue +ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.grpc.internal.PekkoDiscoveryNameResolverProvider.this") From f22d398b2c729def16277f7933f25f26a4f9ff48 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 7 Feb 2024 16:35:54 +0100 Subject: [PATCH 06/13] grpc 1.61.1 --- benchmark-java/build.sbt | 2 +- .../apache/pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy | 2 +- plugin-tester-java/pom.xml | 2 +- plugin-tester-scala/pom.xml | 2 +- project/Dependencies.scala | 2 +- sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/benchmark-java/build.sbt b/benchmark-java/build.sbt index 2a8ab2f1..cd7d756f 100644 --- a/benchmark-java/build.sbt +++ b/benchmark-java/build.sbt @@ -14,7 +14,7 @@ run / javaOptions ++= List("-Xms1g", "-Xmx1g", "-XX:+PrintGCDetails", "-XX:+Prin // generate both client and server (default) in Java pekkoGrpcGeneratedLanguages := Seq(PekkoGrpc.Java) -val grpcVersion = "1.60.0" // checked synced by VersionSyncCheckPlugin +val grpcVersion = "1.61.1" // checked synced by VersionSyncCheckPlugin val runtimeProject = ProjectRef(file("../"), "runtime") diff --git a/gradle-plugin/src/main/groovy/org/apache/pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy b/gradle-plugin/src/main/groovy/org/apache/pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy index 0df1f646..28df45d6 100644 --- a/gradle-plugin/src/main/groovy/org/apache/pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy +++ b/gradle-plugin/src/main/groovy/org/apache/pekko/grpc/gradle/PekkoGrpcPluginExtension.groovy @@ -18,7 +18,7 @@ class PekkoGrpcPluginExtension { static final String PROTOC_PLUGIN_SCALA_VERSION = "2.12" - static final String GRPC_VERSION = "1.60.0" // checked synced by VersionSyncCheckPlugin + static final String GRPC_VERSION = "1.61.1" // checked synced by VersionSyncCheckPlugin static final String PLUGIN_CODE = 'org.apache.pekko.grpc.gradle' diff --git a/plugin-tester-java/pom.xml b/plugin-tester-java/pom.xml index 201addb4..bf4fc85d 100644 --- a/plugin-tester-java/pom.xml +++ b/plugin-tester-java/pom.xml @@ -25,7 +25,7 @@ 3.1.2 3.0.0 1.0.0 - 1.60.0 + 1.61.1 UTF-8 diff --git a/plugin-tester-scala/pom.xml b/plugin-tester-scala/pom.xml index afba16af..c884ba16 100644 --- a/plugin-tester-scala/pom.xml +++ b/plugin-tester-scala/pom.xml @@ -24,7 +24,7 @@ 1.8 1.0.2 1.0.0 - 1.60.0 + 1.61.1 UTF-8 diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 6491a035..7aa28d9e 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -32,7 +32,7 @@ object Dependencies { val pekkoHttp = PekkoHttpDependency.version val pekkoHttpBinary = pekkoHttp.take(3) - val grpc = "1.60.0" // checked synced by VersionSyncCheckPlugin + val grpc = "1.61.1" // checked synced by VersionSyncCheckPlugin // Even referenced explicitly in the sbt-plugin's sbt-tests // If changing this, remember to update protoc plugin version to align in // maven-plugin/src/main/maven/plugin.xml and org.apache.pekko.grpc.sbt.PekkoGrpcPlugin diff --git a/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt b/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt index 89d2df4c..a95be255 100644 --- a/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt +++ b/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt @@ -13,7 +13,7 @@ scalaVersion := "2.12.18" organization := "org.apache.pekko" -val grpcVersion = "1.60.0" // checked synced by VersionSyncCheckPlugin +val grpcVersion = "1.61.1" // checked synced by VersionSyncCheckPlugin libraryDependencies ++= Seq( "io.grpc" % "grpc-interop-testing" % grpcVersion % "protobuf-src", From 277bed410226acb235f228b7bf361a95967b331e Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 20 Feb 2024 13:29:27 +0100 Subject: [PATCH 07/13] Refactor 06-compatibility-plugins test --- .github/workflows/build-test.yml | 6 ++++++ .../06-compatibility-plugins/project/ProtocJSPlugin.scala | 4 +++- .../src/main/protobuf/helloworld.proto | 1 + .../06-compatibility-plugins/src/test/protobuf/echo.proto | 1 + .../sbt-test/gen-scala-server/06-compatibility-plugins/test | 4 ++-- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 399aed81..e6d7ab65 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -110,6 +110,12 @@ jobs: distribution: temurin java-version: 8 + - name: Install go & go-protobuf + - uses: actions/setup-go@v5 + with: + go-version: '^1.20' + - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 + - name: Cache Coursier cache uses: coursier/cache-action@v6 diff --git a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocJSPlugin.scala b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocJSPlugin.scala index e050644d..9ea80982 100644 --- a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocJSPlugin.scala +++ b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocJSPlugin.scala @@ -19,5 +19,7 @@ object ProtocJSPlugin extends AutoPlugin { override def requires: Plugins = ProtocPlugin override def projectSettings: Seq[Def.Setting[_]] = - Seq(Compile, Test).flatMap(inConfig(_)(PB.targets += PB.gens.js -> resourceManaged.value / "js")) + Seq(Compile, Test).flatMap(inConfig(_)( + Seq( + PB.targets += PB.gens.go -> resourceManaged.value / "go"))) } diff --git a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/src/main/protobuf/helloworld.proto b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/src/main/protobuf/helloworld.proto index 0f442669..0d2d6f55 100644 --- a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/src/main/protobuf/helloworld.proto +++ b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/src/main/protobuf/helloworld.proto @@ -1,5 +1,6 @@ syntax = "proto3"; +option go_package = "github.com/apache/pekko-grpc"; option java_multiple_files = true; option java_package = "example.myapp.helloworld.grpc"; option java_outer_classname = "HelloWorldProto"; diff --git a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/src/test/protobuf/echo.proto b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/src/test/protobuf/echo.proto index de1aed8e..819bd2fb 100644 --- a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/src/test/protobuf/echo.proto +++ b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/src/test/protobuf/echo.proto @@ -1,5 +1,6 @@ syntax = "proto3"; +option go_package = "github.com/apache/pekko-grpc"; option java_multiple_files = true; option java_package = "example.myapp.echo.grpc"; diff --git a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/test b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/test index 50cbc18b..2c38813b 100644 --- a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/test +++ b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/test @@ -1,8 +1,8 @@ > compile -$ exists target/scala-2.12/resource_managed/main/js/hellorequest.js +$ exists target/scala-2.12/resource_managed/main/go/github.com/apache/pekko-grpc/helloworld.pb.go $ exists target/scala-2.12/pekko-grpc/main/example/myapp/helloworld/grpc/HelloRequest.scala > test:compile -$ exists target/scala-2.12/resource_managed/test/js/echomessage.js +$ exists target/scala-2.12/resource_managed/test/go/github.com/apache/pekko-grpc/echo.pb.go $ exists target/scala-2.12/pekko-grpc/test/example/myapp/echo/grpc/EchoMessage.scala From 743025d68776f623d488a046b30858f80a79c57b Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 20 Feb 2024 13:58:01 +0100 Subject: [PATCH 08/13] Attempt to fix gh action yaml --- .github/workflows/build-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e6d7ab65..f7e95af7 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -114,13 +114,14 @@ jobs: - uses: actions/setup-go@v5 with: go-version: '^1.20' - - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 - name: Cache Coursier cache uses: coursier/cache-action@v6 - name: Scripted ${{ matrix.test-set }} - run: cp .jvmopts-ci .jvmopts && sbt ++${{ matrix.scala-version }}.* "sbt-plugin/scripted ${{ matrix.test-set }}/*" + run: |- + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 + cp .jvmopts-ci .jvmopts && sbt ++${{ matrix.scala-version }}.* "sbt-plugin/scripted ${{ matrix.test-set }}/*" test-gradle: name: Gradle tests From 831d69611cc0348b5e569821ee62eeee4fe52b5a Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 20 Feb 2024 14:01:05 +0100 Subject: [PATCH 09/13] Rename plugin --- .../06-compatibility-plugins/build.sbt | 2 +- .../project/ProtocJSPlugin.scala | 25 ------------------- 2 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocJSPlugin.scala diff --git a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/build.sbt b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/build.sbt index 5e774789..ec0271f3 100644 --- a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/build.sbt +++ b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/build.sbt @@ -11,6 +11,6 @@ // https://github.com/akka/akka-grpc/pull/1279 scalaVersion := "2.12.18" -enablePlugins(ProtocJSPlugin) // enable it first to test possibility of getting overriden +enablePlugins(ProtocGoPlugin) // enable it first to test possibility of getting overriden enablePlugins(PekkoGrpcPlugin) diff --git a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocJSPlugin.scala b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocJSPlugin.scala deleted file mode 100644 index 9ea80982..00000000 --- a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocJSPlugin.scala +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * license agreements; and to You under the Apache License, version 2.0: - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * This file is part of the Apache Pekko project, which was derived from Akka. - */ - -import sbt.Keys._ -import sbt._ -import sbtprotoc.ProtocPlugin -import sbtprotoc.ProtocPlugin.autoImport.PB - -object ProtocJSPlugin extends AutoPlugin { - - override def trigger: PluginTrigger = noTrigger - - override def requires: Plugins = ProtocPlugin - - override def projectSettings: Seq[Def.Setting[_]] = - Seq(Compile, Test).flatMap(inConfig(_)( - Seq( - PB.targets += PB.gens.go -> resourceManaged.value / "go"))) -} From 8eaac08229ac374103d98b22a44cba982d604d51 Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 20 Feb 2024 14:15:57 +0100 Subject: [PATCH 10/13] Fix gh action yml --- .github/workflows/build-test.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f7e95af7..95ccbfa2 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -110,18 +110,17 @@ jobs: distribution: temurin java-version: 8 - - name: Install go & go-protobuf - - uses: actions/setup-go@v5 + - name: Install go + uses: actions/setup-go@v5 with: go-version: '^1.20' + run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 - name: Cache Coursier cache uses: coursier/cache-action@v6 - name: Scripted ${{ matrix.test-set }} - run: |- - go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 - cp .jvmopts-ci .jvmopts && sbt ++${{ matrix.scala-version }}.* "sbt-plugin/scripted ${{ matrix.test-set }}/*" + run: cp .jvmopts-ci .jvmopts && sbt ++${{ matrix.scala-version }}.* "sbt-plugin/scripted ${{ matrix.test-set }}/*" test-gradle: name: Gradle tests From 98d651fdfdd1d27dcd8aed131f0ce2eee03b963b Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 20 Feb 2024 14:23:43 +0100 Subject: [PATCH 11/13] Seperate step for installing protoc-gen-go --- .github/workflows/build-test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 95ccbfa2..a9ac6bd8 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -114,7 +114,9 @@ jobs: uses: actions/setup-go@v5 with: go-version: '^1.20' - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 + + - name: Install protoc-gen-go + - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 - name: Cache Coursier cache uses: coursier/cache-action@v6 From b3a67690bb187b1a07ef8813771e7ec9fcd004fd Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 20 Feb 2024 14:28:38 +0100 Subject: [PATCH 12/13] Remove hyphen --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a9ac6bd8..79832e6f 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -116,7 +116,7 @@ jobs: go-version: '^1.20' - name: Install protoc-gen-go - - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 + run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 - name: Cache Coursier cache uses: coursier/cache-action@v6 From d07db68fefa1675062184a63bae6d52c78d99d07 Mon Sep 17 00:00:00 2001 From: kczulko Date: Tue, 20 Feb 2024 14:50:55 +0100 Subject: [PATCH 13/13] Fix link validator and ProtocGoPlugin.scala --- .../project/ProtocGoPlugin.scala | 25 +++++++++++++++++++ scripts/link-validator.conf | 1 + 2 files changed, 26 insertions(+) create mode 100644 sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocGoPlugin.scala diff --git a/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocGoPlugin.scala b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocGoPlugin.scala new file mode 100644 index 00000000..0875b6f2 --- /dev/null +++ b/sbt-plugin/src/sbt-test/gen-scala-server/06-compatibility-plugins/project/ProtocGoPlugin.scala @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * license agreements; and to You under the Apache License, version 2.0: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * This file is part of the Apache Pekko project, which was derived from Akka. + */ + +import sbt.Keys._ +import sbt._ +import sbtprotoc.ProtocPlugin +import sbtprotoc.ProtocPlugin.autoImport.PB + +object ProtocGoPlugin extends AutoPlugin { + + override def trigger: PluginTrigger = noTrigger + + override def requires: Plugins = ProtocPlugin + + override def projectSettings: Seq[Def.Setting[_]] = + Seq(Compile, Test).flatMap(inConfig(_)( + Seq( + PB.targets += PB.gens.go -> resourceManaged.value / "go"))) +} diff --git a/scripts/link-validator.conf b/scripts/link-validator.conf index 728b24e4..122fcd57 100644 --- a/scripts/link-validator.conf +++ b/scripts/link-validator.conf @@ -34,6 +34,7 @@ site-link-validator { non-https-whitelist = [ # license report + "http://www.jetbrains.org", "http://aopalliance.sourceforge.net", "http://asm.ow2.io/", "http://checkerframework.org",