Repository navigation
fix: Compile on Elixir 1.12 so releases publish to Hex - #79
Merged
Merged
Conversation
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Replaces the Elixir 1.13+ ** operator with Integer.pow/2 in the retry backoff calculation, restoring Elixir 1.12 compilation so Hex publishes can proceed. Behavior is preserved for the integer exponent.
Turn on auto-fix | Re-trigger cubic
khvn26
pushed a commit
that referenced
this pull request
Nov 23, 2026
🤖 I have created a release *beep* *boop* --- ## [2.7.1](v2.7.0...v2.7.1) (2026-11-23) ### Bug Fixes * Compile on Elixir 1.12 so releases publish to Hex ([#79](#79)) ([bbabe3e](bbabe3e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
khvn26
added a commit
that referenced
this pull request
Nov 23, 2026
`Version.to_string/1` was added in Elixir 1.14, but the package declares
`elixir: "~> 1.12"`. On 1.12 and 1.13, three code paths raise
`UndefinedFunctionError` when they meet a semver trait value:
- `Flagsmith.Engine.Evaluator.to_str/1`, during local evaluation
- `Flagsmith.Engine.Mappers.map_trait_value/1`
- JSON encoding of `Flagsmith.Schemas.Traits.Trait.Value`
`%Version{}` implements `String.Chars` on every supported Elixir, so
this uses `to_string/1` instead. The output is the same.
Nothing in CI tests the minimum version, which is how this and the `**`
operator from #79 got through (that one also stopped 2.6.0 and 2.7.0
from publishing to Hex). To close that gap, the build job now runs on a
matrix:
| Entry | Runner | Compile (`--warnings-as-errors`) | Tests | Format and
dialyzer |
| --- | --- | --- | --- | --- |
| `.tool-versions` (Elixir 1.15.2, OTP 26) | `ubuntu-latest` | ✅ | ✅ | ✅
|
| Elixir 1.12, OTP 24 (the minimum, and what the Hex publish uses) |
`ubuntu-24.04`, the newest runner with OTP 24 builds | ✅ | ✅ | — |
Format and dialyzer only run on `.tool-versions`, since their output
differs between versions. Each entry has its own cache keys.
To make that pass:
- `Logger.warn/1` is deprecated from Elixir 1.15 and breaks
`--warnings-as-errors`, so it's replaced with `Logger.warning/2`, which
has existed since 1.11.
- Two fixes to make the tests work on 1.12:
- `ExUnit.CaptureLog.with_log/1` (1.13+) is replaced with
`capture_log/2`.
- `assert_request` compares JSON request bodies as decoded data, not raw
strings, because key order differs between OTP versions.
- Also replaced a deprecated `level: :warn` with `:warning`.
Verified locally in containers for both entries:
- `mix compile --warnings-as-errors` passes.
- `mix test` passes, 433 tests and 0 failures.
- On 1.15.2, `mix format --check-formatted` and `mix dialyzer` pass.
Before the fix, the 1.12 entry fails, both at compile time
(`Version.to_string/1 is undefined or private`) and in tests
(`UndefinedFunctionError`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restore Elixir 1.12 compat.
**broke 2 last releases.