Files
git.stella-ops.org/docs/features/unchecked/cli/advisory-database-status-and-connector-cli-commands.md

2.9 KiB

Advisory Database Status and Connector CLI Commands

Module

Cli

Status

IMPLEMENTED

Description

CLI commands stella db status and stella db connectors for checking advisory database health, connector status, sync timestamps, and reason codes for connector failures.

Implementation Details

  • Command Group: src/Cli/StellaOps.Cli/Commands/DbCommandGroup.cs -- DbCommandGroup (static class)
  • Commands:
    • stella db status -- checks database connectivity, schema version, migration status, connection pool (via /api/v1/health/database). Options: --format text|json, --server <url>, --verbose.
    • stella db connectors list -- lists configured advisory connectors with category/status/last-sync/error-count/reason-code. Options: --format table|json, --category <cat>, --status <status>.
    • stella db connectors status -- shows health status summary for all connectors.
    • stella db connectors test <connector> -- tests connectivity for a specific connector (DNS, TLS, auth, API request). Options: --format text|json, --timeout <duration>.
  • DTOs: DbStatusResponse, ConnectionPoolStatus, ConnectorInfo, ConnectorStatus, ConnectorTestResult, ConnectorTestStep (all nested in DbCommandGroup).
  • Supported connectors: nvd, cve, ghsa, osv, alpine, debian, ubuntu, redhat, suse, kev, epss, msrc, cisco, oracle.
  • Exit codes: 0 = healthy/passed, 1 = error/failed.
  • Sprint: SPRINT_20260117_008_CLI (tasks ASC-002 through ASC-005).

E2E Test Plan

  • Run stella db status and verify output shows Connection, Database Type, Version, Latency, Schema, Migration status
  • Run stella db status --format json and verify valid JSON with connected, databaseType, schemaVersion, migrationStatus fields
  • Run stella db status --verbose and verify Connection Pool section appears (Active, Idle, Total)
  • Run stella db connectors list and verify table with all 14 connectors showing Name, Category, Status, Last Sync, Errors, Reason Code
  • Run stella db connectors list --category distro and verify only distro connectors shown (alpine, debian, ubuntu, redhat, suse)
  • Run stella db connectors list --status failed and verify only failed connectors shown
  • Run stella db connectors list --format json and verify valid JSON array output
  • Run stella db connectors status and verify health summary table with healthy/degraded/failed counts
  • Run stella db connectors test nvd and verify test steps (DNS Resolution, TLS Handshake, Authentication, API Request) with pass/fail and latency
  • Run stella db connectors test nvd --format json and verify JSON output with passed, latencyMs, tests array
  • Run stella db connectors test nvd --timeout 00:00:01 and verify timeout handling with reason code CON_TIMEOUT_001
  • Verify exit code is 1 when database is disconnected or connector test fails