Skip to content

Phase 3: Configuration listing (config service, CLI commands)#3

Merged
padak merged 1 commit into
mainfrom
phase-3-configs
Feb 26, 2026
Merged

Phase 3: Configuration listing (config service, CLI commands)#3
padak merged 1 commit into
mainfrom
phase-3-configs

Conversation

@padak
Copy link
Copy Markdown
Member

@padak padak commented Feb 26, 2026

Implementation Summary

Implements Phase 3 of the Keboola Agent CLI: multi-project configuration listing and detail retrieval. Adds a full ConfigService business logic layer, replaces config command stubs with real Typer CLI commands, adds Rich table output formatters, and wires everything into the CLI context.

Key changes:

  • config_service.py (NEW): ConfigService with resolve_projects(), list_configs(), get_config_detail() - supports multi-project aggregation with per-project error handling
  • commands/config.py (REPLACED): Full implementation of config list and config detail with filtering, error handling, and dual output modes
  • output.py (EXTENDED): format_configs_table() for Rich tables grouped by project, format_config_detail() for detail panels, warning() method
  • cli.py (EXTENDED): Wire ConfigService into ctx.obj

Acceptance Criteria

  • config list --json returns configs from all projects
  • config list --project X returns configs from one project
  • config list --project X --project Y returns from both
  • config list --component-type extractor filters by type
  • config list --component-id X filters by component
  • config list human mode shows Rich table grouped by project
  • config detail --project X --component-id Y --config-id Z returns detail
  • Partial failure: one project errors, others continue
  • Unknown alias returns exit code 5

Tests

  • uv run pytest tests/ -v - 151 passed (114 existing + 37 new)

New test classes:

  • TestConfigServiceListConfigs (13 tests): multi-project aggregation, type filtering, component_id filtering, partial failure, empty results, unknown alias, client cleanup
  • TestConfigServiceGetConfigDetail (4 tests): success, unknown alias, API error, client cleanup on error
  • TestResolveProjects (4 tests): all projects, specific aliases, unknown alias, empty list
  • TestConfigList (11 tests): JSON output, human output, project filter, multiple projects, type filter, component_id filter, unknown alias exit code 5, partial failure (JSON + human), empty results, invalid component type exit code 2
  • TestConfigDetail (5 tests): JSON output, human output, unknown alias exit code 5, API error exit code, auth error exit code 3

Files Changed

  • src/keboola_agent_cli/services/config_service.py (NEW)
  • src/keboola_agent_cli/commands/config.py (REPLACED stubs)
  • src/keboola_agent_cli/output.py (EXTENDED)
  • src/keboola_agent_cli/cli.py (EXTENDED)
  • tests/test_services.py (EXTENDED)
  • tests/test_cli.py (EXTENDED)

…formatter)

Implement multi-project configuration listing and detail retrieval:

- Add ConfigService with resolve_projects(), list_configs(), get_config_detail()
- Replace config command stubs with full Typer implementation
- Add Rich table formatter grouped by project alias
- Add config detail panel with configuration parameters display
- Wire ConfigService into CLI context
- Per-project errors collected without stopping other projects
- Component type and component ID filtering support
- 37 new tests covering service logic, CLI commands in JSON/human modes,
  partial failures, filtering, and exit codes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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