Skip to content

Create Detection Logic Package #114

@josecelano

Description

@josecelano

Parent Issue: #113 - Create Dependency Installation Package for E2E Tests
Depends On: None (first phase)
Epic: #112 - Refactor and Improve E2E Test Execution

Overview

Create the package structure and implement detection logic to check if development dependencies (cargo-machete, OpenTofu, Ansible, LXD) are installed.

This is Phase 1 of 4 for building the dependency installation package.

Objectives

  • Create packages/dependency-installer/ structure following packages/linting/ pattern
  • Define ToolDetector trait for detection abstraction
  • Implement 4 detector structs (CargoMachete, OpenTofu, Ansible, LXD)
  • Create DependencyManager to coordinate detectors
  • Add comprehensive unit tests with mocked commands
  • Set up tracing for observability

Key Components

ToolDetector Trait:

trait ToolDetector {
    fn name(&self) -> &str;
    fn is_installed(&self) -> Result<bool, DetectionError>;
}

4 Detector Implementations:

  • CargoMacheteDetector - checks cargo machete --version
  • OpenTofuDetector - checks tofu --version
  • AnsibleDetector - checks ansible --version
  • LxdDetector - checks lxc --version

DependencyManager:

  • Coordinates all detectors
  • Provides check_all() method returning status for all tools

Acceptance Criteria

  • Pre-commit checks pass
  • Package structure follows linting package pattern
  • ToolDetector trait is well-defined
  • All 4 detectors are implemented with proper error handling
  • DependencyManager works correctly
  • Unit tests cover all detectors with mocked commands
  • Logging provides clear visibility

Time Estimate

2-3 hours

Related Documentation

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions