From 308db63673bdd18a99e443e87d265fd5ef6ad74a Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Fri, 28 Jul 2023 17:10:15 +0100 Subject: [PATCH 1/4] bump elixir and erlang --- .tool-versions | 4 ++-- lib/lightning/adaptor_service.ex | 4 +++- lib/lightning/task_worker.ex | 2 +- .../live/dataclip_live/form_component.html.heex | 8 ++++++-- lib/mix/tasks/install_schemas.ex | 2 +- mix.exs | 2 +- mix.lock | 2 +- test/lightning/jobs/job_test.exs | 4 +++- test/lightning/workflows_test.exs | 5 ++++- test/lightning_web/live/work_order_live_test.exs | 10 ++++++---- test/support/fixtures/workflows_fixtures.ex | 2 +- 11 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.tool-versions b/.tool-versions index e2cc08cf33..507b8da9b4 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,4 +1,4 @@ -erlang 25.2 -elixir 1.14.2-otp-25 +erlang 26.0.2 +elixir 1.15.4-otp-26 nodejs 18.12.0 k6 0.43.1 diff --git a/lib/lightning/adaptor_service.ex b/lib/lightning/adaptor_service.ex index a3c4dca205..3177f035c4 100644 --- a/lib/lightning/adaptor_service.ex +++ b/lib/lightning/adaptor_service.ex @@ -85,7 +85,9 @@ defmodule Lightning.AdaptorService do """ @callback list_local(path :: String.t()) :: list(Adaptor.t()) def list_local(path, _depth \\ 4) when is_binary(path) do - System.cmd("npm", ~w[list --global --json --long --prefix #{path}], env: []) + System.cmd("npm", ~w[list --global --json --long --prefix #{path}], + env: [] + ) |> case do {stdout, 0} -> stdout diff --git a/lib/lightning/task_worker.ex b/lib/lightning/task_worker.ex index bf40a8cdbf..8df1d75468 100644 --- a/lib/lightning/task_worker.ex +++ b/lib/lightning/task_worker.ex @@ -54,7 +54,7 @@ defmodule Lightning.TaskWorker do GenServer.start_link(__MODULE__, init_opts, opts) end - @spec start_task(worker :: GenServer.name(), (() -> any)) :: + @spec start_task(worker :: GenServer.name(), (-> any)) :: {:error, :too_many_processes} | term() def start_task(worker, fun) when is_function(fun, 0) do GenServer.call(worker, :checkout) diff --git a/lib/lightning_web/live/dataclip_live/form_component.html.heex b/lib/lightning_web/live/dataclip_live/form_component.html.heex index 8222401e33..b7d357f863 100644 --- a/lib/lightning_web/live/dataclip_live/form_component.html.heex +++ b/lib/lightning_web/live/dataclip_live/form_component.html.heex @@ -10,7 +10,9 @@ >
- <%= label(f, :type, class: "block text-sm font-medium text-secondary-700") %> + <%= label(f, :type, + class: "block text-sm font-medium text-secondary-700" + ) %>
<.select_field @@ -26,7 +28,9 @@
- <%= label(f, :body, class: "block text-sm font-medium text-secondary-700") %> + <%= label(f, :body, + class: "block text-sm font-medium text-secondary-700" + ) %> <%= textarea(f, :body, disabled: true, class: diff --git a/lib/mix/tasks/install_schemas.ex b/lib/mix/tasks/install_schemas.ex index 81335fab56..6e78823807 100644 --- a/lib/mix/tasks/install_schemas.ex +++ b/lib/mix/tasks/install_schemas.ex @@ -92,7 +92,7 @@ defmodule Mix.Tasks.Lightning.InstallSchemas do write_schema(dir, package_name, body) {:ok, %HTTPoison.Response{status_code: status_code}} -> - Logger.warn( + Logger.warning( "Unable to fetch #{package_name} configuration schema. status=#{status_code}" ) end diff --git a/mix.exs b/mix.exs index 73ef288958..d35ba45beb 100644 --- a/mix.exs +++ b/mix.exs @@ -5,7 +5,7 @@ defmodule Lightning.MixProject do [ app: :lightning, version: "0.7.0", - elixir: "~> 1.13", + elixir: "~> 1.15", elixirc_paths: elixirc_paths(Mix.env()), compilers: Mix.compilers(), start_permanent: Mix.env() == :prod, diff --git a/mix.lock b/mix.lock index 7fb233a81b..9e266e57b8 100644 --- a/mix.lock +++ b/mix.lock @@ -88,7 +88,7 @@ "sentry": {:hex, :sentry, "8.0.6", "c8de1bf0523bc120ec37d596c55260901029ecb0994e7075b0973328779ceef7", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, "~> 2.3", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "051a2d0472162f3137787c7c9d6e6e4ef239de9329c8c45b1f1bf1e9379e1883"}, "sleeplocks": {:hex, :sleeplocks, "1.1.2", "d45aa1c5513da48c888715e3381211c859af34bee9b8290490e10c90bb6ff0ca", [:rebar3], [], "hexpm", "9fe5d048c5b781d6305c1a3a0f40bb3dfc06f49bf40571f3d2d0c57eaa7f59a5"}, "sobelow": {:hex, :sobelow, "0.11.1", "23438964486f8112b41e743bbfd402da3e5b296fdc9eacab29914b79c48916dd", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "9897363a7eff96f4809304a90aad819e2ad5e5d24db547af502885146746a53c"}, - "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, + "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "sweet_xml": {:hex, :sweet_xml, "0.7.3", "debb256781c75ff6a8c5cbf7981146312b66f044a2898f453709a53e5031b45b", [:mix], [], "hexpm", "e110c867a1b3fe74bfc7dd9893aa851f0eed5518d0d7cad76d7baafd30e4f5ba"}, "swoosh": {:hex, :swoosh, "1.9.1", "0a5d7bf9954eb41d7e55525bc0940379982b090abbaef67cd8e1fd2ed7f8ca1a", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "76dffff3ffcab80f249d5937a592eaef7cc49ac6f4cdd27e622868326ed6371e"}, "tailwind": {:hex, :tailwind, "0.1.10", "21ed80ae1f411f747ee513470578acaaa1d0eb40170005350c5b0b6d07e2d624", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "e0fc474dfa8ed7a4573851ac69c5fd3ca70fbb0a5bada574d1d657ebc6f2f1f1"}, diff --git a/test/lightning/jobs/job_test.exs b/test/lightning/jobs/job_test.exs index 952a9bc8f1..e714580889 100644 --- a/test/lightning/jobs/job_test.exs +++ b/test/lightning/jobs/job_test.exs @@ -7,7 +7,9 @@ defmodule Lightning.Jobs.JobTest do for _ <- 1..length, into: "", do: - <> + <> end describe "changeset/2" do diff --git a/test/lightning/workflows_test.exs b/test/lightning/workflows_test.exs index ff7f61790f..8192e6c816 100644 --- a/test/lightning/workflows_test.exs +++ b/test/lightning/workflows_test.exs @@ -207,7 +207,10 @@ defmodule Lightning.WorkflowsTest do assert {:ok, workflow} = Lightning.Workflows.update_workflow(workflow, valid_attrs) - assert Repo.get_by(Lightning.Jobs.Job, id: job_id, name: "some-job-renamed") + assert Repo.get_by(Lightning.Jobs.Job, + id: job_id, + name: "some-job-renamed" + ) assert workflow.name == "some-name" assert workflow.edges |> List.first() == edge diff --git a/test/lightning_web/live/work_order_live_test.exs b/test/lightning_web/live/work_order_live_test.exs index 0e92810b85..b961602435 100644 --- a/test/lightning_web/live/work_order_live_test.exs +++ b/test/lightning_web/live/work_order_live_test.exs @@ -105,10 +105,8 @@ defmodule LightningWeb.RunWorkOrderTest do conn, Routes.project_run_index_path(conn, :index, project.id) ) - |> IO.inspect() Routes.project_run_index_path(conn, :index, project.id) - |> IO.inspect() # assert destination =~ # "/projects/#{project.id}/runs?filters[body]=true&filters[crash]=true&filters[date_after]=" @@ -1136,7 +1134,9 @@ defmodule LightningWeb.RunWorkOrderTest do run = run_fixture(started_at: started_at, finished_at: finished_at) html = - render_component(&LightningWeb.RunLive.Components.run_details/1, run: run) + render_component(&LightningWeb.RunLive.Components.run_details/1, + run: run + ) |> Floki.parse_fragment!() assert html @@ -1162,7 +1162,9 @@ defmodule LightningWeb.RunWorkOrderTest do run = run_fixture(started_at: started_at) html = - render_component(&LightningWeb.RunLive.Components.run_details/1, run: run) + render_component(&LightningWeb.RunLive.Components.run_details/1, + run: run + ) |> Floki.parse_fragment!() assert html diff --git a/test/support/fixtures/workflows_fixtures.ex b/test/support/fixtures/workflows_fixtures.ex index e6a760854b..d93254ee71 100644 --- a/test/support/fixtures/workflows_fixtures.ex +++ b/test/support/fixtures/workflows_fixtures.ex @@ -18,7 +18,7 @@ defmodule Lightning.WorkflowsFixtures do |> Enum.into(%{ name: Enum.take_random( - 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ', + ~c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ", 10 ) |> to_string() From 554852c382d52908a83a3df4d474c4e96a67867a Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Fri, 28 Jul 2023 17:11:25 +0100 Subject: [PATCH 2/4] changelog for elixir 1.15 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0930aa105a..16e49caa94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to ### Changed +- Moved to Elixir 1.15 and Erlang 26.0.2 to sort our an annoying ElixirLS issue + that was slowing down our engineers. + ### Fixed - Fix issue creating a new credential from the Job editor where the new From 39b2c0a8f62253caf38521d29aedccc2de140f16 Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Fri, 28 Jul 2023 17:18:47 +0100 Subject: [PATCH 3/4] update elixir and postgres versions in circleci - no otp26 yet? --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 56ad2ba240..4bbec6b338 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: elixir_version: description: Elixir version type: string - default: "1.14.1" + default: "1.15.4-otp-25" nodejs_version: description: NodeJS version type: string @@ -46,7 +46,7 @@ jobs: parallelism: 1 docker: - image: elixir:<< parameters.elixir_version >> - - image: cimg/postgres:14.2 + - image: cimg/postgres:15.3 steps: - checkout From d650093f56d05f12be377914b0787c5281065503 Mon Sep 17 00:00:00 2001 From: Stuart Corbishley Date: Mon, 31 Jul 2023 09:18:07 +0200 Subject: [PATCH 4/4] The elixir/1.15.4 image appears to have OTP26 already --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4bbec6b338..2306aa0885 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: elixir_version: description: Elixir version type: string - default: "1.15.4-otp-25" + default: "1.15.4" # Looks like it's pinned at OTP26 nodejs_version: description: NodeJS version type: string