Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrelated libraries are updated with bundler #5926

Closed
1 task done
t-tiger opened this issue Oct 19, 2022 · 19 comments · Fixed by #6030
Closed
1 task done

Unrelated libraries are updated with bundler #5926

t-tiger opened this issue Oct 19, 2022 · 19 comments · Fixed by #6030
Labels
L: ruby:bundler RubyGems via bundler T: bug 🐞 Something isn't working

Comments

@t-tiger
Copy link

t-tiger commented Oct 19, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Package ecosystem

Bundler

Package manager version

bundler 2.2.32

Language version

Ruby 2.7.2

Manifest location and content before the Dependabot update

/Gemfile

dependabot.yml content

- package-ecosystem: bundler
  directory: "/"
  schedule:
    interval: daily
  open-pull-requests-limit: 2
  target-branch: develop

Updated dependency

When updating warning from 1.2.1 to 1.3.0, the followings are also updated while only warning should be updated.

Above libraries are not related to the original gem, they should be updated with other PRs.

What you expected to see, versus what you actually saw

Expected
Only warning is updated from 1.2.1 to 1.3.0, which is the result when I manually execute bundle update warning.

Actual
Other libraries are also updated as Updated dependency section shows.

It seems to start last week. Our team has been using dependabot for a long time.

Native package manager behavior

No response

Images of the diff or a link to the PR, issue, or logs

No response

Smallest manifest that reproduces the issue

No response

@t-tiger t-tiger added the T: bug 🐞 Something isn't working label Oct 19, 2022
@deivid-rodriguez
Copy link
Contributor

Thanks for reporting.

I guess related to the upgrade of Bundler at #5509.

Can you share a public repository that reproduces this?

@deivid-rodriguez deivid-rodriguez added the L: ruby:bundler RubyGems via bundler label Oct 19, 2022
@t-tiger
Copy link
Author

t-tiger commented Oct 19, 2022

Thank you for quick response.

Can you share a public repository that reproduces this?

Sorry, this case is inside private repository at my work 🙇

@deivid-rodriguez
Copy link
Contributor

No problem.

Could you try to extract just the manifest files (or at least the subset of dependencies giving you trouble) to a public repository, and see if it reproduces there. Alternatively, can you try reproducing this using https://github.com/dependabot/cli?

@t-tiger
Copy link
Author

t-tiger commented Oct 20, 2022

I made a public repository that extracts a subset of libraries. As a result, dependabot works as expected.
https://github.com/t-tiger/dependabot-test/pull/1

After I created a PR, I found other repositories in the company don't have the same problem.
One repository which has the most complex dependency shows the issue.

@deivid-rodriguez
Copy link
Contributor

That's too bad. One question, was the PR created with unrelated dependencies up to date with your default branch?

@t-tiger
Copy link
Author

t-tiger commented Oct 24, 2022

Sorry for the late response.

was the PR created with unrelated dependencies up to date with your default branch?

Yes, it is.

Currently, I'm trying to find the condition how to reproduce by increasing/decreasing libraries in Gemfile..

@CvX
Copy link

CvX commented Oct 24, 2022

I also have an example of this behavior (it's in a private repo too…)

PR title: "Build(deps-dev): Bump rspec-rails from 6.0.0 to 6.0.1"

PR content:

diff --git a/Gemfile.lock b/Gemfile.lock
index 95a1cc9..1e444d8 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -240,9 +240,9 @@ GEM
     net-smtp (0.3.2)
       net-protocol
     nio4r (2.5.8)
-    nokogiri (1.13.8-arm64-darwin)
+    nokogiri (1.13.9-arm64-darwin)
       racc (~> 1.4)
-    nokogiri (1.13.8-x86_64-linux)
+    nokogiri (1.13.9-x86_64-linux)
       racc (~> 1.4)
     parallel (1.22.1)
     parser (3.1.2.1)
@@ -309,7 +309,7 @@ GEM
     rspec-mocks (3.11.1)
       diff-lcs (>= 1.2.0, < 2.0)
       rspec-support (~> 3.11.0)
-    rspec-rails (6.0.0)
+    rspec-rails (6.0.1)
       actionpack (>= 6.1)
       activesupport (>= 6.1)
       railties (>= 6.1)

The nokogiri bump isn't relevant to the rspec-rails bump. 👀 (and Dependabot did open a PR for that nokogiri update at the same time)

Here's the full Gemfile and Gemfile.lock

# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gem 'rails', '~> 7.0.1'
gem 'sprockets-rails'
gem 'pg'
gem 'puma', '~> 5.0'
gem 'jbuilder'
gem 'redis', '< 4.6'
gem 'mini_racer'
gem 'terser'
gem 'sassc-rails'
gem 'sidekiq'
gem 'mini_scheduler'
gem 'logster'
gem 'listen', '~> 3.0.5'
gem 'prometheus_exporter'
gem 'active_model_serializers', '~> 0.8.3'
gem 'acts_as_paranoid'
gem 'kaminari'
gem 'addressable'
gem 'httparty'
gem 'carrierwave'
gem 'fog-aws'
gem 'eye', require: false
gem 'droplet_kit'
gem 'bootstrap', '~> 5.2.0'
gem 'jquery-rails'
gem 'chartjs-ror'
gem 'rack-mini-profiler', require: false

group :development, :test do
  gem 'byebug'
  gem 'pry-rails'
end

group :development do
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'memory_profiler'
  gem 'rubocop-discourse', require: false
  gem 'stackprof'
end

group :test do
  gem 'fabrication'
  gem 'rspec-rails'
  gem 'webmock'
end
GEM
  remote: https://rubygems.org/
  specs:
    actioncable (7.0.4)
      actionpack (= 7.0.4)
      activesupport (= 7.0.4)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (7.0.4)
      actionpack (= 7.0.4)
      activejob (= 7.0.4)
      activerecord (= 7.0.4)
      activestorage (= 7.0.4)
      activesupport (= 7.0.4)
      mail (>= 2.7.1)
      net-imap
      net-pop
      net-smtp
    actionmailer (7.0.4)
      actionpack (= 7.0.4)
      actionview (= 7.0.4)
      activejob (= 7.0.4)
      activesupport (= 7.0.4)
      mail (~> 2.5, >= 2.5.4)
      net-imap
      net-pop
      net-smtp
      rails-dom-testing (~> 2.0)
    actionpack (7.0.4)
      actionview (= 7.0.4)
      activesupport (= 7.0.4)
      rack (~> 2.0, >= 2.2.0)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (7.0.4)
      actionpack (= 7.0.4)
      activerecord (= 7.0.4)
      activestorage (= 7.0.4)
      activesupport (= 7.0.4)
      globalid (>= 0.6.0)
      nokogiri (>= 1.8.5)
    actionview (7.0.4)
      activesupport (= 7.0.4)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    active_model_serializers (0.8.4)
      activemodel (>= 3.0)
    activejob (7.0.4)
      activesupport (= 7.0.4)
      globalid (>= 0.3.6)
    activemodel (7.0.4)
      activesupport (= 7.0.4)
    activerecord (7.0.4)
      activemodel (= 7.0.4)
      activesupport (= 7.0.4)
    activestorage (7.0.4)
      actionpack (= 7.0.4)
      activejob (= 7.0.4)
      activerecord (= 7.0.4)
      activesupport (= 7.0.4)
      marcel (~> 1.0)
      mini_mime (>= 1.1.0)
    activesupport (7.0.4)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
    acts_as_paranoid (0.8.1)
      activerecord (>= 5.2, < 7.1)
      activesupport (>= 5.2, < 7.1)
    addressable (2.8.1)
      public_suffix (>= 2.0.2, < 6.0)
    ast (2.4.2)
    autoprefixer-rails (10.4.7.0)
      execjs (~> 2)
    axiom-types (0.1.1)
      descendants_tracker (~> 0.0.4)
      ice_nine (~> 0.11.0)
      thread_safe (~> 0.3, >= 0.3.1)
    better_errors (2.9.1)
      coderay (>= 1.0.0)
      erubi (>= 1.0.0)
      rack (>= 0.9.0)
    binding_of_caller (1.0.0)
      debug_inspector (>= 0.0.1)
    bootstrap (5.2.2)
      autoprefixer-rails (>= 9.1.0)
      popper_js (>= 2.11.6, < 3)
      sassc-rails (>= 2.0.0)
    builder (3.2.4)
    byebug (11.1.3)
    carrierwave (2.2.2)
      activemodel (>= 5.0.0)
      activesupport (>= 5.0.0)
      addressable (~> 2.6)
      image_processing (~> 1.1)
      marcel (~> 1.0.0)
      mini_mime (>= 0.1.3)
      ssrf_filter (~> 1.0)
    celluloid (0.17.4)
      celluloid-essentials
      celluloid-extras
      celluloid-fsm
      celluloid-pool
      celluloid-supervision
      timers (>= 4.1.1)
    celluloid-essentials (0.20.5)
      timers (>= 4.1.1)
    celluloid-extras (0.20.5)
      timers (>= 4.1.1)
    celluloid-fsm (0.20.5)
      timers (>= 4.1.1)
    celluloid-io (0.17.3)
      celluloid (>= 0.17.2)
      nio4r (>= 1.1)
      timers (>= 4.1.1)
    celluloid-pool (0.20.5)
      timers (>= 4.1.1)
    celluloid-supervision (0.20.6)
      timers (>= 4.1.1)
    chartjs-ror (3.7.0)
      rails (>= 3.1)
    coderay (1.1.3)
    coercible (1.0.0)
      descendants_tracker (~> 0.0.1)
    concurrent-ruby (1.1.10)
    connection_pool (2.3.0)
    crack (0.4.5)
      rexml
    crass (1.0.6)
    debug_inspector (1.1.0)
    descendants_tracker (0.0.4)
      thread_safe (~> 0.3, >= 0.3.1)
    diff-lcs (1.5.0)
    droplet_kit (3.18.0)
      faraday (>= 0.15)
      kartograph (~> 0.2.8)
      resource_kit (~> 0.1.5)
      virtus (>= 1.0.3, <= 3)
    erubi (1.11.0)
    excon (0.93.0)
    execjs (2.8.1)
    eye (0.10.0)
      celluloid (~> 0.17.3)
      celluloid-io (~> 0.17.0)
      kostya-sigar (~> 2.0.0)
      state_machines
      thor
    fabrication (2.30.0)
    faraday (2.6.0)
      faraday-net_http (>= 2.0, < 3.1)
      ruby2_keywords (>= 0.0.4)
    faraday-net_http (3.0.1)
    ffi (1.15.5)
    fog-aws (3.15.0)
      fog-core (~> 2.1)
      fog-json (~> 1.1)
      fog-xml (~> 0.1)
    fog-core (2.3.0)
      builder
      excon (~> 0.71)
      formatador (>= 0.2, < 2.0)
      mime-types
    fog-json (1.2.0)
      fog-core
      multi_json (~> 1.10)
    fog-xml (0.1.4)
      fog-core
      nokogiri (>= 1.5.11, < 2.0.0)
    formatador (1.1.0)
    globalid (1.0.0)
      activesupport (>= 5.0)
    hashdiff (1.0.1)
    httparty (0.20.0)
      mime-types (~> 3.0)
      multi_xml (>= 0.5.2)
    i18n (1.12.0)
      concurrent-ruby (~> 1.0)
    ice_nine (0.11.2)
    image_processing (1.12.2)
      mini_magick (>= 4.9.5, < 5)
      ruby-vips (>= 2.0.17, < 3)
    jbuilder (2.11.5)
      actionview (>= 5.0.0)
      activesupport (>= 5.0.0)
    jquery-rails (4.5.0)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json (2.6.2)
    kaminari (1.2.2)
      activesupport (>= 4.1.0)
      kaminari-actionview (= 1.2.2)
      kaminari-activerecord (= 1.2.2)
      kaminari-core (= 1.2.2)
    kaminari-actionview (1.2.2)
      actionview
      kaminari-core (= 1.2.2)
    kaminari-activerecord (1.2.2)
      activerecord
      kaminari-core (= 1.2.2)
    kaminari-core (1.2.2)
    kartograph (0.2.8)
    kostya-sigar (2.0.10)
    libv8-node (16.10.0.0-arm64-darwin)
    libv8-node (16.10.0.0-x86_64-linux)
    listen (3.0.8)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    logster (2.11.3)
    loofah (2.19.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (1.0.2)
    memory_profiler (1.0.0)
    method_source (1.0.0)
    mime-types (3.4.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2022.0105)
    mini_magick (4.11.0)
    mini_mime (1.1.2)
    mini_racer (0.6.3)
      libv8-node (~> 16.10.0.0)
    mini_scheduler (0.14.0)
      sidekiq (>= 4.2.3)
    minitest (5.16.3)
    multi_json (1.15.0)
    multi_xml (0.6.0)
    net-imap (0.3.1)
      net-protocol
    net-pop (0.1.2)
      net-protocol
    net-protocol (0.1.3)
      timeout
    net-smtp (0.3.2)
      net-protocol
    nio4r (2.5.8)
    nokogiri (1.13.9-arm64-darwin)
      racc (~> 1.4)
    nokogiri (1.13.9-x86_64-linux)
      racc (~> 1.4)
    parallel (1.22.1)
    parser (3.1.2.1)
      ast (~> 2.4.1)
    pg (1.4.4)
    popper_js (2.11.6)
    prometheus_exporter (2.0.3)
      webrick
    pry (0.14.1)
      coderay (~> 1.1)
      method_source (~> 1.0)
    pry-rails (0.3.9)
      pry (>= 0.10.4)
    public_suffix (5.0.0)
    puma (5.6.5)
      nio4r (~> 2.0)
    racc (1.6.0)
    rack (2.2.4)
    rack-mini-profiler (3.0.0)
      rack (>= 1.2.0)
    rack-test (2.0.2)
      rack (>= 1.3)
    rails (7.0.4)
      actioncable (= 7.0.4)
      actionmailbox (= 7.0.4)
      actionmailer (= 7.0.4)
      actionpack (= 7.0.4)
      actiontext (= 7.0.4)
      actionview (= 7.0.4)
      activejob (= 7.0.4)
      activemodel (= 7.0.4)
      activerecord (= 7.0.4)
      activestorage (= 7.0.4)
      activesupport (= 7.0.4)
      bundler (>= 1.15.0)
      railties (= 7.0.4)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.4.3)
      loofah (~> 2.3)
    railties (7.0.4)
      actionpack (= 7.0.4)
      activesupport (= 7.0.4)
      method_source
      rake (>= 12.2)
      thor (~> 1.0)
      zeitwerk (~> 2.5)
    rainbow (3.1.1)
    rake (13.0.6)
    rb-fsevent (0.11.2)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    redis (4.5.1)
    regexp_parser (2.6.0)
    resource_kit (0.1.8)
      addressable (>= 2.3.6, < 3.0.0)
    rexml (3.2.5)
    rspec-core (3.11.0)
      rspec-support (~> 3.11.0)
    rspec-expectations (3.11.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.11.0)
    rspec-mocks (3.11.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.11.0)
    rspec-rails (6.0.1)
      actionpack (>= 6.1)
      activesupport (>= 6.1)
      railties (>= 6.1)
      rspec-core (~> 3.11)
      rspec-expectations (~> 3.11)
      rspec-mocks (~> 3.11)
      rspec-support (~> 3.11)
    rspec-support (3.11.1)
    rubocop (1.36.0)
      json (~> 2.3)
      parallel (~> 1.10)
      parser (>= 3.1.2.1)
      rainbow (>= 2.2.2, < 4.0)
      regexp_parser (>= 1.8, < 3.0)
      rexml (>= 3.2.5, < 4.0)
      rubocop-ast (>= 1.20.1, < 2.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (>= 1.4.0, < 3.0)
    rubocop-ast (1.21.0)
      parser (>= 3.1.1.0)
    rubocop-discourse (3.0)
      rubocop (>= 1.1.0)
      rubocop-rspec (>= 2.0.0)
    rubocop-rspec (2.13.2)
      rubocop (~> 1.33)
    ruby-progressbar (1.11.0)
    ruby-vips (2.1.4)
      ffi (~> 1.12)
    ruby2_keywords (0.0.5)
    sassc (2.4.0)
      ffi (~> 1.9)
    sassc-rails (2.1.2)
      railties (>= 4.0.0)
      sassc (>= 2.0)
      sprockets (> 3.0)
      sprockets-rails
      tilt
    sidekiq (6.5.7)
      connection_pool (>= 2.2.5)
      rack (~> 2.0)
      redis (>= 4.5.0, < 5)
    sprockets (4.1.1)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.4.2)
      actionpack (>= 5.2)
      activesupport (>= 5.2)
      sprockets (>= 3.0.0)
    ssrf_filter (1.1.1)
    stackprof (0.2.22)
    state_machines (0.5.0)
    terser (1.1.12)
      execjs (>= 0.3.0, < 3)
    thor (1.2.1)
    thread_safe (0.3.6)
    tilt (2.0.11)
    timeout (0.3.0)
    timers (4.3.5)
    tzinfo (2.0.5)
      concurrent-ruby (~> 1.0)
    unicode-display_width (2.3.0)
    virtus (2.0.0)
      axiom-types (~> 0.1)
      coercible (~> 1.0)
      descendants_tracker (~> 0.0, >= 0.0.3)
    webmock (3.18.1)
      addressable (>= 2.8.0)
      crack (>= 0.3.2)
      hashdiff (>= 0.4.0, < 2.0.0)
    webrick (1.7.0)
    websocket-driver (0.7.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    zeitwerk (2.6.1)

PLATFORMS
  arm64-darwin-20
  arm64-darwin-21
  arm64-darwin-22
  x86_64-linux

DEPENDENCIES
  active_model_serializers (~> 0.8.3)
  acts_as_paranoid
  addressable
  better_errors
  binding_of_caller
  bootstrap (~> 5.2.0)
  byebug
  carrierwave
  chartjs-ror
  droplet_kit
  eye
  fabrication
  fog-aws
  httparty
  jbuilder
  jquery-rails
  kaminari
  listen (~> 3.0.5)
  logster
  memory_profiler
  mini_racer
  mini_scheduler
  pg
  prometheus_exporter
  pry-rails
  puma (~> 5.0)
  rack-mini-profiler
  rails (~> 7.0.1)
  redis (< 4.6)
  rspec-rails
  rubocop-discourse
  sassc-rails
  sidekiq
  sprockets-rails
  stackprof
  terser
  webmock

BUNDLED WITH
   2.3.5

@deivid-rodriguez
Copy link
Contributor

deivid-rodriguez commented Oct 24, 2022

Actually I think this is expected. Dependabot's default behavior is "non conservative", namely, when updating a dependency, it also updates indirect dependencies of it. And I believe nokogiri is an indirect dependency of rspec-rails (rspec-rails > actionpack > rails-dom-testing > nokogiri).

The above behavior is intentional, see #2246.

However, I do agree that:

  • PR should probably mention the transitive dependencies upgraded together with the direct dependency.
  • It should probably NOT be the default if updating indirect dependencies is explicit in configuration.
  • We may want to allow configuring this behavior.

@mloberg
Copy link

mloberg commented Oct 25, 2022

I'm having a similar issue, but I'm getting a downgrades from unrelated libraries.

I can't share the repository, but the PR is updating aws-sdk-core from 3.160.0 to 3.164.0. As part of this, it's downgrading an unrelated kubeclient library along with others.

dependabot-pr

@deivid-rodriguez
Copy link
Contributor

That seems unexpected. Like @t-tiger is trying to do, if you can reduce this to a Gemfile and Gemfile.lock file that you can share and reproduces the issue, that would go a long way with fixing this.

@mloberg
Copy link

mloberg commented Oct 25, 2022

mloberg/dependabot-bundler-downgrade-issue#2 matches the issue I mentioned exactly. The other PRs that were created also match the PRs that were generated and have the same issue where a bunch of unrelated libraries are being changed

@deivid-rodriguez
Copy link
Contributor

Thank you! I'll have a look!

@ashkulz
Copy link

ashkulz commented Nov 1, 2022

@deivid-rodriguez any luck with figuring this out? We too have the same issue.

@deivid-rodriguez
Copy link
Contributor

Hei @ashkulz, I didn't have time yet, hope to look at this tomorrow.

@deivid-rodriguez
Copy link
Contributor

I pushed a fix for this issue. Commenting @dependabot recreate on the incorrect PRs should now fix things. Let me know how that goes!

@mloberg
Copy link

mloberg commented Nov 3, 2022

@deivid-rodriguez Things are looking good. Thanks!

@ashkulz
Copy link

ashkulz commented Nov 4, 2022

Same here, dependabot was timing out for us for one repo which seems to have been fixed by this as well 🎉

@t-tiger
Copy link
Author

t-tiger commented Nov 11, 2022

@deivid-rodriguez Thank you so much for the effort!!

@deivid-rodriguez
Copy link
Contributor

No problem! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: ruby:bundler RubyGems via bundler T: bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants