Skip to content

Commit

Permalink
Upgrade Bundler to 2.5.11 and RubyGems to 3.5.11 (#9862)
Browse files Browse the repository at this point in the history
Co-authored-by: AbdulFattaah Popoola <abdulapopoola@github.com>
  • Loading branch information
deivid-rodriguez and abdulapopoola authored Jun 4, 2024
1 parent 44b738f commit dedb39c
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 103 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* text=auto eof=lf
Dockerfile.development linguist-language=Dockerfile
Dockerfile.updater-core linguist-language=Dockerfile
bundler/spec/fixtures/rubygems_responses/*.rz binary linguist-generated
4 changes: 2 additions & 2 deletions Dockerfile.updater-core
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ RUN for ecosystem in git_submodules terraform github_actions hex elm docker nuge

WORKDIR $DEPENDABOT_HOME/dependabot-updater

ARG RUBYGEMS_VERSION=3.5.9
ARG RUBYGEMS_VERSION=3.5.11
RUN gem update --system $RUBYGEMS_VERSION

# When bumping Bundler, need to also:
# * Regenerate `updater/Gemfile.lock` via `BUNDLE_GEMFILE=updater/Gemfile bundle lock --update --bundler`
# * Regenerate `Gemfile.lock` via `bundle lock --update --bundler`.
ARG BUNDLER_V2_VERSION=2.5.9
ARG BUNDLER_V2_VERSION=2.5.11

RUN gem install bundler -v $BUNDLER_V2_VERSION --no-document && \
rm -rf /var/lib/gems/*/cache/* && \
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,4 @@ DEPENDENCIES
webrick (>= 1.7)

BUNDLED WITH
2.5.9
2.5.11
2 changes: 1 addition & 1 deletion bundler/helpers/v2/lib/functions/lockfile_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def build_definition(dependencies_to_unlock)
# if those sub-deps are top-level dependencies. We only want true
# subdeps unlocked, like they were in the UpdateChecker, so we
# mutate the unlocked gems array.
unlocked = defn.instance_variable_get(:@unlock).fetch(:gems)
unlocked = defn.instance_variable_get(:@gems_to_unlock)
must_not_unlock = defn.dependencies.map { |x| x.name.to_s } -
dependencies_to_unlock
unlocked.reject! { |n| must_not_unlock.include?(n) }
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion bundler/helpers/v2/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
require "definition_ruby_version_patch"
require "definition_bundler_version_patch"
require "git_source_patch"
require "definition_bundler_spec_set_patch"

require "functions"

Expand Down
68 changes: 0 additions & 68 deletions bundler/helpers/v2/spec/definition_bundler_spec_set_patch_spec.rb

This file was deleted.

7 changes: 5 additions & 2 deletions bundler/helpers/v2/spec/functions/version_resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
stub_request(:get, "https://rubygems.org/quick/Marshal.4.8/statesman-1.2.1.gemspec.rz")
.to_return(status: 200, body: fixture("rubygems_responses", "statesman-1.2.1.gemspec.rz"))

stub_request(:get, "https://rubygems.org/quick/Marshal.4.8/statesman-1.2.5.gemspec.rz")
.to_return(status: 200, body: fixture("rubygems_responses", "statesman-1.2.5.gemspec.rz"))

stub_request(:get, %r{quick/Marshal.4.8/business-.*.gemspec.rz})
.to_return(status: 200, body: fixture("rubygems_responses", "business-1.0.0.gemspec.rz"))
end
Expand Down Expand Up @@ -102,12 +105,12 @@
its([:fetcher]) { is_expected.to eq("Bundler::Fetcher::Dependency") }
end

context "with no update possible due to a version conflict" do
context "when there's a version conflict with a subdep also listed as a top level dependency" do
let(:project_name) { "version_conflict_with_listed_subdep" }
let(:dependency_name) { "rspec-mocks" }
let(:requirement_string) { ">= 0" }

its([:version]) { is_expected.to eq(Gem::Version.new("3.6.0")) }
its([:version]) { is_expected.to be > Gem::Version.new("3.6.0") }
end
end
end
1 change: 0 additions & 1 deletion bundler/helpers/v2/spec/native_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# Bundler monkey patches
require "definition_ruby_version_patch"
require "definition_bundler_version_patch"
require "definition_bundler_spec_set_patch"
require "git_source_patch"

require "functions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@

let(:dependency_files) { bundler_project_dependency_files("blocked_by_subdep") }

its([:version]) { is_expected.to eq(Gem::Version.new("1.1.0")) }
it "only upgrades as far as the subdep allows", :bundler_v1_only do
expect(latest_resolvable_version_details[:version]).to eq(Gem::Version.new("1.1.0"))
end

it "is still able to upgrade to the latest version by upgrading the subdep as well", :bundler_v2_only do
expect(latest_resolvable_version_details[:version]).to eq(Gem::Version.new("2.0.0"))
end
end

context "when that only appears in the lockfile" do
Expand Down Expand Up @@ -235,13 +241,19 @@
end
end

context "with no update possible due to a version conflict" do
context "when upgrading needs to unlock subdeps" do
let(:dependency_name) { "rspec-mocks" }
let(:requirement_string) { ">= 0" }

let(:dependency_files) { bundler_project_dependency_files("version_conflict_with_listed_subdep") }

its([:version]) { is_expected.to eq(Gem::Version.new("3.6.0")) }
it "does not allow the upgrade", :bundler_v1_only do
expect(latest_resolvable_version_details[:version]).to eq(Gem::Version.new("3.6.0"))
end

it "is still able to upgrade", :bundler_v2_only do
expect(latest_resolvable_version_details[:version]).to be > Gem::Version.new("3.6.0")
end
end

context "with a legacy Ruby which disallows the latest version" do
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion updater/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -433,4 +433,4 @@ DEPENDENCIES
webrick (>= 1.7)

BUNDLED WITH
2.5.9
2.5.11

0 comments on commit dedb39c

Please sign in to comment.