Harden script/default_appraisal_zeitwerk_check (WA-VERIFY-082)#1074
Harden script/default_appraisal_zeitwerk_check (WA-VERIFY-082)#1074kitcommerce wants to merge 1 commit intonextfrom
Conversation
- Replace bare cd+cd pattern with subshell per engine so directory changes are isolated and set -e failures cannot corrupt the working dir - Add Redis readiness wait (timeout 60) before running checks to avoid false negatives when Redis is still initialising in CI - Set RAILS_ENV=test explicitly in all zeitwerk:check invocations - Expand coverage from core-only to all three engines (core, admin, storefront) each via their own test/dummy app Fixes #1068
🤖 Wave 1 Automated Review — PR #1074Architecture —
|
Wave 2 Review Resultsrails-security: PASS — CI/local script hardening only. Wave 2 PASSED. |
kitcommerce
left a comment
There was a problem hiding this comment.
Wave 3 reviews (performance / frontend / accessibility)
{"reviewer":"performance","verdict":"PASS","severity":null,"summary":"Build/CI script hardening only; no runtime performance impact.","findings":[]}{"reviewer":"frontend","verdict":"PASS","severity":null,"summary":"No frontend changes.","findings":[]}{"reviewer":"accessibility","verdict":"PASS","severity":null,"summary":"No accessibility changes.","findings":[]}
kitcommerce
left a comment
There was a problem hiding this comment.
Wave 4 (documentation) review
PASS — Script change is self-documenting via inline comments; no additional docs required.
|
|
|
|
|
|
Fixes #1068
Summary
Three hardening improvements to
script/default_appraisal_zeitwerk_check:Subshell pattern for engine loops — replaced the previous single
cd "$ROOT_DIR/core/test/dummy"(bare directory change in the parent shell) with an explicit loop over all three engines (core,admin,storefront), each run in its own subshell(cd "$engine/test/dummy" && RAILS_ENV=test bin/rails zeitwerk:check). This isolates directory changes and preventsset -efailures from leaving the shell in an unexpected directory.Redis readiness wait — added
timeout 60 bash -c 'until redis-cli ping > /dev/null 2>&1; do sleep 2; done'before the checks run, so the script no longer fails with spurious connection errors when Redis is still starting up in CI.Explicit
RAILS_ENV=test— both therbenv execand plainbin/railscode paths now setRAILS_ENV=testinline rather than relying on the ambient export, making intent unambiguous.Coverage expanded: previously only
core/test/dummywas checked. Now all three engine dummy apps are verified, with a graceful SKIP if a dummy directory is absent.Client Impact
None — CI-only script. No application code, APIs, or public interfaces changed.