Skip to content

feat: add mix ci task for the complete quality gate - #127

Merged
bougyman merged 2 commits into
mainfrom
CRY-49-mix-ci-task
Aug 16, 2026
Merged

feat: add mix ci task for the complete quality gate#127
bougyman merged 2 commits into
mainfrom
CRY-49-mix-ci-task

Conversation

@bougyman

Copy link
Copy Markdown
Member

Summary

  • Adds Mix.Tasks.Ci (lib/mix/tasks/ci.ex) that runs the four quality gate steps (deps.get, format --check-formatted, usage_rules.sync --check, mix test) sequentially inside app/, failing fast on the first error
  • Updates .github/workflows/ci.yaml to call mix ci instead of the four individual steps — CI and local mix ci now share one code path
  • Adds test/mix/tasks/ci_test.exs verifying the correct sequence of commands is invoked (using an injected shell runner, matching the pattern from lc_test.exs)

Closes CRY-49

Test plan

  • mix compile --warnings-as-errors passes
  • mix format --check-formatted passes
  • mix test passes (12/12, including the new Mix.Tasks.CiTest)
  • CI workflow updated to call mix ci with working-directory: . (repo root), overriding the job's app/ default

🤖 Generated with Claude Code

Adds Mix.Tasks.Ci which runs the same four steps the CI workflow's test
job runs (deps.get, format check, usage_rules.sync check, mix test), all
inside app/. CI now calls `mix ci` instead of the individual steps, so
local and remote checks are always in sync.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bougyman

Copy link
Copy Markdown
Member Author

Code Review

Issue: CRY-49 — Add mix ci task for the complete quality gate
Branch: CRY-49-mix-ci-task
Commit: d703eaf feat: add mix ci task for the complete quality gate

Quality suite

All checks pass on the branch as-is:

  • Compilation (warnings-as-errors): clean
  • mix format --check-formatted: clean
  • mix test: 12/12 passed

Assessment: Approve

Clean, well-scoped implementation that follows the established repo-management task pattern exactly. The code is correct, the CI workflow update is sound, and the test covers the right contract.

What looks good

  • Pattern consistency: ci.ex follows the same run/1 (impl) → run/2 (testable, injected shell) pattern as lc.ex. Dependency injection via the shell function argument keeps the test fast and side-effect-free.
  • Moduledoc quality: Documents the exact step list and the reason each step exists (including the #79 drift-detection cross-reference). This is the kind of "why" documentation that actually helps.
  • CI workflow update: Correctly overrides the job-level working-directory: app default with working-directory: . for the mix ci step, since the task lives in the root project. The consolidation comment preserves the #79 reference.
  • Scope discipline: deps.get inside the task makes it self-contained for local use; CI's cache step still runs before it so the deps.get is a no-op when the cache hits — no wasted time.
  • Fail-fast behavior: Shell.run!/3 raises on non-zero exit, so the first failing step aborts the gate. Correct for a quality gate.

Issues

Minor

  1. Test name overpromises on ordering (test/mix/tasks/ci_test.exs:6)
    The test is named "runs all quality gate steps in order" but assert_receive with distinct patterns doesn't actually verify ordering — it scans the full mailbox for any matching message, so it would pass even if the steps ran in reverse. The test does verify that all 4 steps are invoked with the correct arguments and options, which is the important contract. The ordering claim is technically misleading, though in practice the synchronous implementation guarantees order by construction. Consider either:

    • Renaming to "invokes all quality gate steps with correct arguments", or
    • Collecting messages into a list and comparing with == to actually assert order

    Not a blocker — the implementation's ordering is structurally guaranteed by the sequential shell.() calls.

No issues found

  • Correctness: The 4 steps match the prior CI workflow exactly (deps.get, format, usage_rules.sync, test). No steps missing, no extras added.
  • Safety: Shell.run!/3 handles non-zero exits. No user input flows through unsanitized.
  • Performance: No regressions — deps.get is idempotent and fast when already fetched.
  • Conventions: Conventional commit message, proper @impl/@doc false annotations, no unnecessary code.

@bougyman
bougyman merged commit 8629443 into main Aug 16, 2026
2 checks passed
@bougyman
bougyman deleted the CRY-49-mix-ci-task branch August 16, 2026 16:58
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