Skip to content

PhoenixKit 1.7.230: Installs on a fresh Phoenix app, module versions in status

PhoenixKit 1.7.230 fixes mix igniter.install phoenix_kit on a newly generated Phoenix app, and makes the upgrade tasks report and migrate modules with their own tables reliably.

What changed

A new Phoenix app declares igniter for dev and test only, while PhoenixKit required it everywhere, so Mix refused to install and the installer stopped before writing anything. Igniter is now an optional dependency of PhoenixKit.

mix phoenix_kit.status now lists the schema version of each module that owns its migrations, and its Next line says when a module is behind. mix phoenix_kit.update writes all pending module migrations and runs ecto.migrate once. It now uses the repo’s own migrations folder, checks each module’s version afterwards, reports modules it could not read, and no longer crashes on duplicate timestamps or a re-run.

Language URLs such as /en-gb/ now open in that dialect when it is enabled, instead of redirecting to /en/.

Upgrading

If your mix.exs does not list igniter, add {:igniter, "~> 0.7", only: [:dev, :test]}, or the install, update and generator tasks stop working.

Full release notes: PhoenixKit 1.7.230

1.7.230 · 4 August 2026

Fixed

  • ⚠️ mix igniter.install phoenix_kit failed on every freshly generated Phoenix project. Core declared {:igniter, "~> 0.7"} as a required dependency in all environments. A stock mix phx.new app declares {:igniter, "~> 0.6", only: [:dev, :test]}, and Mix refuses to converge the two:

    Dependencies have diverged:
    * igniter (Hex package) — the :only option for dependency igniter
      Remove the :only restriction from your dep
    

    The install aborted before writing anything. Igniter is now optional: true, so the host’s own declaration wins and the documented install path works on a clean project. The version requirement is unchanged (~> 0.6 and ~> 0.7 both admit igniter 0.7/0.8, so no host is forced to move).

    Making it optional means core must compile without igniter, which it previously could not: mix/tasks/phoenix_kit.gen.admin.page.ex and phoenix_kit.gen.user.dashboard.ex called use Igniter.Mix.Task unguarded and hard-failed a MIX_ENV=prod build. Both now carry the same if Code.ensure_loaded?(Igniter.Mix.Task) guard phoenix_kit.install and phoenix_kit.update already had, and ten igniter-only PhoenixKit.Install.* helpers are guarded on Code.ensure_loaded?(Igniter) so a production build no longer prints a wall of “Igniter.X is undefined” warnings. The two helpers that cannot be guarded away because their non-igniter half is called from plain tasks — Install.Common (mix phoenix_kit.status) and Install.JsIntegration (mix phoenix_kit.assets.rebuild) — instead use the existing Install.IgniterCompat :no_warn_undefined shim, which grew the three modules they reference. No task or helper changed behaviour when igniter is present.

    ⚠️ Upgrading from ≤ 1.7.229 and your mix.exs does not list :igniter? You were getting it transitively from PhoenixKit; an optional dep is not installed unless the host declares it, so after mix deps.update phoenix_kit the code-generating tasks stop working. Add:

    {:igniter, "~> 0.7", only: [:dev, :test]}
    

    mix phoenix_kit.install / .update / .gen.* now say exactly this when invoked without igniter rather than vanishing from mix help (the two gen.* tasks, newly guarded, had no fallback at all; install and update had one each, and all four now share Install.MissingIgniter). PhoenixKit.Install.IgniterCompat gained a __mix_recompile__?/0 keyed on igniter’s availability, so adding the dep later actually rebuilds the tasks instead of needing mix deps.compile phoenix_kit --force. Tasks that never touch igniter — phoenix_kit.status, .gen.migration, .assets.rebuild — are unaffected either way.

  • mix phoenix_kit.update could crash when two modules needed migrating in the same second. Generated migration filenames took their version from a bare %Y%m%d%H%M%S timestamp, so two modules upgraded together produced duplicate Ecto migration versions. Timestamps are now offset per file and bumped past anything already in priv/repo/migrations.

  • mix phoenix_kit.update silently skipped modules whose migration coordinator raised. The failure was swallowed and the host saw nothing at all, leaving it to assume its tables were current. Unreadable modules are now reported by name with the error and an explicit note that they were not migrated.

  • mix phoenix_kit.update wrote module migrations to a hardcoded priv/repo/migrations. On a host whose first :ecto_repos entry is not MyApp.Repo, the file landed in a directory the migrator never scans, so ecto.migrate exited 0 having done nothing — and the run still printed ✅ <module> migrated to V##. The directory is now taken from the resolved repo, and each module’s version is re-read from the database afterwards rather than assumed, so a migration that did not run is reported as a failure with the path to check.

  • mix phoenix_kit.update could hard-fail on a re-run after an interrupted update. The module path had no “migration already exists” guard (the core path has had one all along), so a second run wrote a second file with the same migration name and mix ecto.migrate refused everything with migration name ... is duplicated. It now reuses the existing file.

  • One bad module aborted the whole mix phoenix_kit.update run. The per-module try/rescue was lost in the rework, so a module that raised while its migration file was written killed the task after core had migrated — skipping every remaining module and the UUID repair pass. Each module is isolated again.

  • mix phoenix_kit.status reported Next: Ready directly under a 1 unreadable ❌ module row. An unreadable module is deliberately not “pending” (migrating a module whose version cannot be read would be worse), but it is not “ready” either. Next now names the modules to check.

  • mix phoenix_kit.status --verbose claimed “No installed module owns migrations” whenever the database was unreachable, which is a different fact from having none and sends anyone debugging a missing table the wrong way. Not-queried and none-found are now distinct.

  • A module coordinator reporting a non-integer version read as up to date. Under Erlang term ordering nil >= 2 is true, so a coordinator returning nil for “no version comment found” was classified :up_to_date and its migration skipped forever, while both tasks reported everything current. Modules.classify/2 now requires integers and reports anything else as :error.

  • Soft-failure paths guarded with rescue alone now also catch :exit. Per the project’s own convention, an unreachable database raises on an unowned checkout but exits on a dead pool — so a dead pool crashed mix phoenix_kit.status outright and killed the closing summary of an otherwise-successful mix phoenix_kit.update.

  • The sitemap’s x-default could be claimed by a sibling-dialect entry (#679). Enabled codes are stored BCP-47 (en-GB) while sibling-dialect URLs render lowercase (/en-gb/…), so the case-sensitive String.contains? never recognised such an entry as language-prefixed and let it pass as the unprefixed default. The default picker now matches case-insensitively, in line with the per-entry hreflang extraction that already did.

Added

  • The locale plug accepts enabled full-dialect URL segments (#679) instead of 301-ing every hyphenated segment to its base code. A segment that case-insensitively matches an enabled language (/en-gb/… with en-GB enabled) is now served as that locale, with the stored-case code on conn.assigns.current_locale and its base on current_locale_base. Disabled dialects, unknown dialects, and an empty enabled list (Languages module off) all keep the historical redirect-to-base, so nothing changes for an install that does not enable sibling dialects.

    This is what makes two enabled dialects of one base addressable as distinct public URLs — phoenix_kit_publishing gives the non-primary sibling its own URL space and previously had it bounced to the base before its controller ever ran. The prefixless-primary canonical redirect deliberately does not apply on this branch: only non-primary siblings are addressed by full-code URLs, and the primary keeps its base-coded (or prefixless) shape.

  • mix phoenix_kit.status now reports the schema version of every module that owns its migrations, not just core. Modules implementing c:PhoenixKit.Module.migration_module/0 (phoenix_kit_inbox, phoenix_kit_boards, phoenix_kit_web_analytics, phoenix_kit_legal, phoenix_kit_stats) each report installed-vs-expected:

    PhoenixKit v1.7.230
    ├── Installed: V159 ✅
    ├── Database: Connected ✅
    ├── Modules: 2 modules, 1 update available ⬆
    │   ├── Boards: V01 ✅
    │   └── Inbox: V01 → V02 available ⬆
    └── Next: mix phoenix_kit.update (module schema behind: Inbox)
    

    Next is module-aware: a host whose core is current but whose module tables are a version behind previously reported “Ready”. --verbose adds each module’s coordinator and exact version numbers. The row is omitted entirely when no installed module owns migrations, so a core-only install keeps its compact three-line tree.

  • mix phoenix_kit.update’s closing summary lists module versions too, so the last thing printed answers “what version is everything at?” rather than covering core alone and leaving module versions in scrollback.

Changed

  • mix phoenix_kit.update now writes every pending module migration first and runs ecto.migrate once, instead of a full migrator pass per module.
  • New PhoenixKit.Migrations.Modules — the shared read side of the module-migration contract, used by both tasks. Discovery previously lived inside update only, which is why status never knew modules existed. A module whose coordinator raises, exits, or reports a non-integer version is recorded as :error, never propagated, so a broken third-party module cannot take down mix phoenix_kit.status. classify/2 is public because it is the whole read-side decision, and a private one could only be tested through a hand-built entry that supplied the answer.
  • New PhoenixKit.Install.StatusTree — the tree layout, extracted from the status task so it can be unit tested without a database. It was previously a private function writing straight to IO.puts/1, so in practice changes to it went unverified.

PhoenixKit 1.7.230. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.