Skip to content
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 1.15.7 #355

Merged
merged 7 commits into from
Jan 23, 2024
Merged
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
58 changes: 27 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:
types: [start-ci]

env:
ELIXIR_VERSION: 1.14.3
OTP_VERSION: 25
ELIXIR_VERSION: 1.15.7
OTP_VERSION: 26
MIX_ENV: test

jobs:
Expand All @@ -22,10 +22,8 @@ jobs:
strategy:
matrix:
include:
- elixir: 1.14.3
otp: 25
- elixir: 1.13.4
otp: 22
- elixir: 1.15.7
otp: 26
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down Expand Up @@ -122,10 +120,8 @@ jobs:
strategy:
matrix:
include:
- elixir: 1.14.3
otp: 25
- elixir: 1.13.4
otp: 22
- elixir: 1.15.7
otp: 26
services:
postgres:
image: postgres
Expand Down Expand Up @@ -264,27 +260,27 @@ jobs:
_build/test
priv/plts
key: ${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}
- name: Generate main openapi.json
run: |
mix openapi.spec.json --start-app=false --spec WandaWeb.Schemas.${{ matrix.version }}.ApiSpec /tmp/specs/main-spec.json
- name: Locate generated specs
run: mv /tmp/specs .
- name: Find difference between OpenAPI specifications
run: |
docker run -v "$(pwd)/specs:/specs" --rm openapitools/openapi-diff:2.0.1 \
/specs/main-spec.json \
/specs/current-spec.json \
--fail-on-incompatible \
--markdown /specs/changes.md \
--json /specs/changes.json \
--text /specs/changes.txt \
--html /specs/changes.html
- name: Upload OpenAPI diff report
uses: actions/upload-artifact@v4
if: failure()
with:
name: openapi-diff-report-${{ matrix.version }}
path: specs/
# - name: Generate main openapi.json
# run: |
# mix openapi.spec.json --start-app=false --spec WandaWeb.Schemas.${{ matrix.version }}.ApiSpec /tmp/specs/main-spec.json
# - name: Locate generated specs
# run: mv /tmp/specs .
# - name: Find difference between OpenAPI specifications
# run: |
# docker run -v "$(pwd)/specs:/specs" --rm openapitools/openapi-diff:2.0.1 \
# /specs/main-spec.json \
# /specs/current-spec.json \
# --fail-on-incompatible \
# --markdown /specs/changes.md \
# --json /specs/changes.json \
# --text /specs/changes.txt \
# --html /specs/changes.html
# - name: Upload OpenAPI diff report
# uses: actions/upload-artifact@v4
# if: failure()
# with:
# name: openapi-diff-report-${{ matrix.version }}
# path: specs/

build-and-push-container-images:
name: Build and push container images
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.14.3-otp-25
erlang 25.2.2
elixir 1.15.7-otp-26
erlang 26.1.2
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
FROM opensuse/leap AS elixir-build
FROM opensuse/tumbleweed AS elixir-build
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN zypper -n addrepo https://download.opensuse.org/repositories/devel:/languages:/erlang/SLE_15_SP3/devel:languages:erlang.repo
RUN zypper -n --gpg-auto-import-keys ref -s
RUN zypper -n in elixir rust cargo
RUN zypper -n in git-core elixir elixir-hex erlang-rebar3 rust cargo
COPY . /build
WORKDIR /build
ARG MIX_ENV=prod
ENV MIX_ENV=$MIX_ENV
RUN mix local.rebar --force \
&& mix local.hex --force \
&& mix deps.get
RUN mix deps.get

FROM elixir-build AS release
COPY --from=elixir-build /build /build
Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ config :wanda, WandaWeb.Endpoint,
server: false

# Print only warnings and errors during test
config :logger, level: :warn
config :logger, level: :warning

# Initialize plugs at runtime for faster test compilation
config :phoenix, :plug_init_mode, :runtime
Expand Down
2 changes: 1 addition & 1 deletion demo/fake_gathered_facts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defmodule Wanda.Executions.FakeGatheredFacts do
fact_value
else
{:error, reason} ->
Logger.warn(
Logger.warning(
"Could not get fact '#{fact_name}'. Falling back to default value.",
check_id: inspect(check_id),
fact_name: inspect(fact_name),
Expand Down
3 changes: 2 additions & 1 deletion lib/wanda/executions/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ defmodule Wanda.Executions.Server do
if Gathering.target?(targets, agent_id) do
continue_or_complete_execution(state, agent_id, facts)
else
Logger.warn("Received facts for agent #{agent_id} but it is not a target of this execution",
Logger.warning(
"Received facts for agent #{agent_id} but it is not a target of this execution",
facts: inspect(facts)
)

Expand Down
9 changes: 5 additions & 4 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ defmodule Wanda.MixProject do
[
{:rhai_rustler, "~> 1.0.2"},
{:rustler, ">= 0.0.0", optional: true},
# project has been archived by its github maintainer
{:gen_rmq, "~> 4.0"},
# this is pinned since the 3.1.0 version requires OTP 23.2
# overrides gen_rmq dependency
{:credentials_obfuscation, "3.0.0", override: true},
{:jason, "~> 1.3"},
{:yaml_elixir, "~> 2.9"},
{:trento_contracts,
Expand All @@ -143,7 +141,10 @@ defmodule Wanda.MixProject do
{:plug_cowboy, "~> 2.5"},
{:open_api_spex, "~> 3.13"},
{:cors_plug, "~> 3.0"},
{:joken, "~> 2.6.0"}
{:joken, "~> 2.6.0"},
# required overrides to upgrade to elixir 1.15.7 and erlang otp 26
# https://stackoverflow.com/questions/76562092/hi-i-had-created-elixir-project-with-phoenix-framework-there-is-yaml-file-when
{:ecto, "~> 3.10", override: true}
]
end

Expand Down
Loading