test: add Docker Compose healthcheck audit and enforcement#376
test: add Docker Compose healthcheck audit and enforcement#376bugman-007 wants to merge 2 commits intoLight-Heart-Labs:mainfrom
Conversation
Lightheartdevs
left a comment
There was a problem hiding this comment.
Review: Compose Healthcheck Audit
Script is well-structured and categorization logic is solid. A few issues to fix.
CLAUDE.md violation: 2>/dev/null
audit-compose-healthchecks.sh lines 50, 72, 77 — find and grep suppress stderr. CLAUDE.md rule 4 forbids this. Let errors surface or use explicit handling.
CLAUDE.md violation: || true in test
test-compose-healthcheck-audit.sh line 109 — Test #9 uses if [[ -x ... ]] || true; then pass. Always passes. Dead test. Violates both the || true ban and "let assertions fail visibly" rule.
Tests are structural, not behavioral
All 9 tests run the audit against the real repo and check for expected strings. None create temp compose files to verify detection/classification behavior. One fixture-based test with a known compose file (with and without healthcheck) would make these genuinely behavioral.
Bug: \s not portable to macOS
Line 72: grep -q "^services:\s*{}\s*$" uses \s which is PCRE, not supported in macOS grep's basic regex. CLAUDE.md calls out POSIX compatibility. Use [[:space:]] or grep -E.
CI conflict
PRs #373, #375, and #376 all insert CI steps at the same location in test-linux.yml. Whichever merges first conflicts with the others.
|
What's needed to get this merged:
Will conflict with #373 and #375 on |
|
I addressed review feedback for compose healthcheck audit |
Summary
scripts/audit-compose-healthchecks.shwith categorization and strict modetests/test-compose-healthcheck-audit.shwith 9 test casesMotivation
Missing healthchecks = degraded observability
Current state:
docker-compose.base.ymlall have healthchecks ✅health-check.shrelies on healthchecks for monitoring ✅This PR provides visibility and a foundation for enforcement.
Audit Results
Scanned 32 compose files across the repository:
Files with healthchecks: 16
❌ Production files without healthchecks: 8
docker-compose.intel.yml- Intel Arc GPU overlaydocker-compose.arc.yml- Intel Arc GPU overlaydocker-compose.amd.yml- AMD GPU overlaydocker-compose.nvidia.yml- NVIDIA GPU overlaydocker-compose.apple.yml- Apple Silicon overlaydocker-compose.tier0.yml- Tier 0 configurationinstallers/windows/docker-compose.windows-amd.yml- Windows installerextensions/services/whisper/compose.nvidia.yaml- Whisper NVIDIA variantdocker-compose.local.ymlcompose.local.yamlfiles in extensionsℹ️ Stub files: 1
extensions/services/comfyui/compose.yaml(empty stub, GPU overlays have healthchecks)Tool Features
scripts/audit-compose-healthchecks.sh
Categorization:
*.local.*files (warnings only)services: {}(informational)Test Coverage
The test suite validates:
--strictflag enforcement works--quietflag reduces outputTest Results
CI Integration
Added "Compose Healthcheck Audit Tests" step to
.github/workflows/test-linux.ymlto run on every PR.Note: Currently runs in audit mode (non-blocking). Can be switched to
--strictmode in future PR once healthchecks are added to identified files.Impact
health-check.shmonitoring effectivenessNext Steps (Future PRs)
--strictmode in CI to enforce healthchecksRelated