Skip to content

ci: verify the supported Elixir and req ranges with a matrix - #5

Merged
lostbean merged 1 commit into
mainfrom
ci/compat-matrix
Jul 27, 2026
Merged

lostbean merged 1 commit into
mainfrom
ci/compat-matrix

Conversation

@lostbean

Copy link
Copy Markdown
Owner

Why

mix.exs declares elixir: "~> 1.18" and req: "~> 0.5.15 or ~> 0.6", but CI ran a single Nix-pinned Elixir 1.20 against mix.lock — which pinned req to 0.5.18. Neither range was actually exercised, so the 1.18 compile error fixed in c9205f9 would not have been caught:

** (ArgumentError) cannot inject attribute @anthropic_patterns into function/macro
because cannot escape #Reference<...>

(Reproduced on c9205f9^ with Elixir 1.18.4 to confirm a matrix would catch it.)

What

A compatibility job covering the corners of both ranges — Elixir 1.18.4 (OTP 27 and 28) and 1.20.1, each against req 0.5.15 and 0.6.3. Every row resolves deps without mix.lock and compiles with --warnings-as-errors. The existing Nix job still owns format and Credo.

Note on pin-req.sh

Pinning needs a helper because mix deps.update --to '0.5.15' req is a silent no-op here — resolution always selects the newest version a constraint allows. Without the helper, every matrix row would test req 0.6.3 while displaying 0.5.15 in its name: a green matrix proving nothing.

pin-req.sh rewrites the constraint, then asserts the resolved version matches, so a silent no-op fails the build. Both the success and failure paths were tested.

Verification

All 6 jobs green on run 30265324531, and the logs confirm each row resolved its own req version (resolved req: 0.5.15 / 0.6.3), 521 tests passing per row.

The only warnings are from dependencies (finch's deprecated xref: option, actions/checkout@v4 on Node 20) — none from req_cassette.

mix.exs declares elixir "~> 1.18" and req "~> 0.5.15 or ~> 0.6", but CI
ran a single Nix-pinned toolchain against mix.lock, so neither range was
actually exercised. The 1.18 compile error fixed in c9205f9 would not
have been caught.

Add a compatibility job covering the corners of both ranges: Elixir
1.18.4 (OTP 27 and 28) and 1.20.1, each against req 0.5.15 and 0.6.3.
Each row resolves deps without mix.lock and compiles with
--warnings-as-errors.

Pinning needs pin-req.sh because resolution always selects the newest
version a constraint allows and "mix deps.update --to" is a no-op here;
the script rewrites the constraint, then asserts the resolved version
matches so a silent no-op fails the build instead of quietly retesting
the same version in every row.
@lostbean
lostbean merged commit 200f3e6 into main Jul 27, 2026
12 checks passed
@lostbean
lostbean deleted the ci/compat-matrix branch July 27, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant