From 7bf0eecfbe38df0c5e8f7d879b3c7641ab2a8a2f Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 27 Jul 2026 16:58:12 -0500 Subject: [PATCH] chore: remove stale dialyzer ignores and fix CI PLT caching - Remove 5 unnecessary dialyzer ignore entries that no longer match warnings - Narrow CI dialyzer cache from entire _build to PLT files only - Add OTP/Elixir versions to cache key to prevent stale PLT on version bumps - Add restore-keys fallback to GitHub Actions dialyzer cache --- .dialyzer_ignore.exs | 17 +---------------- .forgejo/workflows/ci.yml | 10 ++++++---- .github/workflows/ci.yml | 12 ++++++++---- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/.dialyzer_ignore.exs b/.dialyzer_ignore.exs index 04b4a32..c616b71 100644 --- a/.dialyzer_ignore.exs +++ b/.dialyzer_ignore.exs @@ -21,10 +21,6 @@ # is called with a tuple that satisfies the runtime contract but violates the opaque type spec {"lib/aprsme_web/gettext.ex", :call_without_opaque}, - # False positive: MapSet.t() is opaque; the @spec is correct at the semantic level but dialyzer - # sees through the opaque wrapper to the underlying map representation - {"lib/aprsme/packets/prepared_queries.ex", :contract_with_opaque}, - # False positive: to_float/1 has a %Decimal{} clause for completeness but dialyzer infers # nil | number() from the call sites in mobile_channel — the clause is defensive dead code {"lib/aprsme_web/channels/mobile_channel.ex"}, @@ -46,16 +42,5 @@ # Mix.Project PLT limitations: Mix.Project.compile_path/0 and # Mix.Project.config/0 are not present in the dialyzer PLT, and Code.ensure_loaded # is treated as having an unmatched return when used for side-effect. - {"lib/mix_unused/analyzer.ex"}, - - # Phoenix LiveViewTest false positive: render_hook/3 and render/1 internally access - # view.ref which only exists on View, but the type specs say Element | View. - # Dialyzer can't narrow the live/3 return type from Element | View to just View. - {"test/aprsme_web/live/map_live/movement_test.ex"}, - - # Compiler type-checking false positives: these test files use patterns that trigger - # type warnings from the Elixir compiler. All are pre-existing and benign. - {"test/aprsme/packets_mic_e_test.exs"}, - {"test/aprsme/packets_test.exs"}, - {"test/aprsme/is_test.exs"} + {"lib/mix_unused/analyzer.ex"} ] diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 5c249dc..557fe92 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -74,6 +74,8 @@ jobs: container: git.mcintire.me/graham/elixir-base:latest env: MIX_ENV: dev + OTP_VERSION: "29.0" + ELIXIR_VERSION: "1.20" steps: - name: Configure git for submodules @@ -85,15 +87,15 @@ jobs: with: submodules: recursive - - name: Restore dependency and build caches + - name: Restore PLT cache uses: https://code.forgejo.org/actions/cache@v4 with: path: | deps - _build - key: ${{ runner.os }}-dialyzer-${{ hashFiles('**/mix.lock') }} + _build/dev/*.plt + key: ${{ runner.os }}-dialyzer-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}-${{ hashFiles('**/mix.lock') }} restore-keys: | - ${{ runner.os }}-dialyzer- + ${{ runner.os }}-dialyzer-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}- - name: Fetch dependencies run: mix deps.get diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 974c0a7..1fdcd6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,20 +51,24 @@ jobs: runs-on: ubuntu-latest env: MIX_ENV: dev + OTP_VERSION: "29.0" + ELIXIR_VERSION: "1.20" steps: - uses: actions/checkout@v4 with: submodules: recursive - uses: erlef/setup-beam@v1 with: - otp-version: "29.0" - elixir-version: "1.20" + otp-version: ${{ env.OTP_VERSION }} + elixir-version: ${{ env.ELIXIR_VERSION }} - uses: actions/cache@v4 with: path: | deps - _build - key: ${{ runner.os }}-dialyzer-${{ hashFiles('mix.lock') }} + _build/dev/*.plt + key: ${{ runner.os }}-dialyzer-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }} + restore-keys: | + ${{ runner.os }}-dialyzer-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}- - run: mix local.hex --force - run: mix local.rebar --force - run: mix deps.get