Skip to content

[Refactor] Phase 1: Create Network Domain Types (P1.1, P1.2) #294

Description

@josecelano

Overview

This task creates domain types for Docker Compose networks and migrates service configurations from Vec<String> to type-safe Vec<Network>. This is PR 4 in the 5-PR refactoring strategy.

Parent Epic: #287

Goals

  • Create type-safe Network enum to eliminate string-based network references
  • Migrate all service configs to use domain network types
  • Establish foundation for Phase 2 (automatic network derivation)

Implementation

P1.1: Create Network Domain Type

Create Network enum in src/domain/deployment/topology/network.rs:

  • Database - Tracker ↔ MySQL
  • Metrics - Tracker ↔ Prometheus
  • Visualization - Prometheus ↔ Grafana
  • Proxy - Caddy ↔ backend services

P1.2: Migrate Service Configs

Update all service configs to use Vec<Network> instead of Vec<String>:

  • TrackerServiceConfig
  • MysqlServiceConfig
  • PrometheusServiceConfig
  • GrafanaServiceConfig
  • CaddyServiceConfig

Specification Document

See docs/issues/phase-1-network-domain-types.md for:

  • Detailed code examples
  • Unit test requirements
  • Implementation checklist

Acceptance Criteria

  • Pre-commit checks pass: ./scripts/pre-commit.sh
  • Network enum exists with all four variants
  • All service configs use Vec<Network> instead of Vec<String>
  • Generated docker-compose.yml is identical to before refactoring
  • Unit tests cover all network assignment rules

Related

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions