-
Notifications
You must be signed in to change notification settings - Fork 768
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 to Phoenix 1.7 #3615
Upgrade to Phoenix 1.7 #3615
Conversation
The minimal changes necessary to compile the application
✅ Deploy Preview for teslamate ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks for your work! At least all 321 test cases still pass :-) |
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.
lgtm
Test cases pass, but linting failed, please format the files correctly, see https://github.com/teslamate-org/teslamate/actions/runs/7523079638/job/20657593930?pr=3615#step:12:9 |
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.
Please lint properly
Thanks for reviewing @JakobLichterfeld CI is passing now. |
Unfortunately not, https://github.com/teslamate-org/teslamate/actions/runs/7602510278/job/20718030463?pr=3615#step:10:10 |
@brianmay can you help with the outdated pot file? https://github.com/teslamate-org/teslamate/actions/runs/7767265925/job/21183920267?pr=3615#step:10:11 Running |
I am not going to be able to update this PR as is, I probably don't have access to the source repo. Apologies if I misunderstood something here ;-) |
I was able to merge our master into his repo.
Do you have a hint how to solve the outdated pot warning? |
The But I am a bit puzzled why we aren't getting errors from the master branch. Unless something is wrong with the pot checks there. |
I linted the files correctly. and the Linting warning about the uncalled function: https://github.com/teslamate-org/teslamate/actions/runs/7789209181/job/21240291393?pr=3615#step:16:34 |
I think that uncalled function warning is a false warning, fetch_settings is used as a plug. Not sure how to make it happy here. Maybe I missed something. |
The other error, I think there is a missing space in the template: diff --git a/lib/teslamate_web/live/car_live/summary.html.heex b/lib/teslamate_web/live/car_live/summary.html.heex
index 70d0b72f..ae9632b1 100644
--- a/lib/teslamate_web/live/car_live/summary.html.heex
+++ b/lib/teslamate_web/live/car_live/summary.html.heex
@@ -272,7 +272,7 @@
<%= unless is_nil(@summary.charge_energy_added) do %>
<tr>
<td class="has-text-weight-medium"><%= gettext("Charged") %></td>
- <td><%= @summary.charge_energy_added %>kWh</td>
+ <td><%= @summary.charge_energy_added %> kWh</td>
</tr>
<% end %>
<%= unless is_nil(@summary.charger_power) do %> This appears to have happened in the "mix format" commit. I can't reproduce this, but something we may need to watch out for. |
Possible solution to the unused function problem, just make the function public: diff --git a/lib/teslamate_web/router.ex b/lib/teslamate_web/router.ex
index 246b47fa..f00d9ea0 100644
--- a/lib/teslamate_web/router.ex
+++ b/lib/teslamate_web/router.ex
@@ -54,7 +54,7 @@ defmodule TeslaMateWeb.Router do
put "/car/:id/logging/suspend", CarController, :suspend_logging
end
- defp fetch_settings(conn, _opts) do
+ def fetch_settings(conn, _opts) do
settings = Settings.get_global_settings!()
conn |
Giving up on this. A whitespace result in test failing, using the unicode character result in failed lint. Assume we need to adopt the test to use the whitespace |
It looks like that worked. Maybe the tests require the unicode whitespace character. |
Using whitespace in html and in test instead of nbsp unicode finally works. |
* Upgrade to phoenix 1.7.0 The minimal changes necessary to compile the application * Import Phoenix.Component instead of LiveView * Fix compilation warnings * mix format * Update tests to trim newline characters * mix gettext.extract --merge * style: correct linting * rebuild gettext * fix: correct spacing before unit for energy added * fix: use unicode character for whitespace * fix: spacing with witespace * fix: use numeric value for charge_energy_added in charging test * fix: avoid warning about unsued function, which is actually used in plug * fix: use whitespace in test before charge_energy_added --------- Co-authored-by: JakobLichterfeld <[email protected]>
Overview
First off of all, thank you for making and maintaining this project! It's extremely useful to me. I'm really happy that it's written in Elixir because I can actually help out 😄
I noticed that the project is still using Phoenix 1.6. I followed the upgrade guide and it was very simple.
I also made a bunch of changes to get rid of all the compile-time warnings.
Testing
I'm not quite sure how to QA these changes. Maybe we could come up with a checklist together?