pjfanning opened a new pull request, #1033:
URL: https://github.com/apache/pekko-management/pull/1033

   ### Motivation
   The javadsl setup factories and `withAuth` took invariant function types, so 
`javac` rejected valid arguments such as:
   
   - `Function<ActorSystem, List<ClusterMembershipCheck>>`
   - `Function<ClassicActorSystemProvider, ArrayList<...>>`
   - suppliers or auth functions returning `CompletableFuture`
   
   ### Modification
   - `StartupCheckSetup.create`, `ReadinessCheckSetup.create` and 
`LivenessCheckSetup.create` now take `Function<? super ActorSystem, ? extends 
List<? extends Supplier<? extends CompletionStage<Boolean>>>>`.
   - `ManagementRouteProviderSettings.withAuth` now takes `Function<? super 
Optional<ProvidedCredentials>, ? extends CompletionStage<Optional<String>>>`.
   - The stored types and public `createHealthChecks` getters are unchanged, so 
existing code reading them still compiles. The factories and `withAuth` cast 
internally. The stored function is only applied and its result only read by 
this library, though a caller who mutates the list returned through the 
`createHealthChecks` getter could add an element of the wrong type.
   - No docs change: the docs don't describe these signatures.
   
   ### Compatibility
   MiMa reports `IncompatibleSignatureProblem` for `LivenessCheckSetup.create`, 
`ReadinessCheckSetup.create` and `withAuth`; `StartupCheckSetup` is not in the 
1.0.0 baseline. This PR adds filters for them in 
`mima-filters/2.0.x.backwards.excludes`, as approved by the maintainer opening 
this PR. Only the generic signatures change, not the erased descriptors, so 
compiled callers keep linking. `withAuth` is abstract, but its class is sealed, 
so there are no external implementations.
   
   ### Result
   Java callers can pass these functions without adapting them, and existing 
lambda call sites still compile.
   
   ### Tests
   - `sbt "management/Test/compile"` before the change: the new tests did not 
compile, with `incompatible types` at all four call sites.
   - `sbt "+management/Test/testOnly 
org.apache.pekko.management.HealthCheckTest"`: 9 passed on Scala 2.13.18, 3.3.9 
and 3.9.0
   - `sbt "management/test"`: 44 passed on Scala 2.13.18
   - `sbt "+management/mimaReportBinaryIssues"`: passed with the new filters on 
2.13.18 and 3.3.9. Scala 3.9.0 has no previous artifact, so nothing was 
compared there.
   - `javap` on Scala 2.13.18 and 3.9.0: emits the intended `? super` / `? 
extends` signatures
   - `scalafmt --mode diff-ref=upstream/main`: run
   - `sbt "management/Test/javafmtCheck"`: passed on JDK 21, JDK 17 not 
installed
   - `sbt validatePullRequest`: not run
   
   ### References
   Refs #1031
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to