Repository navigation
Fix Scala 3 context arguments in generated gRPC routers - #934
Merged
Merged
Conversation
Contributor
|
This pull request is merged. |
mkurz
force-pushed
the
fix-scala3-grpc-router-context
branch
from
November 19, 2026 15:52
0829830 to
feadc0c
Compare
The Twirl compatibility generator needs pekko-grpc-codegen's sources JAR. Resolve it as a normal dependency in a private configuration instead of assuming optional IDE classifier downloads always contain it. Select the source artifact by metadata and keep the build-only dependency off the compile classpath and out of the published POM.
Pekko gRPC 2 enables scala3_sources for Scala 3, so generated handlers take their actor system through a using clause. Match that syntax in both Play router templates. Enable Scala 3 generation in the integration fixtures so CI exercises this path, import the generated serializers by name, and cover both syntax modes, router variants and power APIs in regression tests.
mkurz
force-pushed
the
fix-scala3-grpc-router-context
branch
from
November 19, 2026 16:34
feadc0c to
9f796eb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pekko gRPC 2.0.0 automatically enables
scala3_sourcesfor Scala 3 builds. Generated handlers then take(using system: ClassicActorSystemProvider), but Play's router templates still pass(system). A Scala 3 sample using the published generator fails with E172: no givenClassicActorSystemProvider.Use
service.scalaCompatConstants.ImplicitUsingin both router templates so the call matches the handler's Scala 2 or Scala 3 syntax. Add eight regression cases covering both syntax modes, regular/action routers and power APIs.Enable
scala3_sourcesin Scala 3 integration fixtures as well; those fixtures previously generated Scala 2 syntax, leaving the failing consumer path untested. Import the two generated serializers explicitly so the tests work with both Scala 2 implicits and Scala 3 named givens.Resolve the Twirl compatibility templates' Pekko gRPC sources JAR as a required dependency in a private build configuration. The generator now uses artifact metadata to locate it and works when optional IDE classifier downloads are absent. The build-only sources dependency stays out of the compile classpath and published POM.
Validation:
clean; testFull) passed on Java 25 with Scala 2.13.18 and 3.3.9, with optional classifier downloads disabled.git diff --checkis clean.