Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ jobs:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Elixir
uses: actions/setup-elixir@v1
- name: Set up Elixir
id: beam
uses: erlef/setup-beam@v1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-elixir is archived

with:
elixir-version: "1.12.1"
otp-version: "23.0.4"
experimental-otp: true
elixir-version: "1.18.1"
otp-version: "27.3.4"
version-type: strict

- name: Restore dependencies cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
Expand All @@ -35,11 +36,7 @@ jobs:
run: mix format --check-formatted

- name: Run tests
env:
MIX_ENV: test
run: mix test

- name: Run Dialyzer
env:
MIX_ENV: dev
run: mix dialyzer
run: mix dialyzer --format github
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [2.0.1] - 2026-01-28

### Fixed

- Fixed Elixir 1.19 compatibility by removing regex-containing struct default for `filter_body` field. The default value is now applied at runtime via the `default_filter_body/0` function.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## [2.0.0] - 2024-04-29

### Changed
Expand Down
2 changes: 1 addition & 1 deletion lib/segment/analytics/http.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ defmodule Segment.Analytics.HTTP do
@spec meta_logger(Config.t()) :: Keyword.t()
defp meta_logger(%Config{} = config) do
[
filter_body: config.filter_body,
filter_body: config.filter_body || Config.default_filter_body(),
filter_headers: ~w(x-api-key),
log_level: :info,
log_tag: __MODULE__
Expand Down
5 changes: 4 additions & 1 deletion lib/segment/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule Segment.Config do
field :disable_meta_logger, boolean(), default: false
field :drop_nil_fields, boolean(), default: false
field :endpoint, String.t(), default: "https://api.segment.io/v1/"
field :filter_body, Segment.filter_body(), default: @filter_body
field :filter_body, Segment.filter_body()
field :http_adapter, module(), default: Tesla.Adapter.Hackney
field :key, String.t()
field :max_retries, non_neg_integer(), default: 5
Expand All @@ -35,6 +35,9 @@ defmodule Segment.Config do
@spec boolean_keys :: [atom()]
def boolean_keys, do: @boolean_keys

@spec default_filter_body :: Segment.filter_body()
def default_filter_body, do: @filter_body

@spec float_keys :: [atom()]
def float_keys, do: @float_keys

Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule AnalyticsElixir.Mixfile do
app: :segment,
deps: deps(),
description: "analytics_elixir",
elixir: "~> 1.12",
elixir: "~> 1.18",
elixirc_paths: elixirc_paths(Mix.env()),
name: "analytics_elixir",
package: package(),
Expand Down Expand Up @@ -47,7 +47,7 @@ defmodule AnalyticsElixir.Mixfile do
{:ex_doc, "~> 0.28", only: :dev, runtime: false},

# Static analysis
{:dialyxir, "~> 1.1", only: :dev, runtime: false}
{:dialyxir, "~> 1.4", only: :dev, runtime: false}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

]
end

Expand Down
4 changes: 2 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%{
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
"dialyxir": {:hex, :dialyxir, "1.4.7", "dda948fcee52962e4b6c5b4b16b2d8fa7d50d8645bbae8b8685c3f9ecb7f5f4d", [:mix], [{:erlex, ">= 0.2.8", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b34527202e6eb8cee198efec110996c25c5898f43a4094df157f8d28f27d9efe"},
"earmark_parser": {:hex, :earmark_parser, "1.4.22", "1de32345aab0d28bc208314937d2e69ff72ac6cacfdf89b1c0b75fc00283eb56", [:mix], [], "hexpm", "e10a2857c3b5333c503c7f95710c64f0beb2cfaa1d9de024513ad5242dc7cad5"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"erlex": {:hex, :erlex, "0.2.8", "cd8116f20f3c0afe376d1e8d1f0ae2452337729f68be016ea544a72f767d9c12", [:mix], [], "hexpm", "9d66ff9fedf69e49dc3fd12831e12a8a37b76f8651dd21cd45fcf5561a8a7590"},
"ex_doc": {:hex, :ex_doc, "0.28.2", "e031c7d1a9fc40959da7bf89e2dc269ddc5de631f9bd0e326cbddf7d8085a9da", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "51ee866993ffbd0e41c084a7677c570d0fc50cb85c6b5e76f8d936d9587fa719"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"},
Expand Down
Loading