Skip to content

Commit

Permalink
Update protoc
Browse files Browse the repository at this point in the history
  • Loading branch information
danslapman committed Feb 4, 2024
1 parent 1251d8f commit bb79230
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 21 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ jobs:
check-latest: true

- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
version: '3.20.0'
version: "25.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Get the Ref
id: get-ref
Expand Down Expand Up @@ -203,9 +204,10 @@ jobs:
native-image-job-reports: 'true'

- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@v3
with:
version: '3.20.0'
version: "25.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Get the Ref
id: get-ref
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ import com.linecorp.armeria.client.ClientFactory
import com.linecorp.armeria.client.WebClient
import com.linecorp.armeria.client.encoding.DecodingClient
import com.mongodb.ConnectionString
import io.grpc.ServerBuilder
import io.grpc.Status
import io.grpc.{ServerBuilder, Status, StatusException}
import org.mongodb.scala.MongoClient
import org.mongodb.scala.MongoCollection
import org.mongodb.scala.MongoDatabase
import org.mongodb.scala.bson.BsonDocument
import scalapb.zio_grpc.RequestContext
import scalapb.zio_grpc.server.ZServerCallHandler
import sttp.client4.BackendOptions as SttpBackendOptions
import sttp.client4.armeria.zio.ArmeriaZioBackend
import tofu.logging.Logging
import tofu.logging.impl.ZUniversalLogging
import zio.managed.*

import ru.tinkoff.tcb.mockingbird.api.AdminApiHandler
import ru.tinkoff.tcb.mockingbird.api.AdminHttp
import ru.tinkoff.tcb.mockingbird.api.MetricsHttp
Expand Down Expand Up @@ -174,10 +171,11 @@ object Mockingbird extends scala.App {
runtime <- zio.ZIO.runtime[Any]
handler = ZServerCallHandler.unaryCallHandler(
runtime,
(bytes: Array[Byte]) =>
(bytes: Array[Byte], requestContext) =>
GrpcRequestHandler
.exec(bytes)
.provideSome[RequestContext](
.provide(
ZLayer.succeed(requestContext),
Tracing.live,
MockingbirdConfiguration.mongo,
MockingbirdConfiguration.tracing,
Expand All @@ -187,7 +185,7 @@ object Mockingbird extends scala.App {
GrpcStubResolverImpl.live,
GrpcRequestHandlerImpl.live
)
.mapError(e => Status.INTERNAL.withDescription(e.getMessage))
.mapError((e: Throwable) => new StatusException(Status.INTERNAL.withDescription(e.getMessage)))
)
mutableRegistry = UniversalHandlerRegistry(
handler
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class GrpcRequestHandlerImpl(stubResolver: GrpcStubResolver) extends GrpcRequest
context.metadata,
bytes
)
.mapError(_.asRuntimeException())
} yield result
}
}
Expand Down
6 changes: 3 additions & 3 deletions backend/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ object Dependencies {
)

lazy val protobuf = Seq(
"io.grpc" % "grpc-netty" % "1.43.2",
"io.grpc" % "grpc-netty" % "1.61.1",
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion,
"com.google.protobuf" % "protobuf-java" % "3.19.3",
"com.google.protobuf" % "protobuf-java-util" % "3.19.3"
"com.google.protobuf" % "protobuf-java" % "3.25.2",
"com.google.protobuf" % "protobuf-java-util" % "3.25.2"
)

lazy val metrics: Seq[ModuleID] = Seq(
Expand Down
8 changes: 4 additions & 4 deletions backend/project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ object Settings {
Seq(
Cmd("RUN", "apt-get", "update"),
Cmd("RUN", "apt-get", "install", "-y", "unzip"),
Cmd("RUN", "unzip", "/opt/mockingbird/protoc-3.20.0-linux-x86_64.zip -d", "/opt/protoc"),
Cmd("RUN", "rm", "/opt/mockingbird/protoc-3.20.0-linux-x86_64.zip"),
Cmd("RUN", "unzip", "/opt/mockingbird/protoc-25.2-linux-x86_64.zip -d", "/opt/protoc"),
Cmd("RUN", "rm", "/opt/mockingbird/protoc-25.2-linux-x86_64.zip"),
Cmd("ENV", "PATH=\"$PATH:/opt/protoc/bin:${PATH}\"")
),
0
Expand Down Expand Up @@ -204,8 +204,8 @@ object Settings {
Seq(
Cmd("RUN", "apt-get", "update"),
Cmd("RUN", "apt-get", "install", "-y", "unzip"),
Cmd("RUN", "unzip", "/opt/mockingbird-native/protoc-3.20.0-linux-x86_64.zip -d", "/opt/protoc"),
Cmd("RUN", "rm", "/opt/mockingbird-native/protoc-3.20.0-linux-x86_64.zip"),
Cmd("RUN", "unzip", "/opt/mockingbird-native/protoc-25.2-linux-x86_64.zip -d", "/opt/protoc"),
Cmd("RUN", "rm", "/opt/mockingbird-native/protoc-25.2-linux-x86_64.zip"),
Cmd("ENV", "PATH=\"$PATH:/opt/protoc/bin:${PATH}\"")
),
0
Expand Down
4 changes: 2 additions & 2 deletions backend/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("ch.epfl.scala" % "sbt-missinglink" % "0.3.6")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6")
addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.7")
addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.4")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.1.6")
addSbtPlugin("org.wartremover" % "sbt-wartremover-contrib" % "2.1.0", "1.0", "2.12")

libraryDependencies +=
"com.thesamet.scalapb.zio-grpc" %% "zio-grpc-codegen" % "0.6.0-test8"
"com.thesamet.scalapb.zio-grpc" %% "zio-grpc-codegen" % "0.6.1"

0 comments on commit bb79230

Please sign in to comment.