Update Elixir Dependencies
Use this workflow for Elixir projects that use Mix + Hex.
Workflow
1. Baseline And Scope
- •Confirm a clean baseline with
git status --short. - •Identify outdated dependencies with
mix hex.outdated. - •Split findings into:
- •Patch/minor upgrades (usually non-breaking).
- •Major upgrades (potentially breaking).
2. Apply Patch/Minor Upgrades First
- •Update dependencies that do not require major version constraint changes.
- •Prefer targeted updates for easier debugging:
- •
mix deps.update <dep_name>
- •
- •If many safe updates exist and risk is low,
mix deps.update --allis acceptable. - •Run verification (Section 4) before touching major upgrades.
3. Handle Major Upgrades One Dependency At A Time
For each dependency with a major bump:
- •Update the version constraint in
mix.exs. - •Gather migration notes from primary sources, in this order:
- •
mix hex.info <dep_name>to find package/repo links. - •
https://hexdocs.pm/<dep_name>(look for changelog, migration, or upgrade sections). - •Repository
CHANGELOG*, release notes, and upgrade guides.
- •
- •Extract only changes relevant to the jump from current to target major version.
- •Implement required code/config updates.
- •Run verification (Section 4) before moving to the next major dependency.
If a major upgrade fails verification and cannot be resolved quickly:
- •Revert only that dependency change.
- •Continue with other upgrades.
- •Report the blocker with exact failing errors and required follow-up.
4. Verification
Run these commands after each update batch and after each major dependency:
sh
mix compile --warnings-as-errors mix format --check-formatted mix test
If the project defines additional CI checks, run the same checks used in .github/workflows.
Failure handling:
- •Compile warnings/errors: fix code or config issues introduced by the upgrade.
- •Format check failures: run
mix format. - •Test failures: fix behavior regressions before proceeding.
5. Completion
- •Run
mix hex.outdatedagain and confirm the remaining items (if any) are intentional. - •Summarize:
- •Dependencies updated and final versions.
- •Major migrations performed and code changes required.
- •Any intentionally deferred upgrades and why.