mix ash_onetime.doctor (ash_onetime v0.6.0)

Copy Markdown View Source

Checks the install health of ash_onetime: the Ash security floor, Oban queue configuration, and prefix validity. Run after install and after each upgrade to catch the silent-failure modes that have no runtime signal.

mix ash_onetime.doctor --repo MyApp.Repo
mix ash_onetime.doctor --repo MyApp.Repo --prefix tenant_1

Checks:

  • Ash floor (fatal): the running Ash version must be >= 3.31.1 (the CVE-floor pinned in mix.exs ash_requirement/0). A below-floor Ash is a security defect, not an advisory.
  • Oban queues (advisory when Oban loaded): the three maintenance workers require :ash_onetime_cleanup, :ash_onetime_reap, and :ash_onetime_partitions. A missing :ash_onetime_partitions queue silently strands the retention-safety path (forward partition creation never executes). The doctor scans the consumer's Oban config for the three queues and warns on any missing. This is advisory — a consumer may configure Oban dynamically at runtime.
  • Prefix validity (when --prefix given): the prefix must be 1..63 bytes (PostgreSQL's NAMEDATALEN bound).

Exits non-zero only on a FAIL (Ash below floor, missing --repo, invalid --prefix). Advisory warnings return :ok.