Skip to content

Conversation

@LucioFranco
Copy link
Contributor

@LucioFranco LucioFranco commented Nov 17, 2025

Note

Introduces a moose doctor CLI to run infrastructure diagnostics with severity/time/component filtering, JSON/human output, verbosity, and telemetry, plus E2E coverage.

  • CLI:
    • Add Commands::Doctor with --severity, --component (glob), --since, --json, -v/-vv/-vvv, --clickhouse-url, --redis-url.
    • Wire into top_command_handler to execute diagnostics and capture usage.
  • Diagnostics Routine (apps/framework-cli/src/cli/routines/doctor.rs):
    • Parse severity and human time (humantime) and optional glob pattern via glob.
    • Load InfrastructureMap from Redis; filter components; build DiagnosticRequest and run ClickHouse diagnostics.
    • Support JSON output and human-readable formatting with verbosity-controlled details and summary.
  • Telemetry:
    • Add ActivityType::DoctorCommand and capture usage for the new command.
  • Tests (E2E) (apps/framework-cli-e2e/test/cli-doctor.test.ts):
    • Cover defaults, JSON output, severity filtering, verbosity levels, component filtering, --since, combined options, and invalid inputs.
  • Dependencies:
    • Add glob crate to CLI.

Written by Cursor Bugbot for commit 4bb5979. This will update automatically on new commits. Configure here.

Created using jj-spr 1.3.6-beta.1
@linear
Copy link

linear bot commented Nov 17, 2025

@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Nov 17, 2025 9:44pm
framework-docs Ready Ready Preview Comment Nov 17, 2025 9:44pm

// Show summary
let error_count = output.summary.by_severity.get("Error").unwrap_or(&0);
let warning_count = output.summary.by_severity.get("Warning").unwrap_or(&0);
let info_count = output.summary.by_severity.get("Info").unwrap_or(&0);
Copy link

Choose a reason for hiding this comment

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

Bug: Severity summary keys use wrong case format

The format_human_readable_output function queries by_severity HashMap using capitalized keys ("Error", "Warning", "Info"), but DiagnosticOutput::new stores them as lowercase ("error", "warning", "info"). This causes get() to always return None, and the summary always displays 0 issues regardless of actual findings.

Fix in Cursor Fix in Web

details: format!("Failed to setup redis client: {:?}", e),
})
})?
};
Copy link

Choose a reason for hiding this comment

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

Bug: Redis URL parameter ignored regardless of input

The redis_url parameter is accepted via CLI but never actually used. Both the if and else branches call setup_redis_client(project.clone()), ignoring the provided redis_url. Users passing the --redis-url flag will have it silently discarded and the project's Redis config used instead, which violates the principle of least surprise.

Fix in Cursor Fix in Web

Copy link
Contributor

@onelesd onelesd left a comment

Choose a reason for hiding this comment

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

should add the command to the framework-docs and framework-docs-v2

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.

3 participants