Developing
- Elixir/OTP versions are pinned in
.tool-versions; useasdfor your preferred version manager. - Library tests require PostgreSQL (
PGUSER/PGPASSWORD/PGHOST); seeCLAUDE.mdfor a Docker one-liner. - The
test/exampleapp is the generated-host fixture used by installer drift tests and Playwright smoke runs.
Releases: Hex + GitHub releases are automated via Release Please on main (see MAINTAINING.md). Use conventional commits (feat:, fix:, …) so the Release PR gets the right semver bump; routine mix test and CI do not require Node.js or external planning audit tooling.
Reproducing the PR gate locally (mix ci)
Run mix ci to reproduce the locally-faithful portion of the PR-fast required gate without leaving your terminal. It chains exactly four legs in the same order as CI:
compile --warnings-as-errors— library compiles with zero warnings.test— full library test suite.ci.install_golden— install golden diff + idempotency contract (test/sigra/install/).sigra.dep_off— dep-off guard: unlocks:threadline, re-compiles without it (--warnings-as-errors), then runs the tagged--only threadline_guardsubset.
If mix ci is red, your PR will be red. If mix ci is green, the locally-faithful portion of the gate is green (CI-only lanes may still fail; see below).
Prerequisites
Live Postgres — every test leg except the planning contract-lock tests requires a live PostgreSQL instance. See CLAUDE.md ("Local development prerequisites") for full instructions. Quick path:
scripts/db/up.sh # boots ephemeral Dockerized test PG, writes tmp/db.env
source tmp/db.env # exports SIGRA_TEST_PG_* into the current shellWithout direnv, you must source tmp/db.env in every new shell before running mix test or mix ci. If you run a local Postgres on port 5432, the fallback defaults apply automatically.
phx_new 1.8.8 archive — the ci.install_golden leg generates a Phoenix app via phx_new and diffs it against a committed fixture. A different local archive version produces spurious byte-diffs and a red gate. Install the pinned version:
mix archive.install --force hex phx_new 1.8.8The fixture is reblessed against 1.8.8 — use this version locally to keep your gate in sync with CI.
CI-only lanes (intentionally excluded from mix ci)
The following gates run in CI but are excluded from mix ci because they either require Ubuntu font metrics or heavy infrastructure that cannot be reproduced faithfully on a local macOS machine:
- Ubuntu-baselined Playwright visual snapshots (
admin-checkpoints-*,admin-design-*): pixel baselines are captured on Ubuntu with specific system fonts. Local macOS runs produce sub-pixel font-metric diffs that diverge from the stored PNGs even when the UI is correct. Do not re-record baselines locally. Instead, download theadmin-example-reportartifact from the GitHub Actions run and openplaywright-report/index.htmlin your browser. - Heavy scaffold smokes — the install smoke and HTTP smoke run the full
phx.new + sigra.installscaffolding against a live dev server. They are excluded from the defaultmix cirun because they take several minutes and require Docker. You can run them manually:scripts/ci/install-smoke.sh— scaffolds a new host app and boots it.- boot the example app +
scripts/ci/http-smoke.sh— hits live HTTP endpoints.
Optional local hygiene (not in the PR gate)
These are useful for code quality but are deliberately not part of mix ci because they are not required checks in the PR gate. Running them locally may produce reds that CI does not enforce:
mix format --check-formattedmix credo --strictmix dialyzer
Known non-regression mix test failures (v1.40)
The following failures appear on a stock v1.40 checkout and are not regressions — do not investigate them as new failures:
- golden_diff_test.exs — red if your local phx_new archive differs from 1.8.8 (install 1.8.8 to fix).
- UpgradeIntegrationTest (3 tests) — require a specific database and environment configuration not present in a default dev setup.
CI overview
- Library tests — full
mix testfor the Hex package. - Example + install matrix — compiles the example app and runs installer smoke paths.
- Milestone verification gate —
scripts/ci/milestone-verification-gate.shensures completed milestone phases keep a verification report on disk. - Installer milestone audit —
scripts/ci/installer-milestone-audit.sh(paths-filtered on pull requests) encodes critical installer integration checks (INT-01..INT-03). - Playwright —
example_playwright_smokebootstest/exampleand runs browser suites; curated admin checkpoint PNGs are collected undertest/example/priv/playwright/artifacts/admin-checkpoints/. - Admin artifact bundle contract — after a green Playwright admin run,
scripts/ci/admin-artifact-bundle-contract.shasserts the curated PNG bundle meets minimum count and file size.
Reviewing admin Playwright artifacts
- Open the GitHub Actions run for Example Playwright smoke (full lifecycle) (job id
example_playwright_smoke) or the generated-host variantgenerated_admin_playwright_smokewhen reviewing installer parity. - Download the
admin-example-reportartifact (HTML report plus bundled files). - In the extracted tree, open
playwright-report/index.htmland confirm the five checkpoint scenarios appear green for admin-checkpoints-chromium, admin-checkpoints-mobile, and admin-checkpoints-dark. - Under
artifacts/admin-checkpoints/, confirm at least 15 non-trivial PNG files (curated reviewer bundle); the CI stepAdmin artifact bundle contractenforces count and a minimum size per file. - For template-only changes, confirm the Installer milestone audit job ran on your pull request (it skips when no files under
priv/templates/sigra.install/orlib/sigra/install/changed).
Playwright reports on GitHub Pages (optional)
This repo can host a browsable mirror of the Playwright HTML report (including videos on the checkpoint and generated-host lanes when published via the dedicated workflow).
- Run Playwright reports (GitHub Pages) once on
main(Actions → Run workflow, or wait for schedule / path-filtered push). The job pushesgh-pages, then calls the GitHub REST API (scripts/ci/ensure-github-pages-legacy-branch.sh) to create or switch the repo’s Pages source to legacy build from branchgh-pagesat/, so you usually do not open Settings → Pages manually. - Project URL:
https://<owner>.github.io/<repository>/(for examplehttps://szTheory.github.io/sigra/). Private repositories may require a paid GitHub plan for Pages. - The site root lists each run under
runs/<YYYYMMDD-<run_id>>/with a link intoplaywright-report/index.html. Older run folders are pruned (seven-day policy in the assemble script).
If the API step fails with 403 (some orgs restrict pages:write on GITHUB_TOKEN), set Pages once in Settings → Pages → Deploy from a branch → gh-pages / /, then re-run the workflow.
If Pages is already set to “GitHub Actions” (build_type: workflow), the ensure script does not change it; use Settings or migrate the workflow to deploy-pages yourself.