This guide is the historical v1.0 cutover lane for teams that are moving from a pre-1.0 Sigra package to the v1.0 contract. It is operational by design: branch first, run exact commands, review generated-host changes intentionally, and verify against the same proof surfaces used in this repo.
Version axis and target posture
- Source posture for the original v1.0 cut: latest published pre-1.0 series, resolved by
scripts/ci/upgrade-smoke.shwithSIGRA_UPGRADE_SOURCE_SERIES=0.3. - Target posture for this lane: the v1.0 contract line. If Hex already advertises a newer installable line, treat Hex package metadata as the current package truth and use this guide only for historical pre-1.0 cutover review.
- Planning milestones (
v1.xin.planning/) are coordination labels, not a second installable version axis.
Breaking-change review categories
| Category | What to review | Why it matters |
|---|---|---|
| Generated host auth files | Any diffs under your host auth context, controllers, LiveViews, templates, plugs | Sigra owns library behavior; you own generated-host integration decisions |
| Router and pipeline wiring | Session routes, OAuth routes, plugs, scope flow | Incorrect route/plugs wiring can break login/logout and scope guarantees |
| Schema and migrations | New/changed migrations, indexes, constraints, data migrations | Upgrade correctness depends on migration order and idempotent rollout |
| Optional integration config | Oban, Hammer, OAuth/provider config, mailer hooks | Optional deps are host-owned wiring and can fail at boot if mismatched |
| Audit and security posture | Required audit schema presence and configured callbacks | Avoid silent auth behavior drift during upgrade |
Preflight
- Create a dedicated upgrade branch.
- Confirm you can restore production data from backup.
- Ensure your app compiles and migrates cleanly before starting.
- Prefer a clean working tree before running upgrade tasks.
- Note rollback anchor: current commit SHA and currently deployed package version.
1. Bump dependency and fetch
Update your app mix.exs to the 1.0.0 target line, then fetch:
mix deps.get2. Run Sigra upgrade task
Run the generated-file and migration injector:
mix sigra.upgrade --yesUse --allow-dirty only if you explicitly accept reduced rollback safety.
3. Review generated-file changes before migrate
Label your review in these buckets before continuing:
- Session and auth controller/template diffs
- Scope/current-user/current-scope wiring
- OAuth and provider callback routes
- Admin and settings surfaces touched by generator output
- Any host policy callback seam changes
This guide does not promise automatic ecosystem migration or drop-in compatibility across other auth stacks. Generated-host ownership remains with your app.
4. Migration and schema impact
After review, run DB changes:
mix ecto.migrateChecklist:
- Confirm migration ordering is stable for your deployment model.
- Confirm data migrations (if present) are run by your deploy pipeline.
- Confirm constraints/indexes align with your production DB posture.
- Confirm no unexpected destructive schema edits were introduced.
5. Compile with warnings as errors
mix compile --warnings-as-errorsTreat warnings as release blockers until resolved.
6. Verification commands (repo proof surfaces)
Run the same focused checks used by this repo:
mix test test/upgrade_test.exs -x
bash scripts/ci/upgrade-smoke.shThese checks validate the published-consumer upgrade posture and targeted upgrade contract. Maintainers can retarget the smoke source series for later public lines with SIGRA_UPGRADE_SOURCE_SERIES, while the v1.0 proof lane keeps 0.3 as its historical source series.
7. Minimal manual boot smoke
Start your upgraded app and validate core route and auth behavior:
mix phx.serverManual checks:
- Login still succeeds for an existing user.
- Session creation and logout behavior remain correct.
- Key auth pages load without 500s.
- Any required organization/scope landing behavior is intact.
Rollback notes
If verification fails:
- Stop deploy rollout.
- Revert to pre-upgrade commit and pre-upgrade Sigra dependency version.
- Restore DB from backup if migrations were destructive or unrecoverable.
- Re-run preflight and re-attempt with narrower diff review.
If verification passes but production issues appear:
- Roll back app artifact first.
- Roll back DB only per your migration rollback policy and backup posture.
- Capture failing diff category (generated file, migration, optional integration) before retrying.