-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🏹 Upgrade Elixir version #1024
🏹 Upgrade Elixir version #1024
Conversation
@@ -56,8 +56,7 @@ if config_env() == :prod do | |||
root_source_code_path: File.cwd!(), | |||
tags: %{ | |||
env: sentry_env | |||
}, | |||
included_environments: [sentry_env] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -285,4 +285,12 @@ defmodule Arrow.DisruptionRevision do | |||
changeset | |||
end | |||
end | |||
|
|||
defp date_range(start_date, end_date) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address new deprecation warnings where it's required to provide a step of -1 if end_date > start_date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the code below is correct but what you meant in this comment was start_date > end_date
for step of -1 (so it enumerates backwards in time from start_date to end_date)
mix.exs
Outdated
{:httpoison, "~> 1.6"}, | ||
{:ja_serializer, github: "mbta/ja_serializer", branch: "master"}, | ||
{:httpoison, "~> 2.2"}, | ||
{:ja_serializer, "~> 0.18.0"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our version of ja_serializer has diverged from upstream, but also not been touched in 3 years. Best I could tell Arrow does not appear to rely on any MBTA specific behaviors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in support of this change since our version hasn't been maintained.
Was this upgrade of ja_serializer
required as part of upgrading the elixir version though?
Can we split this change into it's own separate PR? If we notice any unexpected changes (like with the gtfs_creator build when parsing API results, performance issues with endpoints, whatever), it'd be easier to isolate that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it can be. Some of these depredations were forced since we compile with --warnings-as-errors
in the test phase, but while keeping ja_serializer
generates warnings during tests, it seems to compile happily. I've split it into #1026
@@ -141,18 +134,6 @@ defmodule ArrowWeb.ShapeControllerTest do | |||
assert html_response(conn, 200) =~ "Components.ShapeViewMap" | |||
end | |||
|
|||
@tag :authenticated_admin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was fixed in this pr, that was released in 1.3.0, so these now parse correctly.
@@ -17,7 +17,7 @@ defmodule ArrowWeb.CoreComponents do | |||
use Phoenix.Component | |||
|
|||
alias Phoenix.LiveView.JS | |||
import ArrowWeb.Gettext | |||
use Gettext, backend: ArrowWeb.Gettext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -51,11 +51,6 @@ defmodule ArrowWeb.ShapeController do | |||
conn | |||
|> put_flash(:errors, reason) | |||
|> render(:new_bulk, errors: reason, shapes_upload: reset_upload) | |||
|
|||
error -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dialyzer flags this clause as unreachable, and I agree. parse_kml_from_file
and shapes_from_kml
will always return {:ok, _}
or {:error, _}
, and changeset
will always return a changeset, so will always match.
@@ -14,7 +14,7 @@ defmodule Arrow.MixProject do | |||
releases: releases(), | |||
dialyzer: [ | |||
plt_add_apps: [:mix], | |||
plt_add_deps: :transitive, | |||
plt_add_deps: :app_tree, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6ab824d
to
1356585
Compare
e2dfd6a
to
349fcdf
Compare
flags: [ | ||
:unmatched_returns | ||
], | ||
ignore_warnings: ".dialyzer.ignore-warnings" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dialyzer complained about could not read file stats ".dialyzer_ignore.exs": no such file or directory
as long as this was present. I didn't figure out why, but we also aren't ignoring warnings (.dialyzer.ignore-warnings is blank) so I removed it.
@@ -39,6 +39,7 @@ COPY config/config.exs config/ | |||
COPY config/prod.exs config/ | |||
|
|||
RUN mix deps.compile | |||
RUN mix sentry.package_source_code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -40,7 +40,7 @@ defmodule ArrowWeb.StopControllerTest do | |||
conn = post(conn, ~p"/stops", stop: invalid_attrs) | |||
assert redirected_to(conn) == ~p"/stops/new" | |||
|
|||
assert get_flash(conn, :errors) == | |||
assert conn.assigns.flash["errors"] == |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert conn.assigns.flash["errors"] == | |
assert Phoenix.Flash.get(conn.assigns.flash, :errors) == |
mix.exs
Outdated
{:httpoison, "~> 1.6"}, | ||
{:ja_serializer, github: "mbta/ja_serializer", branch: "master"}, | ||
{:httpoison, "~> 2.2"}, | ||
{:ja_serializer, "~> 0.18.0"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in support of this change since our version hasn't been maintained.
Was this upgrade of ja_serializer
required as part of upgrading the elixir version though?
Can we split this change into it's own separate PR? If we notice any unexpected changes (like with the gtfs_creator build when parsing API results, performance issues with endpoints, whatever), it'd be easier to isolate that way.
349fcdf
to
61d5a89
Compare
61d5a89
to
dbdc2cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@@ -285,4 +285,12 @@ defmodule Arrow.DisruptionRevision do | |||
changeset | |||
end | |||
end | |||
|
|||
defp date_range(start_date, end_date) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the code below is correct but what you meant in this comment was start_date > end_date
for step of -1 (so it enumerates backwards in time from start_date to end_date)
Summary of changes
Asana Ticket: 🏹 Upgrade Elixir version
Reviewer Checklist