Skip to content

Add startup and Kubernetes monitoring support#25

Merged
utkarsh232005 merged 1 commit into
KDM-cli:mainfrom
utkarsh232005:main
Jun 1, 2026
Merged

Add startup and Kubernetes monitoring support#25
utkarsh232005 merged 1 commit into
KDM-cli:mainfrom
utkarsh232005:main

Conversation

@utkarsh232005
Copy link
Copy Markdown
Member

@utkarsh232005 utkarsh232005 commented Jun 1, 2026

Summary

  • add startup flow behavior and dashboard updates
  • add Kubernetes resource and monitoring modules
  • add plugin/storage support used by the new UI surfaces

Validation

  • cargo fmt -- --check
  • cargo test
  • cargo clippy --all-targets -- -D warnings

Summary by CodeRabbit

Release Notes

  • New Features
    • Full Kubernetes resource management – list, view, and manage pods, deployments, services, configmaps, secrets, ingress, and events
    • Health monitoring snapshots tracking Docker, Kubernetes, and registry status
    • Command history and project cache persistence for tracking actions
    • Enhanced plugin discovery and loading from configuration directories
    • Improved project refresh capabilities and refined command execution workflows

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces comprehensive Kubernetes resource management, a rebuilt plugin system with YAML manifest support, observability infrastructure for health and logs aggregation, and refactors the dashboard to support pluggable action execution. The changes span kubectl command wrappers, storage persistence, plugin discovery, monitoring snapshots, and UI action flows.

Changes

Kubernetes and Container Operations

Layer / File(s) Summary
Kubectl Command Wrapper and Module Infrastructure
src/kubernetes/command.rs, src/kubernetes/mod.rs
Foundation for all kubectl operations: run_kubectl executes commands with error context, non_empty_lines filters output, kubectl_list constructs resource queries.
Kubernetes Resource Modules (ConfigMaps, Deployments, Ingress, Namespaces, Secrets, Services)
src/kubernetes/{configmaps,deployments,ingress,namespaces,secrets,services}.rs
List and get operations for six resource types with whitespace-delimited output parsing. Each module extracts name and metadata fields (e.g., ready, host) with sensible defaults when columns are missing.
Kubernetes Events, Pods, and Pod Operations
src/kubernetes/{events,pods}.rs
Pod list/get/delete/logs with optional tail argument; event listing with reason and message extraction; logs returned as trimmed non-empty lines.
Configuration Paths and YAML-Backed Storage
src/config/paths.rs, src/storage/sqlite.rs
New path helpers for command_history.yaml and project_cache.yaml. CommandHistoryStore records actions newest-first (capped at 100), ProjectCacheStore manages project roots newest-first (capped at 50), both with load/save and parent directory creation.

Plugin System Redesign and Manifest Loading

Layer / File(s) Summary
Plugin Registry and Definition Structures
src/plugins/registry.rs
PluginRegistry redesigned to hold structured PluginDefinition entries (with name, capabilities, menus) instead of plain name strings. PluginMenu includes id, label, and screen field. Registry provides names() and register() with deduplication and alphabetical ordering.
Plugin Manifest Loading and Manager
src/plugins/{loader,manager,traits}.rs
load_from_dir() reads YAML/YML manifests from the configured plugins directory, parses into PluginDefinition, registers into PluginRegistry. load_installed() delegates to load_from_dir with fallback to empty registry. PluginManager provides load() and capabilities() aggregator. menu_items_from_registry() flattens plugin menus into MenuItem items.

Monitoring and Observability Infrastructure

Layer / File(s) Summary
Health Reporting and Log Aggregation
src/monitoring/{health,logs}.rs
HealthReport contains docker/kubernetes/registry status fields; overall() computes roll-up by priority (Critical > Warning > Unknown > Healthy). from_runtime() maps runtime flags to statuses. docker_logs(), compose_logs(), pod_logs() aggregate logs from multiple sources with standardized source labels.
Kubernetes Event Mapping and Monitoring Snapshot
src/monitoring/{events,metrics}.rs
kubernetes_events() maps each Kubernetes event to MonitoringEvent combining reason and message. MonitoringSnapshot struct bundles health, metrics (via ResourceMetrics::empty()), logs, and events. snapshot() function constructs snapshots from runtime and provided logs/events.

Application State, Dashboard, and Startup Integration

Layer / File(s) Summary
App State Runtime Refresh and Interactive Startup
src/app/state.rs, src/main.rs
AppState::refresh_runtime() re-detects runtime and regenerates menus/actions. interactive_startup_options() forces force_first_launch: true in CLI default path, replacing prior cli.first_launch logic.
Dashboard Action Execution and Project Refresh
src/ui/dashboard.rs
Refactors command palette and route_action to delegate to execute_action(), which navigates to screen, executes via KdcExecutor, updates status, displays output, and pushes success/warning notifications. refresh_project() reinitializes AppState while preserving theme and restarts scanning. Esc clears execution output; navigation keys clear before moving.
Extended kubectl Mock Support
src/utils/test_support.rs
Expands KUBECTL_SCRIPT to mock deployments, pods, services, ingress, configmaps, secrets, namespaces, events, plus logs, delete, and scale operations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐳 Kubectl commands now flow through Rust's safe hands,
Plugins load from YAML files across the lands,
Health and logs converge in monitoring's light,
Dashboard actions execute with dashboard delight,
Yet parse those columns—watch the spaces right! 📊

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.99% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the primary changes: startup flow behavior and Kubernetes monitoring support are clearly the main focus of this multi-module PR.
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

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.

Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Choose a reason for hiding this comment

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

Our agent can fix these. Install it.

Gates Passed
3 Quality Gates Passed

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

@utkarsh232005 utkarsh232005 merged commit 03ad195 into KDM-cli:main Jun 1, 2026
2 of 4 checks passed
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