Skip to content

2489#4199

Merged
ivicac merged 6 commits intomasterfrom
2489
Feb 16, 2026
Merged

2489#4199
ivicac merged 6 commits intomasterfrom
2489

Conversation

@ivicac
Copy link
Contributor

@ivicac ivicac commented Feb 14, 2026

  • 2489 Remove OptionalUtils
  • 2489 Add cluster element mapping to handler loaders

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ivicac ivicac force-pushed the 2489 branch 4 times, most recently from 54ff7a5 to d7fe9a5 Compare February 15, 2026 22:29
ivicac and others added 5 commits February 16, 2026 07:20
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>
@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

@ivicac ivicac merged commit 2ad393f into master Feb 16, 2026
8 checks passed
@ivicac ivicac deleted the 2489 branch February 16, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant