feat(hooks): run stop-run-checks inside a docker-compose service (dogfood F3) - #91
Conversation
…KS entry names one Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… service field; changelog Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
VERDICT: COMMENT-ONLY PR adds an optional 3rd Advisory
The exec branch at line 126 explicitly passes run_cmd="$cc exec -T ${service} ${cmd}" # line 126 — -T present
run_cmd="$cc run --rm ${service} ${cmd}" # line 128 — -T absent
Test case A run_hook FAKE_SERVICES="backend frontend" FAKE_RUNNING="" >/dev/null
grep -q "run --rm backend" "$DOCKER_LOG" \
|| { echo "FAIL A: ..."; exit 1; }
|
…t-A log assert (PR #91 review) Three non-blocking review advisories: (1) add -T to the run-branch for symmetry with exec and to suppress a 'not a TTY' line in the report on compose < v2.2.0; (2) hoist the compose() probe to a single $CC before the loop instead of once per container-bound check; (3) touch $DOCKER_LOG in the test's run_hook so an unexpected skip yields FAIL A, not a grep file-not-found. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
VERDICT: COMMENT-ONLY PR #91 adds a 3rd Advisoryconfigure.py:1083 — warning example is Python-flavored for a stack-agnostic path test/stop-run-checks/test-container-checks.sh:56,62 — negative tests (C, D) pass vacuously on hook crash |
What
F3 from the container dogfood (deferred from #88/#89). A containerized project's check loop no-op'd because the toolchain lives in the image, not on the host PATH — F2 (#89) warned about it; this makes it run.
Change
A
CHECKSentry instop-run-checks.shgains an optional 3rd field —label|command|service. When a service is named, the Stop hook runs the check inside it:docker compose exec -T <svc> <cmd>if the service is up, elsedocker compose run --rm <svc> <cmd>— a throwaway instance of the existing service (no new container, no host rebuild, no path translation).The host-PATH/manifest guards are bypassed for container checks. Fail-open: no
docker/docker compose, or an undefined service → skip silently (stderr note); a non-zero container exit → reported as a normal check FAIL. Two-fieldlabel|commandentries — including host commands containing a literal|— are unchanged (an entry is container-bound only when it has ≥2 pipes and a bare-token final field, soeslint . | tee logstays host-side). The F2[ STACK WARNINGS ]note now points at this field.Tests
New
test/stop-run-checks/test-container-checks.shvia a PATH-prependeddockerstub: run-vs-exec by service state, skip when compose/service absent, FAIL on non-zero exit, and 2-field stays host-side.configure.py --checkclean; 106/106 fixtures; 5/5 persona snapshots (the template content change adds no files).Scope
One
feat(no fix+feat mix, perCONTRIBUTING.md:43). Deferred follow-up: a conditional intake field that detectsdocker-compose.ymland pre-populates the service per check (this format is the substrate). Notested_up_to/CC_VERSIONbump.🤖 Generated with Claude Code