mini-platform-control-plane/docs/milestones.md

158 lines
2.7 KiB
Markdown

# Milestones
## 1. Domain Model
Objective: define environments, workloads, operations, statuses, and typed
validation errors.
Go concepts:
- packages
- structs
- methods
- constants
- wrapped errors
- table-driven tests
Files:
- `internal/domain/environment.go`
- `internal/domain/workload.go`
- `internal/domain/operation.go`
- `internal/domain/errors.go`
- `internal/domain/*_test.go`
Tests:
- environment validation
- workload validation
- operation status validation
- `errors.Is` behavior for sentinel errors
Done when:
- `go test ./...` passes
- invalid domain objects return useful wrapped errors
## 2. In-Memory Storage
Objective: add storage interfaces and a concurrency-safe memory implementation.
Go concepts:
- interfaces
- `sync.RWMutex`
- context propagation
- idempotent create/delete
- storage contract tests
## 3. Application Services
Objective: add use cases that coordinate storage and provider interfaces.
Go concepts:
- dependency injection
- small interfaces
- context cancellation
- business error mapping
## 4. gRPC API
Objective: expose environment and workload APIs over gRPC.
Go concepts:
- protobuf contracts
- generated Go code
- gRPC handlers
- gRPC status errors
- bufconn tests
## 5. CLI `mpctl`
Objective: add Cobra commands backed by the gRPC client.
Go concepts:
- command construction
- Viper config loading
- command tests
- output formatting
## 6. Workload Deployment Path
Objective: deploy workloads using a fake cloud provider and idempotency keys.
Go concepts:
- retries
- cancellation
- interface mocks
- retryable vs permanent errors
## 7. Temporal Workflows
Objective: move long-running create/delete/deploy operations into workflows.
Go concepts:
- workflow determinism
- activities
- Temporal test environment
- cancellation
## 8. Helm And Kubernetes Adapters
Objective: render workload manifests and apply them through a fake Kubernetes
client, then later a real one.
Go concepts:
- adapter boundaries
- YAML/object validation
- interface-driven tests
## 9. Observability
Objective: add structured logs, Prometheus metrics, and OpenTelemetry traces.
Go concepts:
- `log/slog`
- metrics labels
- trace/span propagation
- observability tests
## 10. MongoDB Storage
Objective: add a MongoDB implementation behind the same storage interfaces.
Go concepts:
- integration tests
- serialization
- repository contract reuse
## 11. Local End-to-End Test
Objective: run the API, worker, and local dependencies together.
Go concepts:
- black-box tests
- process orchestration
- test fixtures
## 12. Kubernetes Deployment
Objective: package and deploy into `kind` or `k3d`, then later the homelab
cluster.
Go concepts:
- container builds
- runtime config
- readiness checks
- Helm chart values