TBD54566975 / web5-rs

Core components of the Web5 platform
Apache License 2.0
19 stars 16 forks source link

Implement Post-Installation Verification for Web5 CLI #388

Open blackgirlbytes opened 1 month ago

blackgirlbytes commented 1 month ago

Implement Post-Installation Verification for Web5 CLI

🚀 Goal

Create a post-installation verification process for the Web5 CLI to ensure it's correctly installed and configured, and all dependencies are properly set up.

🔑 Tasks

🌟 Resources

âš¡ Getting Started

  1. Comment ".take" on this issue to get assigned
  2. Fork the repository and create a new branch for this task
  3. Implement the post-installation verification functionality
  4. Write tests for your implementation
  5. Update documentation to include the new doctor command
  6. Submit a pull request with your changes
  7. Respond to any feedback during the review process

Implementation Ideas

  1. Use a struct to represent the state of various checks:
struct HealthCheckState {
    cli_version: Option<String>,
    dependencies: HashMap<String, bool>,
    env_vars: HashMap<String, bool>,
    connectivity: bool,
    basic_functionality: bool,
}
  1. Implement a function to run all checks:
fn run_health_checks() -> HealthCheckState {
    let mut state = HealthCheckState::new();

    state.cli_version = check_cli_version();
    state.dependencies = check_dependencies();
    state.env_vars = check_environment_variables();
    state.connectivity = check_connectivity();
    state.basic_functionality = test_basic_functionality();

    state
}
  1. Provide detailed output for failed checks:
fn print_health_check_results(state: &HealthCheckState) {
    println!("Web5 CLI Health Check Results:");
    println!("CLI Version: {}", state.cli_version.as_ref().unwrap_or(&"Unknown".to_string()));

    for (dep, status) in &state.dependencies {
        println!("Dependency {}: {}", dep, if *status { "OK" } else { "FAILED" });
    }

    // ... print other results ...

    if !state.basic_functionality {
        println!("Basic functionality test failed. Please check the logs for more information.");
    }
}

💭 Questions?

If you have any questions or need clarification, please comment on this issue or join our Discord community.

Happy coding! 🎉

Harshil-Jani commented 1 month ago

.take

github-actions[bot] commented 1 month ago

Thanks for taking this issue! Let us know if you have any questions!