Add gRPC support to the fluent SDK with new DSL#1488
Conversation
d8aad6f to
9c75deb
Compare
|
@matheusandre1 Is this ready for review? |
There was a problem hiding this comment.
Pull request overview
Adds fluent-DSL support for defining gRPC call tasks (including a new step-based API in the experimental FuncDSL) and expands the gRPC integration tests to validate both YAML and fluent-built workflows.
Changes:
- Introduces experimental
FuncDSLgRPC call entrypoints (call(...)overloads +grpc()step) and supporting builders/SPIs/configurers. - Extends fluent spec task building with an additional
grpcoverload acceptingCallGrpcConfigurer. - Updates gRPC impl tests to run both YAML- and fluent-built workflows via parameterized tests.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| impl/test/src/test/java/io/serverlessworkflow/impl/test/grpc/GrpcUnaryTest.java | Converts setup/teardown to per-test lifecycle and adds parameterized coverage for YAML vs fluent-built unary gRPC workflow. |
| impl/test/src/test/java/io/serverlessworkflow/impl/test/grpc/GrpcUnaryArgsExprTest.java | Adds parameterized coverage for unary gRPC workflow with argument expressions. |
| impl/test/src/test/java/io/serverlessworkflow/impl/test/grpc/GrpcServerStreamingTest.java | Adds parameterized coverage for server-streaming gRPC workflow (YAML vs fluent). |
| impl/test/src/test/java/io/serverlessworkflow/impl/test/grpc/GrpcClientStreamingTest.java | Adds parameterized coverage for client-streaming gRPC workflow (YAML vs fluent). |
| impl/test/src/test/java/io/serverlessworkflow/impl/test/grpc/GrpcBiDirectionalStreamingTest.java | Adds parameterized coverage for bidi-streaming gRPC workflow (YAML vs fluent). |
| impl/test/pom.xml | Adds test-scoped dependency on the experimental fluent func artifact. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/TaskItemListBuilder.java | Adds grpc(String, CallGrpcConfigurer) overload in the fluent spec task list builder. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/spi/FuncDoFluent.java | Wires gRPC fluent support into the experimental “do” fluent interface. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/spi/CallGrpcFluent.java | New SPI interface enabling grpc(...) in experimental func fluent tasks. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncTaskItemListBuilder.java | Implements grpc(...) task creation for experimental func task lists. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncDoTaskBuilder.java | Adds grpc(...) to the experimental “do” task builder. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/FuncCallGrpcTaskBuilder.java | New builder that constructs CallGRPC tasks with default GRPCArguments. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncDSL.java | Adds gRPC call entrypoints and gRPC step factory methods to experimental FuncDSL. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/FuncCallGrpcStep.java | New step-based fluent builder for configuring gRPC call tasks in experimental DSL. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/configurers/FuncCallGrpcConfigurer.java | New functional configurer type for low-level gRPC call configuration in experimental DSL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Matheus André <matheusandr2@gmail.com>
| public TaskItemListBuilder grpc(String name, CallGrpcConfigurer configurer) { | ||
| Consumer<CallGrpcTaskBuilder> consumer = configurer; | ||
| return grpc(name, consumer); | ||
| } |
There was a problem hiding this comment.
no, maintaining this overload is necessary to ensure consistency with other grpc methods.
| public interface CallGrpcFluent<SELF extends TaskBaseBuilder<SELF>, LIST> { | ||
|
|
||
| LIST grpc(String name, Consumer<SELF> itemsConfigurer); | ||
|
|
||
| default LIST grpc(Consumer<SELF> itemsConfigurer) { | ||
| return this.grpc(null, itemsConfigurer); | ||
| } |
There was a problem hiding this comment.
Removing this would require changing the hierarchy of the FuncDoFluent types and would break the structure of the other module.
|
@ricardozanini Can you review? |
Many thanks for submitting your Pull Request ❤️!
What this PR does / why we need it:
This is Pull Request covers
FuncDSL.grpcgaps and I created layers tests hereAdditional information (if needed):
Closes: #1484