Skip to content

Add folder name to config list output - #44

Merged
padak merged 3 commits into
mainfrom
fix/config-list-folders
Mar 24, 2026
Merged

Add folder name to config list output#44
padak merged 3 commits into
mainfrom
fix/config-list-folders

Conversation

@padak

@padak padak commented Mar 24, 2026

Copy link
Copy Markdown
Member

Summary

Resolves #36

Adds folder field to kbagent config list output by fetching KBC.configuration.folderName metadata from the Storage API search endpoint.

How it works

  1. New client method list_config_folder_metadata(branch_id) calls GET /v2/storage/branch/{id}/search/component-configurations?metadataKeys[]=KBC.configuration.folderName&include=filteredMetadata
  2. Returns a map of "{component_id}/{config_id}" -> folder_name
  3. Config service fetches default branch ID (required — search endpoint is branch-only route) and merges folder names into each config entry
  4. Graceful fallback: if the search endpoint fails, folder is empty string

Bug fix in second commit: The search endpoint returns 404 without branch prefix. Now always resolves default branch ID from dev-branches API.

Tested on real project

kbagent config list --project padak-2-0 --component-type transformation

Shows folder=Test for "Padak" transformation — matches Keboola UI.

Test plan

  • All 1045 tests pass, lint clean
  • Tested on real project with folder "Test" — correctly displayed
  • Projects without folders show empty string (graceful)

Resolves #36. Fetches KBC.configuration.folderName metadata via
search/component-configurations endpoint and adds 'folder' field
to config list output (JSON and human table).

Graceful fallback: if metadata search fails, folder is empty string.
padak added 2 commits March 24, 2026 18:49
The /search/component-configurations endpoint is branch-only (returns 404
without branch prefix). Now fetches default branch ID from dev-branches
API when no active branch is set. Also makes branch_id required in
list_config_folder_metadata() to prevent silent failures.
@padak
padak merged commit b734317 into main Mar 24, 2026
1 check passed
@padak
padak deleted the fix/config-list-folders branch March 26, 2026 11:44
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.

config list does not expose transformation folder names

1 participant