Skip to content

Commit b64a235

Browse files
authored
Platform upgrade: elixir 1.19.4 and otp 27.3.4.6 (#5920)
* Platform upgrade: elixir 1.19.4 and otp 27.3.4.6 * !fixup * credo * credo * Bump cache * fix docker image tag * hum * hum * Match docker images * Define ALPINE_VERSION once * fixup
1 parent 8a7d681 commit b64a235

File tree

22 files changed

+124
-60
lines changed

22 files changed

+124
-60
lines changed

.github/workflows/elixir.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
env:
14-
CACHE_VERSION: v16
14+
CACHE_VERSION: v17
1515
PERSISTENT_CACHE_DIR: cached
1616

1717
jobs:

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
erlang 27.3.1
2-
elixir 1.18.3-otp-27
1+
erlang 27.3.4.6
2+
elixir 1.19.4-otp-27
33
nodejs 23.2.0

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# we can not use the pre-built tar because the distribution is
22
# platform specific, it makes sense to build it in the docker
33

4+
ARG ALPINE_VERSION=3.22.2
5+
46
#### Builder
5-
FROM hexpm/elixir:1.18.3-erlang-27.3.1-alpine-3.21.3 AS buildcontainer
7+
FROM hexpm/elixir:1.19.4-erlang-27.3.4.6-alpine-${ALPINE_VERSION} AS buildcontainer
68

79
ARG MIX_ENV=ce
810

@@ -20,7 +22,7 @@ RUN mkdir /app
2022
WORKDIR /app
2123

2224
# install build dependencies
23-
RUN apk add --no-cache git "nodejs-current=23.2.0-r1" yarn npm python3 ca-certificates wget gnupg make gcc libc-dev brotli
25+
RUN apk add --no-cache git "nodejs-current=23.11.1-r0" yarn npm python3 ca-certificates wget gnupg make gcc libc-dev brotli
2426

2527
COPY mix.exs ./
2628
COPY mix.lock ./
@@ -54,7 +56,7 @@ COPY rel rel
5456
RUN mix release plausible
5557

5658
# Main Docker Image
57-
FROM alpine:3.21.3
59+
FROM alpine:${ALPINE_VERSION}
5860
LABEL maintainer="plausible.io <hello@plausible.io>"
5961

6062
ARG BUILD_METADATA={}
@@ -84,3 +86,4 @@ EXPOSE 8000
8486
ENV DEFAULT_DATA_DIR=/var/lib/plausible
8587
VOLUME /var/lib/plausible
8688
CMD ["run"]
89+

lib/plausible/auth/user.ex

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
defimpl Bamboo.Formatter, for: Plausible.Auth.User do
2-
def format_email_address(user, _opts) do
3-
{user.name, user.email}
4-
end
5-
end
6-
7-
defimpl FunWithFlags.Actor, for: Plausible.Auth.User do
8-
def id(%{id: id}) do
9-
"user:#{id}"
10-
end
11-
end
12-
131
defmodule Plausible.Auth.User do
142
use Plausible
153
use Ecto.Schema
@@ -284,3 +272,15 @@ defmodule Plausible.Auth.User do
284272
end
285273
end
286274
end
275+
276+
defimpl Bamboo.Formatter, for: Plausible.Auth.User do
277+
def format_email_address(user, _opts) do
278+
{user.name, user.email}
279+
end
280+
end
281+
282+
defimpl FunWithFlags.Actor, for: Plausible.Auth.User do
283+
def id(%{id: id}) do
284+
"user:#{id}"
285+
end
286+
end

lib/plausible/google/ga4/api.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ defmodule Plausible.Google.GA4.API do
202202
end
203203
end
204204

205-
defp prepare_request(report_request, date_range, property, access_token) do
205+
defp prepare_request(%GA4.ReportRequest{} = report_request, date_range, property, access_token) do
206206
%GA4.ReportRequest{
207207
report_request
208208
| date_range: date_range,

lib/plausible/shield/country_rule_cache.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ defmodule Plausible.Shield.CountryRuleCache do
4444
|> where([rule, site], rule.country_code == ^country_code and site.domain == ^domain)
4545

4646
case Plausible.Repo.one(query) do
47-
{_, _, rule} -> %CountryRule{rule | from_cache?: false}
47+
{_, _, rule = %CountryRule{}} -> %CountryRule{rule | from_cache?: false}
4848
_any -> nil
4949
end
5050
end

lib/plausible/shield/hostname_rule_cache.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defmodule Plausible.Shield.HostnameRuleCache do
4545

4646
case Plausible.Repo.all(query) do
4747
[_ | _] = results ->
48-
Enum.map(results, fn {_, _, rule} ->
48+
Enum.map(results, fn {_, _, rule = %HostnameRule{}} ->
4949
%HostnameRule{rule | from_cache?: false}
5050
end)
5151

lib/plausible/shield/ip_rule_cache.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ defmodule Plausible.Shield.IPRuleCache do
4444
|> where([rule, site], rule.inet == ^address and site.domain == ^domain)
4545

4646
case Plausible.Repo.one(query) do
47-
{_, _, rule} -> %IPRule{rule | from_cache?: false}
47+
{_, _, rule = %IPRule{}} -> %IPRule{rule | from_cache?: false}
4848
_any -> nil
4949
end
5050
end

lib/plausible/shield/page_rule_cache.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ defmodule Plausible.Shield.PageRuleCache do
4444
|> where([..., site], site.domain == ^domain)
4545

4646
case Plausible.Repo.one(query) do
47-
{_, _, rule} -> %PageRule{rule | from_cache?: false}
47+
{_, _, rule = %PageRule{}} -> %PageRule{rule | from_cache?: false}
4848
_any -> nil
4949
end
5050
end

lib/plausible/site/cache.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ defmodule Plausible.Site.Cache do
6363
query = from s in base_db_query(), where: s.domain == ^domain
6464

6565
case Plausible.Repo.one(query) do
66-
{_, _, site} -> %Site{site | from_cache?: false}
66+
{_, _, site = %Site{}} -> %Site{site | from_cache?: false}
6767
_any -> nil
6868
end
6969
end

0 commit comments

Comments
 (0)