From cfb37f8f9f4b0de960603d7463dd0ba94a0d7f35 Mon Sep 17 00:00:00 2001 From: Tyler Witt Date: Fri, 17 Jan 2025 01:13:45 +0900 Subject: [PATCH] Bump Hex Elixir version to 1.16.3 This bumps Elixir to the last version of 1.16. A couple quirks: 1. `Mix.Dep.load_on_environment/1` is gone, but under the hood it called `Mix.Dep.Converger.converge/1`anyways. 2. Charlist dependencies explicitly fail now, and I'm fairly sure they should be updated if charlists are still used. --- hex/Dockerfile | 4 ++-- hex/helpers/lib/parse_deps.exs | 2 +- hex/spec/dependabot/hex/file_parser_spec.rb | 6 ++--- .../hex/update_checker/file_preparer_spec.rb | 11 --------- .../mixfiles/git_source_with_charlist | 24 ------------------- 5 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 hex/spec/fixtures/mixfiles/git_source_with_charlist diff --git a/hex/Dockerfile b/hex/Dockerfile index 8a5bcf38a0..1ae9a8ad4c 100644 --- a/hex/Dockerfile +++ b/hex/Dockerfile @@ -15,8 +15,8 @@ RUN apt-get update \ # Install Elixir # https://github.com/elixir-lang/elixir/releases -ARG ELIXIR_VERSION=v1.15.8 -ARG ELIXIR_CHECKSUM=62d33c51417191e027c9b6f0c46e11daeb236a7dda6f0746ec4dd53263531092 +ARG ELIXIR_VERSION=v1.16.3 +ARG ELIXIR_CHECKSUM=e8e81771bc6acd62a2c1bf1b31c3aa3d0a469415de3b243b99f3e2e2d639f5ea RUN curl -sSLfO https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/elixir-otp-${ERLANG_MAJOR_VERSION}.zip \ && echo "$ELIXIR_CHECKSUM elixir-otp-${ERLANG_MAJOR_VERSION}.zip" | sha256sum -c - \ && unzip -d /usr/local/elixir -x elixir-otp-${ERLANG_MAJOR_VERSION}.zip \ diff --git a/hex/helpers/lib/parse_deps.exs b/hex/helpers/lib/parse_deps.exs index d212c7c99a..950cce1685 100644 --- a/hex/helpers/lib/parse_deps.exs +++ b/hex/helpers/lib/parse_deps.exs @@ -3,7 +3,7 @@ defmodule Parser do # This is necessary because we can't specify :extra_applications to have :hex in other mixfiles. Mix.ensure_application!(:hex) - Mix.Dep.load_on_environment([]) + Mix.Dep.Converger.converge() |> Enum.flat_map(&parse_dep/1) |> Enum.map(&build_dependency(&1.opts[:lock], &1)) end diff --git a/hex/spec/dependabot/hex/file_parser_spec.rb b/hex/spec/dependabot/hex/file_parser_spec.rb index 539b575455..5c852b6dd0 100644 --- a/hex/spec/dependabot/hex/file_parser_spec.rb +++ b/hex/spec/dependabot/hex/file_parser_spec.rb @@ -255,8 +255,8 @@ end context "with a tag (rather than a ref)" do - let(:mixfile_fixture_name) { "git_source_with_charlist" } - let(:lockfile_fixture_name) { "git_source_with_charlist" } + let(:mixfile_fixture_name) { "git_source_tag_can_update" } + let(:lockfile_fixture_name) { "git_source_tag_can_update" } it "includes the git dependency" do expect(dependencies.length).to eq(2) @@ -476,7 +476,7 @@ it "returns the correct language" do expect(language.name).to eq "elixir" expect(language.requirement).to be_nil - expect(language.version.to_s).to eq "1.15.8" + expect(language.version.to_s).to eq "1.16.3" end end end diff --git a/hex/spec/dependabot/hex/update_checker/file_preparer_spec.rb b/hex/spec/dependabot/hex/update_checker/file_preparer_spec.rb index 43d0dcd0a4..8dba08f374 100644 --- a/hex/spec/dependabot/hex/update_checker/file_preparer_spec.rb +++ b/hex/spec/dependabot/hex/update_checker/file_preparer_spec.rb @@ -204,17 +204,6 @@ 'ref: "v1.2.1"}' ) end - - context "when there are single quotes" do - let(:mixfile_fixture_name) { "git_source_with_charlist" } - - it "updates the pin" do - expect(prepared_mixfile.content).to include( - '{:phoenix, ">= 0", github: "dependabot-fixtures/phoenix", ' \ - "ref: 'v1.2.1'}" - ) - end - end end end diff --git a/hex/spec/fixtures/mixfiles/git_source_with_charlist b/hex/spec/fixtures/mixfiles/git_source_with_charlist deleted file mode 100644 index f5eabfc02e..0000000000 --- a/hex/spec/fixtures/mixfiles/git_source_with_charlist +++ /dev/null @@ -1,24 +0,0 @@ -defmodule DependabotTest.Mixfile do - use Mix.Project - - def project do - [ - app: :dependabot_test, - version: "0.1.0", - elixir: "~> 1.5", - start_permanent: Mix.env == :prod, - deps: deps() - ] - end - - def application do - [extra_applications: [:logger]] - end - - defp deps do - [ - {:plug, "1.2.0"}, - {:phoenix, github: "dependabot-fixtures/phoenix", ref: 'v1.2.0'} - ] - end -end