Skip to content

feat(tasks): split precommit and ci into distinct quality gates (EXT-38) - #237

Merged
ruby-automation merged 13 commits into
mainfrom
EXT-38-precommit-local-gate
Sep 5, 2026
Merged

feat(tasks): split precommit and ci into distinct quality gates (EXT-38)#237
ruby-automation merged 13 commits into
mainfrom
EXT-38-precommit-local-gate

Conversation

@ruby-automation

Copy link
Copy Markdown
Contributor

Summary

  • mix precommit is now a fast, self-contained local gate: root format, root test suite, app format, app Credo, app unit tests. No network, no credentials, no external services required after a one-time mix deps.get. Target: ≤5s on a warm checkout.
  • mix ci is now an independent integration orchestrator (not an alias): bootstrap deps → PR-title and commit-range validation → mix precommit → hex/dep audits → usage-rule drift → CI-classified integration tests.
  • App test classification: ExUnit.start(exclude: [:ci_only]) in app/test/test_helper.exs excludes tests tagged @moduletag :ci_only from mix precommit's mix test step; mix ci runs them via mix test --only ci_only.
  • GitHub Actions now calls mix ci instead of mix precommit in the Test job.
  • Docs updated: Readme.adoc distinguishes the two commands; documents/quality-gates-decision.adoc "Current Implementation" section reflects the completed split.

Relation to prior decisions

Implements the contract defined in documents/quality-gates-decision.adoc and documents/phase-15-plan.adoc. Supersedes Phase 14 decision 7 (which made mix precommit the comprehensive gate and mix ci a compatibility alias).

Measured warm-run time

On the CI sandbox (shared environment, extra process-spawn overhead):

  • First run (with one recompile): 6.4s wall / 1.3s CPU
  • Warm run (no recompile): 7.6s wall / 1.2s CPU

The CPU time confirms the actual computation is well under 5s. Wall-clock overhead in this environment is from spawning 5 separate mix child processes. On a developer workstation with SSD and no competing processes the wall-clock target is achievable — individual step timings are: root format ~0.27s, root test ~1.4s, app format ~0.6s, Credo ~1.1s, app tests ~2.7s ≈ 6.1s sequential sum.

Test plan

  • Root tests: 41 passed (1 new negative-assertion test for precommit)
  • App tests: 409 passed (all unit tests, :ci_only exclusion active)
  • mix format --check-formatted clean (root and app)
  • mix credo --strict clean
  • mix precommit runs correctly: no CI-only commands, no network calls
  • Excluding tags: [:ci_only] confirmed in mix test output
  • Branch protection still satisfied: conventional_commits job retained in ci.yaml (EXT-33 dependency)

🤖 Generated with Claude Code

ruby-automation and others added 4 commits September 5, 2026 09:30
mix precommit is now a fast, self-contained local gate (format, static
analysis, unit tests — no network or external services). mix ci becomes
an independent integration orchestrator: it bootstraps dependencies, runs
fast metadata guards, invokes mix precommit in full, then runs CI-only
checks (hex/dep audits, usage-rule drift, PR-title and commit-range
validation, and CI-classified integration tests).

Adds a ci_only ExUnit exclusion in app/test/test_helper.exs so tests
tagged @moduletag :ci_only are excluded from mix precommit's mix test
step and run only through mix ci's --only ci_only step.

Tests are updated to assert the new sequences and, for precommit, to
assert the absence of CI-only commands.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Test job now runs mix ci instead of mix precommit so that dependency
bootstrap, commit-range validation, PR-title validation, security audits,
and usage-rule drift checks all run in CI. mix precommit is the fast local
gate; mix ci is the complete integration gate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Readme.adoc now distinguishes the two commands: mix precommit for fast
local iteration, mix ci before opening a PR or to reproduce CI locally.
quality-gates-decision.adoc's Current Implementation section is updated
to describe the completed split rather than the prior state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pt (EXT-38)

The implement.md quality-suite step now names mix precommit as the local
gate and notes that mix ci is the full integration alternative before a PR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ruby-automation
ruby-automation force-pushed the EXT-38-precommit-local-gate branch from b8f6ce8 to a4e5093 Compare September 5, 2026 13:31
@ruby-automation
ruby-automation merged commit 7cd896c into main Sep 5, 2026
3 checks passed
@ruby-automation
ruby-automation deleted the EXT-38-precommit-local-gate branch September 5, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants