From 5c1f4542914d03760d6b373c099bfbe5b78c4e53 Mon Sep 17 00:00:00 2001 From: David McIntosh <804610+mctofu@users.noreply.github.com> Date: Mon, 25 Apr 2022 15:14:39 -0700 Subject: [PATCH 1/3] Revert "Merge pull request #5044 from dependabot/brrygrdn/fix-bundler-version-passed-to-cli" This reverts commit 355c453c79e541164319166b3b6168d3825af4e0, reversing changes made to c55e5f8bf20cc6e65d4dc7e49a1eb0f08b9cf2d0. --- bundler/lib/dependabot/bundler/native_helpers.rb | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/bundler/lib/dependabot/bundler/native_helpers.rb b/bundler/lib/dependabot/bundler/native_helpers.rb index 910e195ec40..609aa614178 100644 --- a/bundler/lib/dependabot/bundler/native_helpers.rb +++ b/bundler/lib/dependabot/bundler/native_helpers.rb @@ -36,7 +36,7 @@ def clamp(seconds) def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {}) # Run helper suprocess with all bundler-related ENV variables removed bundler_major_version = bundler_version.split(".").first - helpers_path = versioned_helper_path(bundler_major_version) + helpers_path = versioned_helper_path(bundler_version: bundler_major_version) ::Bundler.with_original_env do command = BundleCommand. new(options[:timeout_per_operation_seconds]). @@ -47,7 +47,7 @@ def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {}) args: args, env: { # Bundler will pick the matching installed major version - "BUNDLER_VERSION" => installed_bundler_version(bundler_major_version), + "BUNDLER_VERSION" => bundler_version, "BUNDLE_GEMFILE" => File.join(helpers_path, "Gemfile"), # Prevent the GEM_HOME from being set to a folder owned by root "GEM_HOME" => File.join(helpers_path, ".bundle") @@ -61,15 +61,8 @@ def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {}) end end - def self.versioned_helper_path(bundler_major_version) - File.join(native_helpers_root, "v#{bundler_major_version}") - end - - # Maps the major version unto the specific version we have installed - def self.installed_bundler_version(bundler_major_version) - return Helpers::V1 if bundler_major_version == "1" - - Helpers::V2 + def self.versioned_helper_path(bundler_version:) + File.join(native_helpers_root, "v#{bundler_version}") end def self.native_helpers_root From b27c092dfdc3a6d55219462e70999781a44261ae Mon Sep 17 00:00:00 2001 From: David McIntosh <804610+mctofu@users.noreply.github.com> Date: Mon, 25 Apr 2022 15:17:28 -0700 Subject: [PATCH 2/3] Revert "Merge pull request #5018 from deivid-rodriguez/bundler-2-3-12" This reverts commit 93e1c50b6d45d96d06240d348024e6af5c699e1d, reversing changes made to 51a9cdd3da1a3b9f9cfdb1bca8d3f930df68059a. --- Dockerfile | 2 +- bundler/helpers/v2/build | 6 +++--- .../definition_ruby_version_patch.rb | 20 ++----------------- bundler/lib/dependabot/bundler/helpers.rb | 2 +- bundler/script/ci-test | 4 ++-- .../spec/dependabot/bundler/helper_spec.rb | 2 +- bundler/spec/spec_helper.rb | 2 +- 7 files changed, 11 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index d5850f8ba3e..3bbf7f6b5d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,7 +78,7 @@ RUN apt-add-repository ppa:brightbox/ruby-ng \ && apt-get install -y --no-install-recommends ruby2.7 ruby2.7-dev \ && gem update --system 3.3.11 --no-document \ && gem install bundler -v 1.17.3 --no-document \ - && gem install bundler -v 2.3.12 --no-document \ + && gem install bundler -v 2.3.10 --no-document \ && rm -rf /var/lib/gems/2.7.0/cache/* \ && rm -rf /var/lib/apt/lists/* diff --git a/bundler/helpers/v2/build b/bundler/helpers/v2/build index 5762a14abc8..c54f29b8e66 100755 --- a/bundler/helpers/v2/build +++ b/bundler/helpers/v2/build @@ -22,6 +22,6 @@ cd "$install_dir" # NOTE: Sets `BUNDLED WITH` to match the installed v2 version in Gemfile.lock # forcing specs and native helpers to run with the same version -BUNDLER_VERSION=2.3.12 bundle config --local path ".bundle" -BUNDLER_VERSION=2.3.12 bundle config --local without "test" -BUNDLER_VERSION=2.3.12 bundle install +BUNDLER_VERSION=2.3.10 bundle config --local path ".bundle" +BUNDLER_VERSION=2.3.10 bundle config --local without "test" +BUNDLER_VERSION=2.3.10 bundle install diff --git a/bundler/helpers/v2/monkey_patches/definition_ruby_version_patch.rb b/bundler/helpers/v2/monkey_patches/definition_ruby_version_patch.rb index d0d254ac408..e127b488270 100644 --- a/bundler/helpers/v2/monkey_patches/definition_ruby_version_patch.rb +++ b/bundler/helpers/v2/monkey_patches/definition_ruby_version_patch.rb @@ -5,32 +5,16 @@ module BundlerDefinitionRubyVersionPatch def source_requirements if ruby_version - requested_version = ruby_version.gem_version + requested_version = ruby_version.to_gem_version_with_patchlevel sources.metadata_source.specs << Gem::Specification.new("Ruby\0", requested_version) end sources.metadata_source.specs << - Gem::Specification.new("Ruby\0", "2.5.3") + Gem::Specification.new("Ruby\0", "2.5.3p105") super end - - def metadata_dependencies - @metadata_dependencies ||= - [ - Bundler::Dependency.new("Ruby\0", ruby_version_requirements), - Bundler::Dependency.new("RubyGems\0", Gem::VERSION) - ] - end - - def ruby_version_requirements - return [] unless ruby_version - - ruby_version.versions.map do |version| - Gem::Requirement.new(version) - end - end end Bundler::Definition.prepend(BundlerDefinitionRubyVersionPatch) diff --git a/bundler/lib/dependabot/bundler/helpers.rb b/bundler/lib/dependabot/bundler/helpers.rb index e9fcc2c6ee1..2c9d21d0cbc 100644 --- a/bundler/lib/dependabot/bundler/helpers.rb +++ b/bundler/lib/dependabot/bundler/helpers.rb @@ -4,7 +4,7 @@ module Dependabot module Bundler module Helpers V1 = "1.17.3" - V2 = "2.3.12" + V2 = "2.3.10" # If we are updating a project with no Gemfile.lock, we default to the # newest version we support DEFAULT = V2 diff --git a/bundler/script/ci-test b/bundler/script/ci-test index dba5e762295..b1c953522a7 100755 --- a/bundler/script/ci-test +++ b/bundler/script/ci-test @@ -15,7 +15,7 @@ fi if [[ "$SUITE_NAME" == "bundler2" ]]; then cd helpers/v2 \ - && BUNDLER_VERSION=2.3.12 bundle install \ - && BUNDLER_VERSION=2.3.12 bundle exec rspec spec \ + && BUNDLER_VERSION=2.3.10 bundle install \ + && BUNDLER_VERSION=2.3.10 bundle exec rspec spec \ && cd - fi diff --git a/bundler/spec/dependabot/bundler/helper_spec.rb b/bundler/spec/dependabot/bundler/helper_spec.rb index 0697d46f7c2..9e8b4d03ab6 100644 --- a/bundler/spec/dependabot/bundler/helper_spec.rb +++ b/bundler/spec/dependabot/bundler/helper_spec.rb @@ -41,7 +41,7 @@ end let(:v1) { "1.17.3" } - let(:v2) { "2.3.12" } + let(:v2) { "2.3.10" } describe "#bundler_version" do def described_method(lockfile) diff --git a/bundler/spec/spec_helper.rb b/bundler/spec/spec_helper.rb index 23df38d61f8..ecf39911cd1 100644 --- a/bundler/spec/spec_helper.rb +++ b/bundler/spec/spec_helper.rb @@ -20,7 +20,7 @@ def self.use_bundler_2? end def self.bundler_version - use_bundler_2? ? "2.3.12" : "1.17.3" + use_bundler_2? ? "2.3.10" : "1.17.3" end def self.bundler_major_version From b7cced90f88e6bed003f10dfc46722e02510fa24 Mon Sep 17 00:00:00 2001 From: David McIntosh <804610+mctofu@users.noreply.github.com> Date: Mon, 25 Apr 2022 20:31:09 -0700 Subject: [PATCH 3/3] Revert "Merge pull request #5035 from deivid-rodriguez/update-rubygems" This reverts commit 679840b79cf74e8825e57366797b8025dbd66ed7, reversing changes made to 82fcef470d504cd3f0bf62cd30409621f264fe84. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3bbf7f6b5d5..1f2ebd74b3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,7 +76,7 @@ ENV PATH="$BUNDLE_BIN:$PATH:$BUNDLE_PATH/bin" RUN apt-add-repository ppa:brightbox/ruby-ng \ && apt-get update \ && apt-get install -y --no-install-recommends ruby2.7 ruby2.7-dev \ - && gem update --system 3.3.11 --no-document \ + && gem update --system 3.2.20 \ && gem install bundler -v 1.17.3 --no-document \ && gem install bundler -v 2.3.10 --no-document \ && rm -rf /var/lib/gems/2.7.0/cache/* \