igniter icon indicating copy to clipboard operation
igniter copied to clipboard

igniter.upgrade through the igniter_new archive discards upgrade task notices and changes

Open pshoukry opened this issue 2 months ago • 0 comments

Note: this issue was drafted with an AI assistant (Claude) and posted by me. The reproduction and output below were run as shown.

When mix igniter.upgrade runs through the igniter_new archive, the package's upgrade task runs, but its notices are never printed and its file changes are never written.

Seen with igniter 0.8.4, igniter_new 0.5.34, Elixir 1.18.4, OTP 27.

Cause

The archive's Igniter.Installer.TaskHelpers.wrap_task/3 calls Igniter.CopiedTasks.upgrade/1. That function builds an igniter, pipes it into Igniter.Upgrades.upgrade/1, and returns the result. Nothing calls Igniter.do_or_dry_run/2 on it. The project's own Mix.Tasks.Igniter.Upgrade goes through Igniter.Mix.Task.run/1, which does call do_or_dry_run/2. main has the same CopiedTasks.upgrade/1 today.

Reproduction

Any package whose upgrade task adds a notice. ash_introspection 0.6.0 adds one for 0.5.3 -> 0.6.0.

# mix.exs
defp deps do
  [{:ash_introspection, "0.5.3"}, {:igniter, "~> 0.7"}]
end
mix deps.get && mix compile
mix igniter.upgrade [email protected] --yes

The run updates mix.exs and mix.lock and prints only the spinner lines. No "Notices:" block appears.

Running the task directly afterwards prints the notice:

mix ash_introspection.upgrade 0.5.3 0.6.0

Probe output

We added IO.puts lines to the fetched deps/igniter source: in Igniter.Upgrades.apply_updates/2 after compose_task, in Igniter.Upgrades.upgrade/1 where it returns, in Igniter.Mix.Task.run/1 before do_or_dry_run, and at the top of Igniter.do_or_dry_run/2.

compile ✔
fetching deps ✔
installing new dependencies ✔
compile ✔
PROBE apply_updates ash_introspection 0.5.3 -> 0.6.0
PROBE composed Mix.Tasks.AshIntrospection.Upgrade notices=1 first="ash_introspection 0.6.0 requires a manifest on the request p"
PROBE upgrade returns notices=1 issues=[]

The upgrade task added one notice, and Igniter.Upgrades.upgrade/1 returned it. The probes in Igniter.Mix.Task.run/1 and do_or_dry_run/2 never printed.

Expected: the same "Notices:" block, diff and file writes as the non-archive path.

pshoukry avatar Sep 27 '26 19:09 pshoukry