diff --git a/.tool-versions b/.tool-versions
index ddc820de4a..8401caa2e2 100644
--- a/.tool-versions
+++ b/.tool-versions
@@ -1,3 +1,3 @@
nodejs 24.5.0
-erlang 28.0.2
-elixir 1.18.4-otp-28
+erlang 28.2
+elixir 1.19.4-otp-28
diff --git a/config/deps/phoenix.exs b/config/deps/phoenix.exs
index ac43268ae6..7b36f3b84e 100644
--- a/config/deps/phoenix.exs
+++ b/config/deps/phoenix.exs
@@ -4,11 +4,6 @@ config :phoenix, :gzippable_exts, ~w(.txt .html .js .css .svg)
config :phoenix, :json_library, Poison
if config_env() == :prod do
- config :dotcom, :websocket_check_origin, [
- "https://*.mbta.com",
- "https://*.mbtace.com"
- ]
-
config :dotcom,
dev_server?: false
diff --git a/config/runtime.exs b/config/runtime.exs
index feccb46c29..a2f52f2827 100644
--- a/config/runtime.exs
+++ b/config/runtime.exs
@@ -196,6 +196,7 @@ config :dotcom, DotcomWeb.ViewHelpers,
google_tag_manager_auth: System.get_env("GOOGLE_TAG_MANAGER_AUTH"),
google_tag_manager_preview: System.get_env("GOOGLE_TAG_MANAGER_PREVIEW")
+config :dotcom, allow_indexing: System.get_env("ALLOW_INDEXING") == "true"
config :dotcom, google_api_key: System.get_env("GOOGLE_API_KEY")
config :recaptcha,
diff --git a/deploy/dotcom/dev/Dockerfile b/deploy/dotcom/dev/Dockerfile
index 12f76a5bc5..5dfcf0723a 100644
--- a/deploy/dotcom/dev/Dockerfile
+++ b/deploy/dotcom/dev/Dockerfile
@@ -1,4 +1,4 @@
-FROM hexpm/elixir:1.18.4-erlang-28.0.2-debian-trixie-20250811-slim
+FROM hexpm/elixir:1.19.4-erlang-28.2-debian-trixie-20251229-slim
RUN apt-get update && apt-get install -y curl git make build-essential inotify-tools
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
diff --git a/deploy/dotcom/prod/Dockerfile b/deploy/dotcom/prod/Dockerfile
index 549d2ac22a..58f8532032 100644
--- a/deploy/dotcom/prod/Dockerfile
+++ b/deploy/dotcom/prod/Dockerfile
@@ -1,4 +1,4 @@
-FROM hexpm/elixir:1.18.4-erlang-28.0.2-alpine-3.22.1 AS builder
+FROM hexpm/elixir:1.19.4-erlang-28.2-alpine-3.23.2 AS builder
# ENVS AND ARGS
ENV LANG="C.UTF-8" MIX_ENV="prod"
@@ -37,7 +37,7 @@ RUN mix compile
RUN mix phx.digest
RUN mix release
-FROM hexpm/elixir:1.18.4-erlang-28.0.2-alpine-3.22.1
+FROM hexpm/elixir:1.19.4-erlang-28.2-alpine-3.23.2
ENV PORT=4000 MIX_ENV="prod" PHX_SERVER=true TERM=xterm LANG="C.UTF-8" REPLACE_OS_VARS=true
diff --git a/lib/alerts/alert.ex b/lib/alerts/alert.ex
index a44cc11b22..c7cfcbd239 100644
--- a/lib/alerts/alert.ex
+++ b/lib/alerts/alert.ex
@@ -180,8 +180,8 @@ defmodule Alerts.Alert do
defp build_struct(keywords), do: struct!(__MODULE__, keywords)
@spec ensure_entity_set(map) :: t()
- defp ensure_entity_set(alert) do
- %__MODULE__{alert | informed_entity: InformedEntitySet.new(alert.informed_entity)}
+ defp ensure_entity_set(%__MODULE__{} = alert) do
+ %{alert | informed_entity: InformedEntitySet.new(alert.informed_entity)}
end
@spec all_types :: [effect]
@@ -333,13 +333,13 @@ defmodule Alerts.Alert do
end
defimpl Poison.Encoder, for: Alerts.Alert do
- def encode(%Alerts.Alert{active_period: active_period_pairs} = alert, options) do
- active_period = Enum.map(active_period_pairs, &alert_active_period/1)
+ def encode(%Alerts.Alert{} = alert, options) do
+ alert =
+ Map.update!(alert, :active_period, fn active_period_pairs ->
+ Enum.map(active_period_pairs, &alert_active_period/1)
+ end)
- Poison.Encoder.Map.encode(
- %{alert | active_period: active_period},
- options
- )
+ Poison.Encoder.Map.encode(alert, options)
end
@spec alert_active_period(Alerts.Alert.period_pair()) :: [nil | binary]
diff --git a/lib/dotcom/alerts/subway/disruptions.ex b/lib/dotcom/alerts/subway/disruptions.ex
index 0d664e5936..1bdd37d5cc 100644
--- a/lib/dotcom/alerts/subway/disruptions.ex
+++ b/lib/dotcom/alerts/subway/disruptions.ex
@@ -60,11 +60,11 @@ defmodule Dotcom.Alerts.Subway.Disruptions do
# result is then two alerts, both equivalent to the alert passed in,
# except that one has a single active period of {Sun, Tue}, and the
# other has a single active period of {Thu, Fri}.
- defp split_by_discontiguous_active_periods(alert) do
+ defp split_by_discontiguous_active_periods(%Alerts.Alert{} = alert) do
alert.active_period
|> combine_contiguous_active_periods()
|> Enum.map(fn active_period ->
- %Alerts.Alert{alert | active_period: [active_period]}
+ %{alert | active_period: [active_period]}
end)
end
diff --git a/lib/dotcom/application.ex b/lib/dotcom/application.ex
index 9c30b281df..2ac0a03f89 100644
--- a/lib/dotcom/application.ex
+++ b/lib/dotcom/application.ex
@@ -10,20 +10,8 @@ defmodule Dotcom.Application do
# See http://elixir-lang.org/docs/stable/elixir/Application.html
# for more information on OTP Applications
+ @impl Application
def start(_type, _args) do
- Application.put_env(
- :dotcom,
- :allow_indexing,
- DotcomWeb.ControllerHelpers.environment_allows_indexing?()
- )
-
- # hack to pull the STATIC_SCHEME variable out of the environment
- Application.put_env(
- :dotcom,
- DotcomWeb.Endpoint,
- update_static_url(Application.get_env(:dotcom, DotcomWeb.Endpoint))
- )
-
children =
[
{Application.get_env(:dotcom, :cache, Dotcom.Cache.Multilevel), []},
@@ -61,12 +49,10 @@ defmodule Dotcom.Application do
[
Routes.Supervisor,
Predictions.Supervisor,
- {Phoenix.PubSub, name: Dotcom.PubSub},
Alerts.BusStopChangeSupervisor,
- Alerts.CacheSupervisor
- ] ++
- [
- {DotcomWeb.Endpoint, name: DotcomWeb.Endpoint}
+ Alerts.CacheSupervisor,
+ {Phoenix.PubSub, name: Dotcom.PubSub},
+ DotcomWeb.Endpoint
] ++
if Application.get_env(:dotcom, :env) != :test do
[
@@ -85,24 +71,9 @@ defmodule Dotcom.Application do
# Tell Phoenix to update the endpoint configuration
# whenever the application is updated.
+ @impl Application
def config_change(changed, _new, removed) do
DotcomWeb.Endpoint.config_change(changed, removed)
:ok
end
-
- defp update_static_url([{:static_url, static_url_parts} | rest]) do
- static_url_parts = Keyword.update(static_url_parts, :scheme, nil, &update_static_url_scheme/1)
- [{:static_url, static_url_parts} | update_static_url(rest)]
- end
-
- defp update_static_url([first | rest]) do
- [first | update_static_url(rest)]
- end
-
- defp update_static_url([]) do
- []
- end
-
- defp update_static_url_scheme({:system, env_var}), do: System.get_env(env_var)
- defp update_static_url_scheme(scheme), do: scheme
end
diff --git a/lib/dotcom/trip_plan/open_street_map_reconciler.ex b/lib/dotcom/trip_plan/open_street_map_reconciler.ex
index 291955d010..813362b3e3 100644
--- a/lib/dotcom/trip_plan/open_street_map_reconciler.ex
+++ b/lib/dotcom/trip_plan/open_street_map_reconciler.ex
@@ -58,8 +58,8 @@ defmodule Dotcom.TripPlan.OpenStreetMapReconciler do
"""
@spec reconcile(InputForm.t()) :: InputForm.t()
@spec reconcile(arg) :: arg when arg: var
- def reconcile(%{from: from, to: to} = form) do
- %InputForm{form | from: reconcile_location(from), to: reconcile_location(to)}
+ def reconcile(%InputForm{from: from, to: to} = form) do
+ %{form | from: reconcile_location(from), to: reconcile_location(to)}
end
def reconcile(form), do: form
diff --git a/lib/dotcom_web/controllers/cache_controller.ex b/lib/dotcom_web/controllers/cache_controller.ex
index 16cb26ce2b..fc510d3be0 100644
--- a/lib/dotcom_web/controllers/cache_controller.ex
+++ b/lib/dotcom_web/controllers/cache_controller.ex
@@ -180,7 +180,7 @@ defmodule DotcomWeb.CacheController do
}
end)
- assigns = assign(assigns, links: links)
+ assigns = Phoenix.Controller.assign(assigns, links: links)
~H"""
diff --git a/lib/dotcom_web/controllers/helpers.ex b/lib/dotcom_web/controllers/helpers.ex
index d6cbb3db44..b69816fbac 100644
--- a/lib/dotcom_web/controllers/helpers.ex
+++ b/lib/dotcom_web/controllers/helpers.ex
@@ -158,11 +158,6 @@ defmodule DotcomWeb.ControllerHelpers do
end
end
- @spec environment_allows_indexing?() :: boolean()
- def environment_allows_indexing? do
- System.get_env("ALLOW_INDEXING") == "true"
- end
-
@spec filter_alerts_by_direction([Alert.t()], boolean, String.t() | number | nil) :: [Alert.t()]
defp filter_alerts_by_direction(alerts, false, _), do: alerts
defp filter_alerts_by_direction(alerts, true, nil), do: alerts
diff --git a/lib/dotcom_web/controllers/schedule/line/helpers.ex b/lib/dotcom_web/controllers/schedule/line/helpers.ex
index 8d1d528783..d7914b11c5 100644
--- a/lib/dotcom_web/controllers/schedule/line/helpers.ex
+++ b/lib/dotcom_web/controllers/schedule/line/helpers.ex
@@ -293,9 +293,9 @@ defmodule DotcomWeb.ScheduleController.Line.Helpers do
@spec do_nil_out_shared_stop_branches([RouteStop.t()], MapSet.t(Stop.id_t())) :: [RouteStop.t()]
defp do_nil_out_shared_stop_branches(route_pattern_group, shared_ids) do
- Enum.map(route_pattern_group, fn route_stop ->
+ Enum.map(route_pattern_group, fn %RouteStop{} = route_stop ->
if MapSet.member?(shared_ids, route_stop.id) do
- %RouteStop{
+ %{
route_stop
| branch: nil
}
diff --git a/lib/dotcom_web/endpoint.ex b/lib/dotcom_web/endpoint.ex
index 7becdacdac..25bf756202 100644
--- a/lib/dotcom_web/endpoint.ex
+++ b/lib/dotcom_web/endpoint.ex
@@ -9,13 +9,7 @@ defmodule DotcomWeb.Endpoint do
signing_salt: "TInvb4GN",
secure: true
- socket(
- "/socket",
- DotcomWeb.UserSocket,
- websocket: [check_origin: Application.compile_env(:dotcom, :websocket_check_origin, false)],
- longpoll: [check_origin: Application.compile_env(:dotcom, :websocket_check_origin, false)]
- )
-
+ socket("/socket", DotcomWeb.UserSocket)
socket("/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]])
# Serve at "/" the static files from "priv/static" directory.
diff --git a/lib/location_service/address.ex b/lib/location_service/address.ex
index f63deb6b2e..113f26f10e 100644
--- a/lib/location_service/address.ex
+++ b/lib/location_service/address.ex
@@ -46,7 +46,7 @@ defmodule LocationService.Address do
@spec parse_label(String.t(), %__MODULE__{}) :: %__MODULE__{}
defp parse_label("", address), do: address
- defp parse_label(label, address) do
+ defp parse_label(label, %__MODULE__{} = address) do
%AddressUS.Address{
street: %AddressUS.Street{
name: street_name,
@@ -62,7 +62,7 @@ defmodule LocationService.Address do
|> String.trim()
|> with_place_name(label)
- %__MODULE__{address | street_address: street_address, municipality: city, state: state}
+ %{address | street_address: street_address, municipality: city, state: state}
rescue
_ ->
# Remove first section of label, try again!
diff --git a/lib/predictions/repo.ex b/lib/predictions/repo.ex
index ea70ce8e35..4d8aa5d407 100644
--- a/lib/predictions/repo.ex
+++ b/lib/predictions/repo.ex
@@ -134,8 +134,8 @@ defmodule Predictions.Repo do
defp has_departure_time?(
{_id, _trip_id, _stop_id, _route_id, _direction_id, _arrival, departure, _time,
- _stop_sequence, _schedule_relationship, _track, _status, _departing?,
- _vehicle_id} = _prediction
+ _stop_sequence, _schedule_relationship, _track, _status, _departing?, _vehicle_id} =
+ _prediction
) do
departure != nil
end
diff --git a/lib/stops/route_stop.ex b/lib/stops/route_stop.ex
index 13f5fe98ce..44fad736bc 100644
--- a/lib/stops/route_stop.ex
+++ b/lib/stops/route_stop.ex
@@ -349,8 +349,8 @@ defmodule Stops.RouteStop do
{first_last, first_body} = List.pop_at(first, -1)
first_body ++
- [%RouteStop{first_last | terminus?: false}] ++
- (second |> tl() |> Enum.map(&%RouteStop{&1 | branch: branch(first)}))
+ [%{first_last | terminus?: false}] ++
+ (second |> tl() |> Enum.map(&%{&1 | branch: branch(first)}))
end
@spec branch([RouteStop.t()]) :: RouteStop.branch_name_t()
diff --git a/mix.exs b/mix.exs
index 936352da75..ce14ef6ad7 100644
--- a/mix.exs
+++ b/mix.exs
@@ -15,12 +15,6 @@ defmodule DotCom.Mixfile do
# used by `mix app.start` to start the application and children in permanent mode, which guarantees the node will shut down if the application terminates (typically because its root supervisor has terminated).
start_permanent: Mix.env() == :prod,
test_coverage: [tool: ExCoveralls],
- preferred_cli_env: [
- coveralls: :test,
- "coveralls.html": :test,
- "gettext.extract": :prod,
- "gettext.translate": :prod
- ],
dialyzer: [
plt_add_apps: [:mix, :phoenix_live_reload, :mbta_metro],
flags: [:unmatched_returns]
@@ -36,6 +30,17 @@ defmodule DotCom.Mixfile do
]
end
+ def cli do
+ [
+ preferred_envs: [
+ coveralls: :test,
+ "coveralls.html": :test,
+ "gettext.extract": :prod,
+ "gettext.translate": :prod
+ ]
+ ]
+ end
+
# Specifies which paths to compile per environment.
defp elixirc_paths(:dev),
do: [
@@ -60,7 +65,7 @@ defmodule DotCom.Mixfile do
if Mix.env() == :prod do
[:sasl | extra_apps]
else
- extra_apps
+ [:wx, :observer | extra_apps]
end
[
@@ -94,7 +99,7 @@ defmodule DotCom.Mixfile do
{:csv, "3.2.2"},
{:cva, "0.2.2"},
{:decorator, "1.4.0"},
- {:dialyxir, "1.4.6", [only: [:dev, :test], runtime: false]},
+ {:dialyxir, "1.4.7", [only: [:dev, :test], runtime: false]},
{:diskusage_logger, "0.2.0"},
{:ecto, "3.13.4"},
{:eextoheex, git: "https://github.com/Multiverse-io/eextoheex", only: [:dev, :test]},
@@ -135,7 +140,7 @@ defmodule DotCom.Mixfile do
[github: "mbta/open_trip_planner_client", tag: "v0.17.1"]
},
{:parallel_stream, "1.1.0"},
- {:phoenix, "1.8.1", override: true},
+ {:phoenix, "1.8.3", override: true},
{:phoenix_ecto, "4.6.5"},
{:phoenix_html_helpers, "1.0.1"},
{:phoenix_live_dashboard, "0.8.7"},
diff --git a/mix.lock b/mix.lock
index 85e21cb0fd..c83d7c2432 100644
--- a/mix.lock
+++ b/mix.lock
@@ -5,7 +5,7 @@
"aws": {:hex, :aws, "1.0.9", "0903450e64160a3841acebccb245e9889679e95403a60c32afad1c8e58e1becc", [:mix], [{:aws_signature, "~> 0.3", [hex: :aws_signature, repo: "hexpm", optional: false]}, {:finch, "~> 0.13", [hex: :finch, repo: "hexpm", optional: true]}, {:hackney, "~> 1.20", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8115ff5b5f6ac159f8c9b0ecd3477a94b30409fe8ed8e3ca55d587357c3b7c0d"},
"aws_credentials": {:hex, :aws_credentials, "1.0.2", "8638bfb8776640a1fa2c49bb5d0cdbbf0651560e27025f01cb4e20b918f507b6", [:rebar3], [{:eini, "~> 2.2.5", [hex: :eini_beam, repo: "hexpm", optional: false]}, {:iso8601, "~> 1.3.4", [hex: :iso8601, repo: "hexpm", optional: false]}, {:jsx, "~> 3.1.0", [hex: :jsx, repo: "hexpm", optional: false]}], "hexpm", "6f9f9492a4a6ee77cdce618b2fcdcd71b75e8575a2bd3a58da5a3831c31d48a0"},
"aws_signature": {:hex, :aws_signature, "0.4.0", "0dfc06d47f204ec13873d8f8fe6df38f3b0aa9ffdfd5764d66999e09c73a5eeb", [:rebar3], [], "hexpm", "1e02cc39234e84a083570e0a437ba301792f58928b677e8fd01a44ae8d5c6ee8"},
- "bandit": {:hex, :bandit, "1.8.0", "c2e93d7e3c5c794272fa4623124f827c6f24b643acc822be64c826f9447d92fb", [:mix], [{:hpax, "~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.18", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "8458ff4eed20ff2a2ea69d4854883a077c33ea42b51f6811b044ceee0fa15422"},
+ "bandit": {:hex, :bandit, "1.10.0", "f8293b4a4e6c06b31655ae10bd3462f59d8c5dbd1df59028a4984f10c5961147", [:mix], [{:hpax, "~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.18", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "43ebceb7060a4d8273e47d83e703d01b112198624ba0826980caa3f5091243c4"},
"briefly": {:hex, :briefly, "0.5.1", "ee10d48da7f79ed2aebdc3e536d5f9a0c3e36ff76c0ad0d4254653a152b13a8a", [:mix], [], "hexpm", "bd684aa92ad8b7b4e0d92c31200993c4bc1469fc68cd6d5f15144041bd15cb57"},
"browser": {:hex, :browser, "0.5.5", "9ce8065adfa9e30c9f6ccc7d6d7f0a1a7d4e99ed9989c3d9ef457ba0d47b0ced", [:mix], [{:plug, "~> 1.2", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "f3348ee357d9acd765a7dba9f685337385912cc03fa10a79dbe7643487ed2db4"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
@@ -26,7 +26,7 @@
"cva": {:hex, :cva, "0.2.2", "19ff3fe93c796250f2a3946930e5be62e73019e927aa21c70fcd3c64e9b58466", [:mix], [{:phoenix_live_view, ">= 0.18.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "cb494f3df0bf4a8c1b3652d052d0c4dc5111ef6981f542cc22210f639bfbfcda"},
"decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
"decorator": {:hex, :decorator, "1.4.0", "a57ac32c823ea7e4e67f5af56412d12b33274661bb7640ec7fc882f8d23ac419", [:mix], [], "hexpm", "0a07cedd9083da875c7418dea95b78361197cf2bf3211d743f6f7ce39656597f"},
- "dialyxir": {:hex, :dialyxir, "1.4.6", "7cca478334bf8307e968664343cbdb432ee95b4b68a9cba95bdabb0ad5bdfd9a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "8cf5615c5cd4c2da6c501faae642839c8405b49f8aa057ad4ae401cb808ef64d"},
+ "dialyxir": {:hex, :dialyxir, "1.4.7", "dda948fcee52962e4b6c5b4b16b2d8fa7d50d8645bbae8b8685c3f9ecb7f5f4d", [:mix], [{:erlex, ">= 0.2.8", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b34527202e6eb8cee198efec110996c25c5898f43a4094df157f8d28f27d9efe"},
"digital_token": {:hex, :digital_token, "1.0.0", "454a4444061943f7349a51ef74b7fb1ebd19e6a94f43ef711f7dae88c09347df", [:mix], [{:cldr_utils, "~> 2.17", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "8ed6f5a8c2fa7b07147b9963db506a1b4c7475d9afca6492136535b064c9e9e6"},
"diskusage_logger": {:hex, :diskusage_logger, "0.2.0", "04fc48b538fe4de43153542a71ea94f623d54707d85844123baacfceedf625c3", [:mix], [], "hexpm", "e3f2aed1b0fc4590931c089a6453a4c4eb4c945912aa97bcabcc0cff7851f34d"},
"earmark": {:hex, :earmark, "1.4.48", "5f41e579d85ef812351211842b6e005f6e0cef111216dea7d4b9d58af4608434", [:mix], [], "hexpm", "a461a0ddfdc5432381c876af1c86c411fd78a25790c75023c7a4c035fdc858f9"},
@@ -37,7 +37,7 @@
"ehmon": {:git, "https://github.com/mbta/ehmon.git", "1fb603262bd02d74a16183bd8f344dcace9d7561", []},
"eini": {:hex, :eini_beam, "2.2.5", "28fa0a4eb7ff885cc388877b73fbd56fcca3b2eae4d81e47c47f317b900da1da", [:rebar3], [], "hexpm", "511e9207649f3becb5d945f1813615987899cf78fa130f92be07193a6a74ecb8"},
"elixir_make": {:hex, :elixir_make, "0.9.0", "6484b3cd8c0cee58f09f05ecaf1a140a8c97670671a6a0e7ab4dc326c3109726", [:mix], [], "hexpm", "db23d4fd8b757462ad02f8aa73431a426fe6671c80b200d9710caf3d1dd0ffdb"},
- "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
+ "erlex": {:hex, :erlex, "0.2.8", "cd8116f20f3c0afe376d1e8d1f0ae2452337729f68be016ea544a72f767d9c12", [:mix], [], "hexpm", "9d66ff9fedf69e49dc3fd12831e12a8a37b76f8651dd21cd45fcf5561a8a7590"},
"esbuild": {:hex, :esbuild, "0.10.0", "b0aa3388a1c23e727c5a3e7427c932d89ee791746b0081bbe56103e9ef3d291f", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "468489cda427b974a7cc9f03ace55368a83e1a7be12fba7e30969af78e5f8c70"},
"ex_cldr": {:hex, :ex_cldr, "2.43.2", "92370062f72d8efbeba3a7dc60a331fbb70f061cbc87041cb9f3c6701c6e2ddc", [:mix], [{:cldr_utils, "~> 2.28", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.19 or ~> 1.0", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: true]}], "hexpm", "095137a7bd081166f77d23291b0649db2136ca013245cb73955fb0515031272a"},
"ex_cldr_calendars": {:hex, :ex_cldr_calendars, "2.3.1", "af2865be88f94590973a9899627521931de36c88a04accb10b73e8dc7fb1e0dd", [:mix], [{:calendar_interval, "~> 0.2", [hex: :calendar_interval, repo: "hexpm", optional: true]}, {:ex_cldr_lists, "~> 2.10", [hex: :ex_cldr_lists, repo: "hexpm", optional: true]}, {:ex_cldr_numbers, "~> 2.34", [hex: :ex_cldr_numbers, repo: "hexpm", optional: false]}, {:ex_cldr_units, "~> 3.18", [hex: :ex_cldr_units, repo: "hexpm", optional: true]}, {:ex_doc, "~> 0.21", [hex: :ex_doc, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "42d24fe2ff5316b4d2425f14aeae320886dccdf42060493d6ddfa05f518caf53"},
@@ -103,7 +103,7 @@
"open_trip_planner_client": {:git, "https://github.com/mbta/open_trip_planner_client.git", "ac3fbf50599cb8cec3c7cd68faf6c5444fa1dfe5", [tag: "v0.17.1"]},
"parallel_stream": {:hex, :parallel_stream, "1.1.0", "f52f73eb344bc22de335992377413138405796e0d0ad99d995d9977ac29f1ca9", [:mix], [], "hexpm", "684fd19191aedfaf387bbabbeb8ff3c752f0220c8112eb907d797f4592d6e871"},
"parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"},
- "phoenix": {:hex, :phoenix, "1.8.1", "865473a60a979551a4879db79fbfb4503e41cd809e77c85af79716578b6a456d", [:mix], [{:bandit, "~> 1.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "84d77d2b2e77c3c7e7527099bd01ef5c8560cd149c036d6b3a40745f11cd2fb2"},
+ "phoenix": {:hex, :phoenix, "1.8.3", "49ac5e485083cb1495a905e47eb554277bdd9c65ccb4fc5100306b350151aa95", [:mix], [{:bandit, "~> 1.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "36169f95cc2e155b78be93d9590acc3f462f1e5438db06e6248613f27c80caec"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.6.5", "c4ef322acd15a574a8b1a08eff0ee0a85e73096b53ce1403b6563709f15e1cea", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.1", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "26ec3208eef407f31b748cadd044045c6fd485fbff168e35963d2f9dfff28d4b"},
"phoenix_html": {:hex, :phoenix_html, "4.3.0", "d3577a5df4b6954cd7890c84d955c470b5310bb49647f0a114a6eeecc850f7ad", [:mix], [], "hexpm", "3eaa290a78bab0f075f791a46a981bbe769d94bc776869f4f3063a14f30497ad"},
"phoenix_html_helpers": {:hex, :phoenix_html_helpers, "1.0.1", "7eed85c52eff80a179391036931791ee5d2f713d76a81d0d2c6ebafe1e11e5ec", [:mix], [{:phoenix_html, "~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "cffd2385d1fa4f78b04432df69ab8da63dc5cf63e07b713a4dcf36a3740e3090"},
@@ -148,7 +148,7 @@
"telemetry_registry": {:hex, :telemetry_registry, "0.3.2", "701576890320be6428189bff963e865e8f23e0ff3615eade8f78662be0fc003c", [:mix, :rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e7ed191eb1d115a3034af8e1e35e4e63d5348851d556646d46ca3d1b4e16bab9"},
"telemetry_test": {:hex, :telemetry_test, "0.1.2", "122d927567c563cf57773105fa8104ae4299718ec2cbdddcf6776562c7488072", [:mix], [{:telemetry, "~> 1.2", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7bd41a49ecfd33ecd82d2c7edae19a5736f0d2150206d0ee290dcf3885d0e14d"},
"tesla": {:hex, :tesla, "1.15.3", "3a2b5c37f09629b8dcf5d028fbafc9143c0099753559d7fe567eaabfbd9b8663", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:finch, "~> 0.13", [hex: :finch, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, ">= 1.0.0", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.21", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "4.4.2", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:mox, "~> 1.0", [hex: :mox, repo: "hexpm", optional: true]}, {:msgpax, "~> 2.3", [hex: :msgpax, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "98bb3d4558abc67b92fb7be4cd31bb57ca8d80792de26870d362974b58caeda7"},
- "thousand_island": {:hex, :thousand_island, "1.4.2", "735fa783005d1703359bbd2d3a5a3a398075ba4456e5afe3c5b7cf4666303d36", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1c7637f16558fc1c35746d5ee0e83b18b8e59e18d28affd1f2fa1645f8bc7473"},
+ "thousand_island": {:hex, :thousand_island, "1.4.3", "2158209580f633be38d43ec4e3ce0a01079592b9657afff9080d5d8ca149a3af", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6e4ce09b0fd761a58594d02814d40f77daff460c48a7354a15ab353bb998ea0b"},
"timex": {:git, "https://github.com/bitwalker/timex.git", "cc649c7a586f1266b17d57aff3c6eb1a56116ca2", [branch: "main"]},
"topo": {:hex, :topo, "1.0.3", "8073215c392ad0aced6505a5a281da4af613f5608f6db826635b96fe7a2f4240", [:mix], [{:geo, "~> 3.1 or ~> 4.0", [hex: :geo, repo: "hexpm", optional: false]}, {:seg_seg, "~> 1.0", [hex: :seg_seg, repo: "hexpm", optional: false]}, {:vector, "~> 1.0", [hex: :vector, repo: "hexpm", optional: false]}], "hexpm", "d37720895ec08848d33960deb94f00254834e0a2398618461b800f142c84577c"},
"typed_ecto_schema": {:hex, :typed_ecto_schema, "0.4.3", "1e5f3b6c763f9b5725975d3ab7f1554525f1f1399b966f2425acf04f9d8dd4fe", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}], "hexpm", "dcbd9b35b9fda5fa9258e0ae629a99cf4473bd7adfb85785d3f71dfe7a9b2bc0"},
diff --git a/test/dotcom_web/controllers/helpers_test.exs b/test/dotcom_web/controllers/helpers_test.exs
index dc066164c7..9d6194c9e1 100644
--- a/test/dotcom_web/controllers/helpers_test.exs
+++ b/test/dotcom_web/controllers/helpers_test.exs
@@ -413,31 +413,6 @@ defmodule DotcomWeb.ControllerHelpersTest do
assert Enum.map(green_routes(), & &1.id) == ["Green-B", "Green-C", "Green-D", "Green-E"]
end
- describe "environment_allows_indexing?/0" do
- setup do
- old_value = System.get_env("ALLOW_INDEXING")
-
- on_exit(fn ->
- if old_value do
- System.put_env("ALLOW_INDEXING", old_value)
- end
- end)
- end
-
- test "returns true if system environment variable is true" do
- System.put_env("ALLOW_INDEXING", "true")
- assert environment_allows_indexing?()
- end
-
- test "returns false otherwise" do
- System.put_env("ALLOW_INDEXING", "false")
- refute environment_allows_indexing?()
-
- System.delete_env("ALLOW_INDEXING")
- refute environment_allows_indexing?()
- end
- end
-
test "call_plug_with_opts/3", %{conn: conn} do
conn =
call_plug_with_opts(conn, DotcomWeb.Plugs.BannerMessage,
diff --git a/test/dotcom_web/controllers/schedule/trip_info_test.exs b/test/dotcom_web/controllers/schedule/trip_info_test.exs
index bfa03fb95d..e637d0eb60 100644
--- a/test/dotcom_web/controllers/schedule/trip_info_test.exs
+++ b/test/dotcom_web/controllers/schedule/trip_info_test.exs
@@ -157,7 +157,7 @@ defmodule DotcomWeb.ScheduleController.TripInfoTest do
time: List.last(@schedules).time
}
])
- |> Enum.map(&%Schedule{&1 | trip: %Trip{id: "long_trip"}})
+ |> Enum.map(&%{&1 | trip: %Trip{id: "long_trip"}})
end
defp trip_fn("not_in_schedule", date: @date) do
@@ -218,7 +218,7 @@ defmodule DotcomWeb.ScheduleController.TripInfoTest do
test "assigns trip_info when origin/destination are selected", %{conn: conn} do
expect(Predictions.Repo.Mock, :all, fn trip: trip_id ->
- Enum.map(@predictions, &%Prediction{&1 | trip: %Trip{id: trip_id}})
+ Enum.map(@predictions, &%{&1 | trip: %Trip{id: trip_id}})
end)
expected_stops = ["after_first", "1", "2", "3", "new_last"]
@@ -240,7 +240,7 @@ defmodule DotcomWeb.ScheduleController.TripInfoTest do
test "returns nil if we can't generate a trip info", %{conn: conn} do
expect(Predictions.Repo.Mock, :all, fn trip: trip_id ->
- Enum.map(@predictions, &%Prediction{&1 | trip: %Trip{id: trip_id}})
+ Enum.map(@predictions, &%{&1 | trip: %Trip{id: trip_id}})
end)
conn =
@@ -258,7 +258,7 @@ defmodule DotcomWeb.ScheduleController.TripInfoTest do
test "does not redirect if we didn't have a trip already", %{conn: conn} do
expect(Predictions.Repo.Mock, :all, fn trip: trip_id ->
- Enum.map(@predictions, &%Prediction{&1 | trip: %Trip{id: trip_id}})
+ Enum.map(@predictions, &%{&1 | trip: %Trip{id: trip_id}})
end)
conn = conn_builder(conn, @schedules, origin: "fake", destination: "fake")
@@ -296,7 +296,7 @@ defmodule DotcomWeb.ScheduleController.TripInfoTest do
test "Trip predictions are fetched if date is service day", %{conn: conn} do
expect(Predictions.Repo.Mock, :all, fn trip: trip_id ->
- Enum.map(@predictions, &%Prediction{&1 | trip: %Trip{id: trip_id}})
+ Enum.map(@predictions, &%{&1 | trip: %Trip{id: trip_id}})
end)
conn =
@@ -348,7 +348,7 @@ defmodule DotcomWeb.ScheduleController.TripInfoTest do
test "Default Trip id is taken from journeys if one is not provided", %{conn: conn} do
expect(Predictions.Repo.Mock, :all, fn trip: trip_id ->
- Enum.map(@predictions, &%Prediction{&1 | trip: %Trip{id: trip_id}})
+ Enum.map(@predictions, &%{&1 | trip: %Trip{id: trip_id}})
end)
schedules = [
@@ -388,7 +388,7 @@ defmodule DotcomWeb.ScheduleController.TripInfoTest do
test "does assign trips for the subway if the date is today", %{conn: conn} do
expect(Predictions.Repo.Mock, :all, fn trip: trip_id ->
- Enum.map(@predictions, &%Prediction{&1 | trip: %Trip{id: trip_id}})
+ Enum.map(@predictions, &%{&1 | trip: %Trip{id: trip_id}})
end)
schedules = [
@@ -561,7 +561,7 @@ defmodule DotcomWeb.ScheduleController.TripInfoTest do
describe "test that wollaston station is properly inserted when expected" do
test "Does not add Wollaston to non Red line routes", %{conn: conn} do
expect(Predictions.Repo.Mock, :all, fn trip: "non-red-trip" ->
- Enum.map(@non_red_predictions, &%Prediction{&1 | trip: %Trip{id: "non-red-trip"}})
+ Enum.map(@non_red_predictions, &%{&1 | trip: %Trip{id: "non-red-trip"}})
end)
init = init(trip_fn: &trip_fn/2, vehicle_fn: &vehicle_fn/1)
diff --git a/test/dotcom_web/live/commuter_rail_alerts_text.exs b/test/dotcom_web/live/commuter_rail_alerts_test.exs
similarity index 96%
rename from test/dotcom_web/live/commuter_rail_alerts_text.exs
rename to test/dotcom_web/live/commuter_rail_alerts_test.exs
index 24e7c7d398..679767e649 100644
--- a/test/dotcom_web/live/commuter_rail_alerts_text.exs
+++ b/test/dotcom_web/live/commuter_rail_alerts_test.exs
@@ -27,6 +27,7 @@ defmodule DotcomWeb.Live.CommuterRailAlertsTest do
stub(Alerts.Repo.Mock, :banner, fn -> nil end)
stub(Alerts.Repo.Mock, :by_route_ids, fn _, _ -> [] end)
stub(Routes.Repo.Mock, :by_type, fn _ -> [] end)
+ stub(Dotcom.Alerts.AffectedStops.Mock, :affected_stops, fn _ -> [] end)
stub(Routes.Repo.Mock, :all, fn ->
[Factories.Routes.Route.build(:route, type: @cr_route_type)]
@@ -40,6 +41,12 @@ defmodule DotcomWeb.Live.CommuterRailAlertsTest do
]
end)
+ Dotcom.SystemStatus.CommuterRailCache.Mock
+ |> stub(:commuter_rail_status, fn ->
+ []
+ end)
+ |> stub(:subscribe, fn -> :ok end)
+
:ok
end
diff --git a/test/dotcom_web/plugs/canonical_hostname_test.exs b/test/dotcom_web/plugs/canonical_hostname_test.exs
index 2a05ea8113..433291f3c2 100644
--- a/test/dotcom_web/plugs/canonical_hostname_test.exs
+++ b/test/dotcom_web/plugs/canonical_hostname_test.exs
@@ -7,26 +7,26 @@ defmodule DotcomWeb.Plugs.CanonicalHostnameTest do
describe "call/2" do
test "with a local IP address, does nothing" do
# Class A
- conn = %Plug.Conn{default_conn() | host: "10.127.127.127"}
+ conn = %{default_conn() | host: "10.127.127.127"}
assert conn.status != 301
conn = CanonicalHostname.call(conn, nil)
assert conn.status != 301
# Class B
- conn = %Plug.Conn{default_conn() | host: "172.24.127.127"}
+ conn = %{default_conn() | host: "172.24.127.127"}
assert conn.status != 301
conn = CanonicalHostname.call(conn, nil)
assert conn.status != 301
# Class C
- conn = %Plug.Conn{default_conn() | host: "192.168.127.127"}
+ conn = %{default_conn() | host: "192.168.127.127"}
assert conn.status != 301
conn = CanonicalHostname.call(conn, nil)
assert conn.status != 301
end
test "when the hostname doesn't match the canonical hostname, redirects" do
- conn = %Plug.Conn{default_conn() | host: "example.com"}
+ conn = %{default_conn() | host: "example.com"}
assert conn.status != 301
conn = CanonicalHostname.call(conn, nil)
diff --git a/test/predicted_schedule_test.exs b/test/predicted_schedule_test.exs
index b87c11170f..c76da632c7 100644
--- a/test/predicted_schedule_test.exs
+++ b/test/predicted_schedule_test.exs
@@ -318,10 +318,7 @@ defmodule PredictedScheduleTest do
modified_trip_schedules =
@trip_schedules
|> Enum.map(fn schedule ->
- %Schedule{
- schedule
- | stop: nil
- }
+ %{schedule | stop: nil}
end)
assert group(@trip_predictions, modified_trip_schedules)
diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex
index 24dbbb8798..1312a555dd 100644
--- a/test/support/conn_case.ex
+++ b/test/support/conn_case.ex
@@ -16,10 +16,8 @@ defmodule DotcomWeb.ConnCase do
use ExUnit.CaseTemplate
def default_conn do
- %Plug.Conn{
- Phoenix.ConnTest.build_conn()
- | host: "localhost"
- }
+ Phoenix.ConnTest.build_conn()
+ |> Map.put(:host, "localhost")
end
using do