Skip to content

Commit

Permalink
Docker: support mixed case version suffixes (RC)
Browse files Browse the repository at this point in the history
Downcase the docker version tag before finding the latest tag which is
compatible with the inherited Bundler version class.

Fixes: dependabot/feedback#779
  • Loading branch information
feelepxyz committed Nov 27, 2019
1 parent 711c932 commit 05a1bcd
Show file tree
Hide file tree
Showing 3 changed files with 3,506 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker/lib/dependabot/docker/update_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def prerelease?(tag)
def numeric_version_from(tag)
return unless tag.match?(NAME_WITH_VERSION)

tag.match(NAME_WITH_VERSION).named_captures.fetch("version")
tag.match(NAME_WITH_VERSION).named_captures.fetch("version").downcase
end

def registry_hostname
Expand Down
9 changes: 9 additions & 0 deletions docker/spec/dependabot/docker/update_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,15 @@
end
end

context "when the version is the latest release candidate" do
let(:dependency_name) { "php" }
let(:tags_fixture_name) { "php.json" }
let(:version) { "7.4.0RC6-fpm-buster" }
let(:repo_url) { "https://registry.hub.docker.com/v2/library/php/" }

it { is_expected.to eq("7.4.0RC6-fpm-buster") }
end

context "when there is a latest tag" do
let(:tags_fixture_name) { "ubuntu.json" }
let(:headers_response) do
Expand Down
Loading

0 comments on commit 05a1bcd

Please sign in to comment.