Skip to content

feat(vscode): support file and HTTP Kamelet catalogs - #1664

Open
bartoszpop wants to merge 3 commits into
apache:mainfrom
bartoszpop:support-file-and-HTTP-Kamelet-catalogs
Open

bartoszpop wants to merge 3 commits into
apache:mainfrom
bartoszpop:support-file-and-HTTP-Kamelet-catalogs

Conversation

@bartoszpop

@bartoszpop bartoszpop commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #889

Summary

Extend Karavan.kameletsPath to load editor Kamelet catalogs from local directories, individual YAML files, and HTTP(S) URLs.

  • Support multiple Kamelets per file, including LF and CRLF line endings, comments, directives, and empty documents.
  • Parse built-in catalogs using the same YAML document parser, fixing Windows loading failures caused by LF-only splitting.
  • Add a 30-second remote-loading timeout and report HTTP, network, and YAML errors while keeping the built-in catalog available.
  • Separate editor catalog configuration from Camel JBang runtime configuration.
  • Fix Custom only filtering so it preserves selected categories and applies consistently to regular and preferred cards.

Configuration and migration

Karavan.kameletsPath is now editor-only, including directory sources. It is never passed to Camel JBang or downloaded into the integration project.

Use the new camel.localKameletDir setting for --local-kamelet-dir during run/export, including runtime run and deploy. It accepts only an existing local directory.

Existing users relying on Karavan.kameletsPath for runtime Kamelets must also set camel.localKameletDir. Reopen the designer after changing the editor catalog setting.

Validation

  • All 17 targeted tests pass: npm run test:kamelets.
  • Production bundles build successfully: npm run package.
  • Type-checking reports the same 15 pre-existing errors, with no new diagnostics.

Regression coverage includes the shipped 250-Kamelet catalog with both line endings, multi-document sources, HTTP redirects and failures, timeout handling, runtime-setting validation, and reversible Custom only filtering.

@mgubaidullin

Copy link
Copy Markdown
Contributor

Thanks for putting this together, @bartoszpop. The tests are great and the PR builds cleanly.

We'd like to hold off on merging, though, and explain why #889 suggests cloning a Kamelets repository locally and pointing Karavan.kameletsPath at it.

A local clone gives us the things a shared catalog needs, and Karavan doesn't have to implement any of them:

  • Access control. Git already handles keys, tokens and SSO, which matters for private catalogs.
  • Versioning. Teams can pin a tag or branch, review changes and roll back.
  • Designer and runtime stay in sync. The same folder is used by the designer and by Camel JBang (--local-kamelet-dir), so what you see in the designer is what runs.

Loading from a URL can't offer authentication or versioning. Because Camel JBang can't use a URL, it also means splitting the configuration into two settings. The designer could then show Kamelets the runtime can't find, and existing setups would stop passing --local-kamelet-dir without anyone noticing.

That said, two parts of this PR would be really welcome as a smaller, separate PR:

  • Parsing the catalog as YAML documents instead of split("\n---\n"). This fixes loading the built-in catalog on Windows, where files have CRLF line endings.
  • The Custom only fix, so the selected categories are kept when the toggle is switched on.

Thanks again, and happy to help with the follow-up!

Bartosz Popiela and others added 2 commits November 11, 2026 03:18
Support local files, directories and HTTP(S) catalogs with multi-document YAML validation, a 30-second remote timeout and explicit error reporting. Add catalog documentation and focused regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expand extension-host variables using  or  in catalog sources. Report undefined variables without fetching, preserve literal values, and document URL and local-path usage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bartoszpop
bartoszpop force-pushed the support-file-and-HTTP-Kamelet-catalogs branch from 1615e61 to bcc4d86 Compare November 11, 2026 02:40
@bartoszpop

bartoszpop commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed feedback @mgubaidullin ! I've split the changes into #1666 and #1664, as suggested.

Your points are all valid, and I understand the concerns. However, I'd like to highlight a few considerations:

  • Security and access control: Loading Kamelets over HTTP(S) would be entirely opt-in. Users choosing this approach should be aware of the security implications and decide whether it is appropriate for their environment. They could also protect the endpoint using Basic Authentication. Credentials can be included in the URL, and this PR supports resolving environment variables in URLs, allowing the password to be stored in an environment variable rather than hardcoded in the configuration (ofc including credentials in a URL is not secure, as they might be exposed in server logs or other diagnostic output, but it might be still acceptable in an internal network).
  • Multi-document YAML support: Even when Kamelets are hosted locally, I think it would be convenient to support a single multidoc YAML file containing multiple Kamelet definitions.
  • Separating editor and runtime configuration: Not everyone using the Karavan VS Code extension necessarily runs Camel JBang locally. Some users might only use the editor functionality. IMO it makes sense to keep the editor's Kamelet catalog configuration separate from the Camel JBang runtime configuration to allow users to configure each independently, depending on their use case. In our case, we provide Kamelets to Camel JBang via a jar on the classpath, so there's no need to specify --local-kamelets-dir. I extracted this feature to a separate pr - feat(vscode): separate runtime Kamelets directory from editor catalog #1667

Please consider the points above to support editor-only use case as well. Of course, I respect your decision in that regard.

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.

Get Kamelets from remote location

2 participants