fix(hooks): run pre-commit cargo in builder image, not runtime app #42
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pre-commit-clean-clone"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On a fresh clone
just pre-commithung until killed instead of running checks. The recipe ran cargo viadocker compose -f compose.dev.yml run --rm --no-deps app ..., but the composeappservice builds the production runtime stage ofoci-build/Dockerfile(FROM alpine:3.21,ENTRYPOINT ["/app/app"], no cargo toolchain). Eachcargo ...argument list was passed to the rus server entrypoint, which ignores it and boots Actix on0.0.0.0:4001. The very first step (cargo fmt --check) started the server and never returned. This is theruscase of DEV-370 (pre-commit not clean-clone-safe).Fix
Run the pre-commit checks against the
rust-builder-muslimage (the same builder base the Dockerfile uses), with the working tree and per-user cargo caches mounted, mirroring the working pattern inmokosh-apps. Test secrets are injected with--env, so no.env/ensure-envis needed and the hook is self-contained on a clean clone. Checks unchanged: fmt, clippy (standalone + saas), build (standalone + saas),test --lib(standalone + saas).Verification
just pre-commiton a clean tree completes green: fmt + clippy + build for both feature sets, 179 standalone unit tests and 111 saas unit tests pass, no server boot.#DEV-370