Parse pending Ecto migrations (static AST — your code never runs), fold
their effects into the catalog model recorded by mix cerbero.snapshot,
and judge each operation by lock mode × cost class × your production scale
and traffic. Meant to run in CI, where no database is reachable: the exit
code is the verdict.
Options
--config PATH— config file to load (default.cerbero.exs).--snapshot PATH— snapshot to judge against (defaultconfig.snapshot_path). Verified againstconfig.snapshot_verify_keyswhen set.--migrations DIR— migrations directory (default the first entry ofconfig.migrations_paths).--fail-on error|warning|info— lowest severity that makes the task exit 1 (defaultconfig.fail_on, itself:error).--format human|json|sarif— output format (defaulthuman).sarifsuits code-scanning dashboards;jsonsuits scripting.--no-snapshot— skip the snapshot and run structural checks only; every finding is tagged "scale unknown". Useful before a first snapshot exists.--down— also judge each pending migration's rollback (down) body against the catalog the pendingups leave behind. Rollbacks are deploys too.--repo NAME— in an umbrella withconfig.repos, check only that repo. Without it every configured repo is checked.--verbose— expandhumanoutput.
Examples
# Standard CI invocation
mix cerbero.check
# SARIF for a code-scanning dashboard, failing on warnings too
mix cerbero.check --format sarif --fail-on warning > cerbero.sarif
# Judge rollbacks as well; check one umbrella repo
mix cerbero.check --down --repo billingExit codes
0— clean: no finding at or above the--fail-onthreshold.1— at least one finding at or above the threshold.2— operational error (missing/invalid snapshot or migrations directory, bad config, unparseable migration, invalid flag value).
Implemented by Cerbero.CLI.Check.