Citrus catalog definition to provide an optional complete defaultValue - #3797
Citrus catalog definition to provide an optional complete defaultValue#3797mirchello wants to merge 5 commits into
defaultValue#3797Conversation
… complete `defaultValue` for the action or container inserted when its catalog tile is selected.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe Citrus catalog now supports optional complete default values. The test default service deep-clones these values before returning them. Tests cover nested cloning and preserve the existing custom-action shape. ChangesCitrus catalog presets
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to Catalog entries can now provide complete actions or containers that are inserted into tests without runtime validation. A malformed or compromised catalog could therefore create unexpected test behavior; the change is mergeable with explicit owner awareness or follow-up to validate catalog defaults against the applicable Citrus schema. Sequence Diagram(s)sequenceDiagram
participant CatalogDefinition
participant CitrusTestDefaultService
participant TestActionDefinition
CatalogDefinition->>CitrusTestDefaultService: provide defaultValue
CitrusTestDefaultService->>CitrusTestDefaultService: cloneDeep(defaultValue)
CitrusTestDefaultService-->>TestActionDefinition: return cloned default value
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
Hi @mirchello, thank you for your contribution. I would like to understand this change better, are you customizing the Citrus Catalog to show different test actions? @christophd, do we have this field in the Citrus catalog? |
|
@lordrip Hello, yes. To add in catalog customized actions. |
|
Thanks for the prompt reply @mirchello. Let's wait for @christophd's input. Meanwhile, would you like to check the failed build, squash all the commits in this branch and rebase them against the latest upstream/main branch? Thanks once again for your contribution. PS: Could you please expand a bit more on how these default values help you? I'm wondering if after this, we should think on a shareable catalog, contributing them to the @kaoto/camel-catalog or something else. |



Description
Closes #3767.
This change allows a Citrus catalog definition to provide an optional complete
defaultValuefor the action or container inserted when its catalog tile isselected.
Currently, Kaoto always derives the inserted model from the selected catalog
entry name and group. A custom entry named
company-logintherefore creates:With this change, the entry may provide:
{ "kind": "testAction", "name": "company-login", "defaultValue": { "applyTemplate": { "name": "company-login" } } }Kaoto then inserts the standard Citrus action:
The catalog value is deep-cloned before insertion so editing one test node
cannot mutate the shared catalog definition or later insertions. Catalog
entries without
defaultValuekeep the existing name/group-derived behavior.This action-level preset is separate from #3674, which concerns starter
content for complete resource files.
Type of Change
How Has This Been Tested?
node .yarn/releases/yarn-4.13.0.cjs workspace @kaoto/kaoto test citrus-test-default.service.test.tsnode .yarn/releases/yarn-4.13.0.cjs workspace @kaoto/kaoto testnode .yarn/releases/yarn-4.13.0.cjs workspace @kaoto/kaoto lint:styleChecklist
Summary by CodeRabbit
New Features
Bug Fixes