Skip to content

chore(dynamic-catalog): add resolveCatalogLookup()#3216

Open
shivamG640 wants to merge 1 commit into
KaotoIO:mainfrom
shivamG640:chore/dynamic-catalog-component-lookup
Open

chore(dynamic-catalog): add resolveCatalogLookup()#3216
shivamG640 wants to merge 1 commit into
KaotoIO:mainfrom
shivamG640:chore/dynamic-catalog-component-lookup

Conversation

@shivamG640
Copy link
Copy Markdown
Contributor

@shivamG640 shivamG640 commented May 15, 2026

Added an async version of CamelCatalogService.getCatalogLookup() to the dynamic catalog.

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced catalog resolution capabilities with improved support for resolving component and kamelet references, including automatic prefix handling and unified lookup functionality.
  • Tests

    • Added comprehensive test coverage for the new catalog lookup functionality.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 89a8d5b0-1543-4d37-b5f4-f3efcbd5414f

📥 Commits

Reviewing files that changed from the base of the PR and between 053fe3f and ca50766.

📒 Files selected for processing (3)
  • packages/ui/src/dynamic-catalog/dynamic-catalog-registry.test.ts
  • packages/ui/src/dynamic-catalog/dynamic-catalog-registry.ts
  • packages/ui/src/dynamic-catalog/models.ts

📝 Walkthrough

Walkthrough

This PR introduces a new resolveCatalogLookup async method to the DynamicCatalogRegistry that unifies component and kamelet catalog resolution. The method handles empty inputs, parses kamelet:-prefixed names with fallback logic, and returns both the catalog kind and resolved definition in a single call.

Changes

Catalog Lookup Resolution

Layer / File(s) Summary
Catalog lookup type contract
packages/ui/src/dynamic-catalog/models.ts
CatalogLookupResult union type captures lookups for CatalogKind.Component and CatalogKind.Kamelet with optional definitions. IDynamicCatalogRegistry interface adds the resolveCatalogLookup(componentName, options?) method signature.
Catalog lookup implementation
packages/ui/src/dynamic-catalog/dynamic-catalog-registry.ts
CatalogsRegistry implements resolveCatalogLookup to return undefined for falsy names, parse kamelet:-prefixed entries with kamelet-first lookup and component fallback, and resolve other names directly as components, returning catalog kind and definition.
Catalog lookup test coverage
packages/ui/src/dynamic-catalog/dynamic-catalog-registry.test.ts
Test suite validates empty input handling, component and kamelet resolution, fallback behavior for unknown kamelets, and forwarding of the forceFresh option to underlying catalog calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A catalog lookup, swift and clean,
Component or kamelet, now seen,
With prefix parsing, fallback so keen,
In tests it's covered, working serene!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new resolveCatalogLookup() method to the dynamic catalog.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@PVinaches PVinaches left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for pushing this!

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.

2 participants