Conversation
Contributor
ivicac
commented
Feb 14, 2026
- 2489 Remove OptionalUtils
- 2489 Add cluster element mapping to handler loaders
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements two main changes: removes OptionalUtils utility in favor of standard Java Optional methods, and adds cluster element mapping functionality to component handler loaders.
Changes:
- Removed OptionalUtils usage from handler loaders and replaced with standard Optional.orElse() calls
- Added cluster element mapping support to AbstractComponentHandlerLoader with a new mapper function parameter
- Modified ComponentDsl.tool() to conditionally set element only when perform function is present
- Extended ComponentDefinitionWrapper to handle cluster element definitions
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ComponentDsl.java | Modified tool() method to conditionally set cluster element based on perform function presence |
| ComponentDslToolTest.java | Added comprehensive tests for tool() method behavior with and without perform functions |
| OpenApiComponentHandlerLoaderTest.java | Added tests for PERFORM_FUNCTION_FUNCTION and tool creation with ActionDefinitionWrapper |
| OpenApiComponentHandlerLoader.java | Replaced OptionalUtils with Optional.orElse() and added cluster element mapper that wraps actions without perform functions |
| DefaultComponentHandlerLoader.java | Replaced OptionalUtils with Optional.orElseThrow() and added pass-through cluster element mapper |
| AbstractComponentHandlerLoader.java | Added cluster element mapping infrastructure and new mapper function parameter |
| ComponentDefinitionWrapper.java | Added cluster elements field and new 3-parameter constructor to support cluster element definitions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...api/src/main/java/com/bytechef/platform/component/definition/ComponentDefinitionWrapper.java
Outdated
Show resolved
Hide resolved
...main/java/com/bytechef/platform/component/handler/loader/AbstractComponentHandlerLoader.java
Outdated
Show resolved
Hide resolved
...n/java/com/bytechef/platform/component/oas/handler/loader/OpenApiComponentHandlerLoader.java
Outdated
Show resolved
Hide resolved
.../main/java/com/bytechef/platform/component/handler/loader/DefaultComponentHandlerLoader.java
Outdated
Show resolved
Hide resolved
...main/java/com/bytechef/platform/component/handler/loader/AbstractComponentHandlerLoader.java
Outdated
Show resolved
Hide resolved
54ff7a5 to
d7fe9a5
Compare
Add BiFunction-based cluster element definition mapping in AbstractComponentHandlerLoader, mirroring the existing action definition mapping pattern. Update ComponentDsl.tool() to leave element null when the source action has no perform function, and add OpenAPI mapper logic to detect and dynamically provide perform functions for such tools. Replace OptionalUtils usage with native Optional methods across all handler loaders. Add tests for ComponentDsl.tool() and OpenApiComponentHandlerLoader. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix typo: elementElementsOptional -> clusterElementsOptional - Use CollectionUtils.map instead of manual loop in mapClusterElementDefinitions - Return List.of() instead of null for absent cluster elements - Avoid duplicate action wrapping in OpenApi cluster element mapper - Add descriptive message to orElseThrow in DefaultComponentHandlerLoader Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s.element serialization The ComponentDsl.tool() change now sets element to null for actions without perform functions (OpenAPI-generated components), requiring snapshot regeneration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ument tag fields in GraphQL schemas
|
|
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.


