mirror of
https://github.com/plausible/analytics.git
synced 2024-10-03 20:57:50 +03:00
update runtime to elixir-1.17.1 and erlang-27.0 (#4255)
* update runtime to elixir-1.17.1 and erlang-27.0 * update credo * fix some warnings in tests * temp fix (backport) --------- Co-authored-by: hq1 <hq@mtod.org>
This commit is contained in:
parent
c09789b36f
commit
5a0718aa75
@ -1,3 +1,3 @@
|
||||
erlang 26.2.1
|
||||
elixir 1.16.0-otp-26
|
||||
erlang 27.0
|
||||
elixir 1.17.1-otp-27
|
||||
nodejs 21.0.0
|
||||
|
@ -2,7 +2,7 @@
|
||||
# platform specific, it makes sense to build it in the docker
|
||||
|
||||
#### Builder
|
||||
FROM hexpm/elixir:1.16.0-erlang-26.2.1-alpine-3.18.4 as buildcontainer
|
||||
FROM hexpm/elixir:1.17.1-erlang-27.0-alpine-3.18.6 as buildcontainer
|
||||
|
||||
ARG MIX_ENV=ce
|
||||
|
||||
@ -54,7 +54,7 @@ COPY rel rel
|
||||
RUN mix release plausible
|
||||
|
||||
# Main Docker Image
|
||||
FROM alpine:3.18.4
|
||||
FROM alpine:3.18.6
|
||||
LABEL maintainer="plausible.io <hello@plausible.io>"
|
||||
|
||||
ARG BUILD_METADATA={}
|
||||
|
@ -330,7 +330,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do
|
||||
defp losing_features_message(features_to_lose) do
|
||||
features_list_str =
|
||||
features_to_lose
|
||||
|> Enum.map(& &1.display_name)
|
||||
|> Enum.map(fn feature_mod -> feature_mod.display_name() end)
|
||||
|> PlausibleWeb.TextHelpers.pretty_join()
|
||||
|
||||
"This plan does not support #{features_list_str}, which you are currently using. Please note that by subscribing to this plan you will lose access to #{if length(features_to_lose) == 1, do: "this feature", else: "these features"}."
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
<%= if ee?() do %>
|
||||
<p class="text-center text-gray-500 text-xs py-8">
|
||||
© <%= DateTime.utc_now().year() %> Plausible Analytics. All rights reserved.
|
||||
© <%= DateTime.utc_now().year %> Plausible Analytics. All rights reserved.
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
|
4
mix.exs
4
mix.exs
@ -8,7 +8,7 @@ defmodule Plausible.MixProject do
|
||||
docs: docs(),
|
||||
app: :plausible,
|
||||
version: System.get_env("APP_VERSION", "0.0.1"),
|
||||
elixir: "~> 1.14",
|
||||
elixir: "~> 1.17",
|
||||
elixirc_paths: elixirc_paths(Mix.env()),
|
||||
start_permanent: Mix.env() in [:prod, :ce],
|
||||
aliases: aliases(),
|
||||
@ -126,7 +126,7 @@ defmodule Plausible.MixProject do
|
||||
{:ua_inspector, "~> 3.0"},
|
||||
{:ex_doc, "~> 0.28", only: :dev, runtime: false},
|
||||
{:ex_money, "~> 5.12"},
|
||||
{:mjml_eex, "~> 0.9.0"},
|
||||
{:mjml_eex, "~> 0.11.0"},
|
||||
{:mjml, "~> 1.5.0"},
|
||||
{:heroicons, "~> 0.5.0"},
|
||||
{:zxcvbn, git: "https://github.com/techgaun/zxcvbn-elixir.git"},
|
||||
|
4
mix.lock
4
mix.lock
@ -23,7 +23,7 @@
|
||||
"cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"},
|
||||
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
|
||||
"cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"},
|
||||
"credo": {:hex, :credo, "1.7.3", "05bb11eaf2f2b8db370ecaa6a6bda2ec49b2acd5e0418bc106b73b07128c0436", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "35ea675a094c934c22fb1dca3696f3c31f2728ae6ef5a53b5d648c11180a4535"},
|
||||
"credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"},
|
||||
"csv": {:hex, :csv, "2.5.0", "c47b5a5221bf2e56d6e8eb79e77884046d7fd516280dc7d9b674251e0ae46246", [:mix], [{:parallel_stream, "~> 1.0.4 or ~> 1.1.0", [hex: :parallel_stream, repo: "hexpm", optional: false]}], "hexpm", "e821f541487045c7591a1963eeb42afff0dfa99bdcdbeb3410795a2f59c77d34"},
|
||||
"ctx": {:hex, :ctx, "0.6.0", "8ff88b70e6400c4df90142e7f130625b82086077a45364a78d208ed3ed53c7fe", [:rebar3], [], "hexpm", "a14ed2d1b67723dbebbe423b28d7615eb0bdcba6ff28f2d1f1b0a7e1d4aa5fc2"},
|
||||
"db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"},
|
||||
@ -83,7 +83,7 @@
|
||||
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
|
||||
"mint": {:hex, :mint, "1.6.0", "88a4f91cd690508a04ff1c3e28952f322528934be541844d54e0ceb765f01d5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "3c5ae85d90a5aca0a49c0d8b67360bbe407f3b54f1030a111047ff988e8fefaa"},
|
||||
"mjml": {:hex, :mjml, "1.5.0", "20a4ed2490a60c6928d45a69b64fb45ce8d8bdac686ef689315b0adda69c6406", [:mix], [{:rustler, ">= 0.0.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.6.0", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "44dc36c0fccf52eeb8e0afcb26a863ba41a5f9adcb71bb32e084619a13bb4cdf"},
|
||||
"mjml_eex": {:hex, :mjml_eex, "0.9.1", "102b6b6e57bfd6db01e0feef801b573fcddb1ee34effb884695da8407544a5be", [:mix], [{:erlexec, "~> 2.0", [hex: :erlexec, repo: "hexpm", optional: true]}, {:mjml, "~> 1.5.0", [hex: :mjml, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.2", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "310f9364d4f1126170835db6fb8dad87e393b28860b0e710d870812fb0bd7892"},
|
||||
"mjml_eex": {:hex, :mjml_eex, "0.11.0", "f0845730f4caccddea7c98ab5ad1485831446b7c09896fa5ed54b3fa0c431e72", [:mix], [{:erlexec, "~> 2.0", [hex: :erlexec, repo: "hexpm", optional: true]}, {:mjml, "~> 1.0 or ~> 2.0 or ~> 3.0", [hex: :mjml, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.2 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0c60732fe766336ec504a94cad4ebf30405f05fa8920a544ff0ef936252438ac"},
|
||||
"mox": {:hex, :mox, "1.1.0", "0f5e399649ce9ab7602f72e718305c0f9cdc351190f72844599545e4996af73c", [:mix], [], "hexpm", "d44474c50be02d5b72131070281a5d3895c0e7a95c780e90bc0cfe712f633a13"},
|
||||
"mua": {:hex, :mua, "0.2.0", "ca7e7a00848719c95c6f72094b41e7b9af1ad85048b948d696d6a8f9e31dcdd3", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "b8dc60683ff03ca85359ecd83db7f7da66cf2eada1289e0bb531b0724702c09a"},
|
||||
"nanoid": {:hex, :nanoid, "2.1.0", "d192a5bf1d774258bc49762b480fca0e3128178fa6d35a464af2a738526607fd", [:mix], [], "hexpm", "ebc7a342d02d213534a7f93a091d569b9fea7f26fcd3a638dc655060fc1f76ac"},
|
||||
|
@ -1,6 +1,6 @@
|
||||
defmodule PlausibleWeb.Components.Billing.NoticeTest do
|
||||
use Plausible.DataCase
|
||||
import Phoenix.LiveViewTest
|
||||
import Plausible.LiveViewTest, only: [render_component: 2]
|
||||
alias PlausibleWeb.Components.Billing.Notice
|
||||
|
||||
test "premium_feature/1 does not render a notice when user is on trial" do
|
||||
|
@ -1241,8 +1241,8 @@ defmodule PlausibleWeb.Api.StatsController.MainGraphTest do
|
||||
end
|
||||
end
|
||||
|
||||
@tag :ee_only
|
||||
describe "GET /api/stats/main-graph - total_revenue plot" do
|
||||
@describetag :ee_only
|
||||
setup [:create_user, :log_in, :create_new_site, :create_legacy_site_import]
|
||||
|
||||
test "plots total_revenue for a month", %{conn: conn, site: site} do
|
||||
@ -1321,8 +1321,8 @@ defmodule PlausibleWeb.Api.StatsController.MainGraphTest do
|
||||
end
|
||||
end
|
||||
|
||||
@tag :ee_only
|
||||
describe "GET /api/stats/main-graph - average_revenue plot" do
|
||||
@describetag :ee_only
|
||||
setup [:create_user, :log_in, :create_new_site, :create_legacy_site_import]
|
||||
|
||||
test "plots total_revenue for a month", %{conn: conn, site: site} do
|
||||
|
@ -1,6 +1,7 @@
|
||||
defmodule PlausibleWeb.Live.Components.ComboBoxTest do
|
||||
use PlausibleWeb.ConnCase, async: true
|
||||
import Phoenix.LiveViewTest
|
||||
import Phoenix.LiveViewTest, except: [render_component: 2]
|
||||
import Plausible.LiveViewTest, only: [render_component: 2]
|
||||
import Plausible.Test.Support.HTML
|
||||
|
||||
alias PlausibleWeb.Live.Components.ComboBox
|
||||
|
@ -1,6 +1,6 @@
|
||||
defmodule PlausibleWeb.Live.Components.FormTest do
|
||||
use PlausibleWeb.ConnCase, async: true
|
||||
import Phoenix.LiveViewTest
|
||||
import Plausible.LiveViewTest, only: [render_component: 2]
|
||||
import Plausible.Test.Support.HTML
|
||||
|
||||
alias Plausible.Auth.User
|
||||
|
@ -1,6 +1,6 @@
|
||||
defmodule PlausibleWeb.Live.Components.VerificationTest do
|
||||
use PlausibleWeb.ConnCase, async: true
|
||||
import Phoenix.LiveViewTest
|
||||
import Plausible.LiveViewTest, only: [render_component: 2]
|
||||
import Plausible.Test.Support.HTML
|
||||
|
||||
@component PlausibleWeb.Live.Components.Verification
|
||||
|
42
test/support/live_view_test_fix.ex
Normal file
42
test/support/live_view_test_fix.ex
Normal file
@ -0,0 +1,42 @@
|
||||
defmodule Plausible.LiveViewTest do
|
||||
@moduledoc """
|
||||
Temporary fix for `Phoenix.LiveViewTest.render_component/2` failing CI with warnings.
|
||||
|
||||
This module can be removed once Plausible switches to `phoenix_live_view ~> 1.0.0`
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Same as `Phoenix.LiveViewTest.render_component/2` but with backported fixes from
|
||||
https://github.com/phoenixframework/phoenix_live_view/commit/489e8de024e03976e9ae38138eec517fbd456d27
|
||||
"""
|
||||
defmacro render_component(component, assigns \\ Macro.escape(%{}), opts \\ []) do
|
||||
endpoint = Module.get_attribute(__CALLER__.module, :endpoint)
|
||||
|
||||
component =
|
||||
if is_atom(component) do
|
||||
quote do
|
||||
unquote(component).__live__()
|
||||
unquote(component)
|
||||
end
|
||||
else
|
||||
component
|
||||
end
|
||||
|
||||
quote do
|
||||
Plausible.LiveViewTest.__render_component__(
|
||||
unquote(endpoint),
|
||||
unquote(component),
|
||||
unquote(assigns),
|
||||
unquote(opts)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def __render_component__(endpoint, component, assigns, opts) when is_atom(component) do
|
||||
Phoenix.LiveViewTest.__render_component__(endpoint, %{module: component}, assigns, opts)
|
||||
end
|
||||
|
||||
def __render_component__(endpoint, component, assigns, opts) do
|
||||
Phoenix.LiveViewTest.__render_component__(endpoint, component, assigns, opts)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user