diff --git a/.tool-versions b/.tool-versions index 4624a3f38..6cee0bf9f 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,7 +1,7 @@ # These are used for the dev environment. # This should match the versions used in the built product. nodejs 20.14.0 -elixir 1.17.2-otp-27 +elixir 1.18.2-otp-27 erlang 27.2.1 terraform 1.10.4 diff --git a/elixir/Dockerfile b/elixir/Dockerfile index a539ae9d5..e7a9a042c 100644 --- a/elixir/Dockerfile +++ b/elixir/Dockerfile @@ -1,8 +1,8 @@ ARG ALPINE_VERSION="3.20.5" ARG ERLANG_VERSION="27.2.1" ARG ERLANG_DOWNLOAD_SHA256="07982134e10637dde57cf9cdc6dda6f65425810229986136d184766d4db9eda3" -ARG ELIXIR_VERSION="1.17.2" -ARG ELIXIR_DOWNLOAD_SHA256="7bb8e6414b77c1707f39f620a2ad54f68d64846d663ec78069536854247fb1ab" +ARG ELIXIR_VERSION="1.18.2" +ARG ELIXIR_DOWNLOAD_SHA256="efc8d0660b56dd3f0c7536725a95f4d8b6be9f11ca9779d824ad79377753e916" FROM alpine:${ALPINE_VERSION} AS base diff --git a/elixir/apps/domain/lib/domain/accounts/config.ex b/elixir/apps/domain/lib/domain/accounts/config.ex index 3fc038d27..751b69cf7 100644 --- a/elixir/apps/domain/lib/domain/accounts/config.ex +++ b/elixir/apps/domain/lib/domain/accounts/config.ex @@ -3,7 +3,9 @@ defmodule Domain.Accounts.Config do @primary_key false embedded_schema do - embeds_many :clients_upstream_dns, ClientsUpstreamDNS, primary_key: false, on_replace: :delete do + embeds_many :clients_upstream_dns, ClientsUpstreamDNS, + primary_key: false, + on_replace: :delete do field :protocol, Ecto.Enum, values: [:ip_port, :dns_over_tls, :dns_over_http] field :address, :string end diff --git a/elixir/apps/domain/lib/domain/config/resolver.ex b/elixir/apps/domain/lib/domain/config/resolver.ex index 2e20d7bbd..f5a9d21ec 100644 --- a/elixir/apps/domain/lib/domain/config/resolver.ex +++ b/elixir/apps/domain/lib/domain/config/resolver.ex @@ -19,20 +19,19 @@ defmodule Domain.Config.Resolver do end end - @dialyzer {:nowarn_function, fetch_process_env: 1, resolve_process_env_value: 1} - defp resolve_process_env_value(key) do - pdict_key = {__MODULE__, key} - - case fetch_process_env(pdict_key) do - {:ok, {:env, value}} -> - {:ok, {{:env, env_key(key)}, value}} - - :error -> - :error - end - end - if Mix.env() == :test do + defp resolve_process_env_value(key) do + pdict_key = {__MODULE__, key} + + case fetch_process_env(pdict_key) do + {:ok, {:env, value}} -> + {:ok, {{:env, key}, value}} + + :error -> + :error + end + end + def fetch_process_env(pdict_key) do with :error <- fetch_process_value(pdict_key), :error <- fetch_process_value(Process.get(:last_caller_pid), pdict_key), @@ -74,7 +73,7 @@ defmodule Domain.Config.Resolver do end end else - def fetch_process_env(_pdict_key), do: :error + defp resolve_process_env_value(_key), do: :error end defp resolve_env_value(env_configurations, key, opts) do diff --git a/elixir/apps/domain/lib/domain/types/cidr.ex b/elixir/apps/domain/lib/domain/types/cidr.ex index 6d0d0e559..23034c823 100644 --- a/elixir/apps/domain/lib/domain/types/cidr.ex +++ b/elixir/apps/domain/lib/domain/types/cidr.ex @@ -58,7 +58,7 @@ defmodule Domain.Types.CIDR do end defp reset_right_bits(number, shift) do - number >>> shift <<< shift + (number >>> shift) <<< shift end defp fill_right_bits(number, shift) do diff --git a/elixir/apps/domain/test/domain/policies/condition/evaluator_test.exs b/elixir/apps/domain/test/domain/policies/condition/evaluator_test.exs index 6ce404826..10ce9aaad 100644 --- a/elixir/apps/domain/test/domain/policies/condition/evaluator_test.exs +++ b/elixir/apps/domain/test/domain/policies/condition/evaluator_test.exs @@ -490,7 +490,10 @@ defmodule Domain.Policies.Condition.EvaluatorTest do assert parse_days_of_week_time_ranges(["M/true/UTC"]) == {:ok, %{"M" => [{~T[00:00:00], ~T[23:59:59], "UTC"}]}} - assert parse_days_of_week_time_ranges(["M/true/UTC", "W/19:00:00-22:00:00,22-23/US/Pacific"]) == + assert parse_days_of_week_time_ranges([ + "M/true/UTC", + "W/19:00:00-22:00:00,22-23/US/Pacific" + ]) == {:ok, %{ "M" => [ diff --git a/elixir/apps/web/lib/web/live/groups/edit_actors.ex b/elixir/apps/web/lib/web/live/groups/edit_actors.ex index 20da00b29..186e3c5f5 100644 --- a/elixir/apps/web/lib/web/live/groups/edit_actors.ex +++ b/elixir/apps/web/lib/web/live/groups/edit_actors.ex @@ -143,7 +143,7 @@ defmodule Web.Groups.EditActors do