Repository navigation
Closed
Labels
Description
Overview
Remove dead code from the Docker Compose template that handles an impossible configuration state: Grafana enabled without Prometheus. This template branch can never be executed because environment validation should reject this configuration. The code misleads readers into thinking this is a valid configuration.
Problem
The template has an {%- else %} branch for when Grafana is enabled but Prometheus is NOT:
grafana:
depends_on:
{%- if prometheus %}
prometheus:
condition: service_healthy
{%- else %}
- tracker # <-- This branch handles an INVALID case
{%- endif %}Why it's a bug
- Grafana requires Prometheus as its data source - it has no purpose without it
- The environment creation should fail validation if
grafana.enabled = trueandprometheus.enabled = false - This template branch can NEVER be reached in valid configurations
- The code is dead code that misleads readers into thinking this is a valid configuration
Goals
- Verify environment validation rejects
grafana.enabled && !prometheus.enabled - Remove the dead
{%- else %}branch from the Docker Compose template - Simplify template to always use Prometheus dependency when Grafana is enabled
Expected Template State After Fix
grafana:
depends_on:
prometheus:
condition: service_healthySince Grafana can only exist when Prometheus exists (enforced by validation), no conditional is needed.
Implementation Plan
- Verify Validation - Search codebase for existing validation of Grafana/Prometheus relationship
- Remove Dead Code - Edit
templates/docker-compose/docker-compose.yml.terato remove the{%- else %}branch - Verification - Run linters and E2E tests
Acceptance Criteria
- Pre-commit checks pass:
./scripts/pre-commit.sh - Dead
{%- else %}branch removed from Grafanadepends_onsection - Validation exists that rejects
grafana.enabled && !prometheus.enabled - No regression in generated docker-compose.yml for valid configurations
- E2E tests pass
Related
- Parent Epic: [Epic] Docker Compose Topology Domain Model Refactoring #287
- Refactoring Plan: docs/refactors/plans/docker-compose-topology-domain-model.md
- Issue Specification:
docs/issues/XXX-remove-invalid-grafana-without-prometheus-template-branch.md
Activity
docs: add issue specification for #290 (BUG-01)
fix: [#290] remove dead Grafana-without-Prometheus template branch
chore: remove closed issue documentation files