feat(hooks): support no-compose CLI repos in common.just #8
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/GOV-39-no-compose-cli-shape"
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?
Makes the no-compose CLI repo shape a first-class, variable-driven option in
common.justso pure-CLI consumers (forgejo-cli, youtrack-cli) can adopt common without shadowing recipes viaset allow-duplicate-recipes(the drift anti-pattern the repoCLAUDE.mdblast-radius rule forbids). Tracks GOV-39; unblocks the forgejo-cli adoption (FJCLI-44).What changed
pre-commitis now a dispatcher on the newpre_commit_modevariable (compose|docker).compose(default) is the existing compose-backed flow, extracted verbatim intopre-commit-compose.dockerruns the same four checks indev_imagevia a baredocker runwith per-user named cargo caches (dev-{{app}}-cargo-{target,registry,git}-<user>), inpre-commit-docker. The four checks live in one place per variant, so the modes cannot drift on WHAT they run.test_argsvariable (default--bins). A workspace with library or integration tests overrides it (e.g.""for the full suite) so those tests are not silently skipped before commit.--binsalone skips lib unit tests, integration tests, and doctests.dev_imagevariable (default""), required only indockermode.rungains*argsand forwards them (cargo run --release -- {{args}}). Backward compatible: existing arg-less callers get a trailing--no-op.dev-cleanis now compose-aware: it runsdocker compose ... downonly whencompose.dev.ymlexists, removes the target/registry/git cargo volume superset (skipping absent ones), and removestarget/anddist/. No mode flag needed.binary_namevariable (defaultapp);build-docker-exportreportsdist/{{binary_name}}for repos whose binary name diverges fromapp.README.mddocuments the compose-vs-no-compose shape selector.Backward compatibility
All new variable defaults (
pre_commit_mode = compose,dev_image = "",test_args = --bins,binary_name = app) preserve today's behavior. da-info, claude-run, and youtrack-cli are unaffected without any justfile edits. youtrack-cli can later drop itspre-commit/run/dev-cleanshadows in favor of these variables (separate change).Validation
just --justfile common.just --listandjust --justfile common.just --evaluateboth succeed; the newpre-commit-dockernushell block was syntax-checked withnu --ide-checkon 0.112.2.common.just assumed every consumer is a compose-backed web service: pre-commit ran its checks via `docker compose ... run app`, dev-clean began with `docker compose ... down`, run was arg-less, and build-docker-export reported dist/{{app}}. No-compose CLI repos (forgejo-cli, youtrack-cli) could only adopt common by shadowing those recipes with `set allow-duplicate-recipes`, which is the drift anti-pattern the repo CLAUDE.md forbids. Make the CLI shape a first-class, variable-driven option so a consumer adapts by setting variables, not by re-forking recipes. pre-commit becomes a dispatcher on the new pre_commit_mode (compose | docker); docker mode runs the same four checks in dev_image via a bare `docker run` with per-user named cargo caches. New test_args (default --bins) lets a workspace with library or integration tests run the full suite instead of silently skipping lib tests. run gains `*args` (backward compatible: arg-less callers get `cargo run --release --`). dev-clean now downs the compose stack only when compose.dev.yml exists and removes the target/registry/git volume superset plus target/ and dist/. build-docker-export reports dist/{{binary_name}}. All defaults (compose, "", --bins, app) preserve current behavior for da-info, claude-run, and youtrack-cli. Document the shape selector in README.md. #GOV-39 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: David Randall <David@NiceGuyIT.biz>