We are installing a lot of bundlers
Overview
@tkuah reported in Slack that GDK is installing three different bundlers (like more if you have a new installation):
--------------------------------------------------------------------------------
Ensuring all required versions of bundler are installed
--------------------------------------------------------------------------------
Successfully installed bundler-2.2.30
Parsing documentation for bundler-2.2.30
Installing ri documentation for bundler-2.2.30
Done installing documentation for bundler after 1 seconds
1 gem installed
Successfully installed bundler-2.2.22
Parsing documentation for bundler-2.2.22
Installing ri documentation for bundler-2.2.22
Done installing documentation for bundler after 2 seconds
1 gem installed
Successfully installed bundler-1.17.3
Parsing documentation for bundler-1.17.3
Installing ri documentation for bundler-1.17.3
Done installing documentation for bundler after 2 seconds
1 gem installed
By investigating where this comes from:
The command used to find the Gemfiles is the following: https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/support/bootstrap-common.sh#L101-118
find . -type f -name Gemfile.lock -exec awk '/BUNDLED WITH/{getline;print $NF;}' {} + 2> /dev/null
a slightly modified version of it provides the source files:
find . -type f -name Gemfile.lock | xargs grep -A1 'BUNDLED WITH'
./gitaly/danger/Gemfile.lock:BUNDLED WITH
./gitaly/danger/Gemfile.lock- 2.2.22
--
./gitaly/ruby/Gemfile.lock:BUNDLED WITH
./gitaly/ruby/Gemfile.lock- 2.1.4
--
./gitlab/tooling/overcommit/Gemfile.lock:BUNDLED WITH
./gitlab/tooling/overcommit/Gemfile.lock- 2.1.4
--
./gitlab/qa/qa/ee/fixtures/secure_scanning_enable_from_ui_files/Gemfile.lock:BUNDLED WITH
./gitlab/qa/qa/ee/fixtures/secure_scanning_enable_from_ui_files/Gemfile.lock- 2.1.4
--
./gitlab/qa/qa/fixtures/auto_devops_rack/Gemfile.lock:BUNDLED WITH
./gitlab/qa/qa/fixtures/auto_devops_rack/Gemfile.lock- 1.17.3
--
./gitlab/qa/Gemfile.lock:BUNDLED WITH
./gitlab/qa/Gemfile.lock- 2.2.30
--
./gitlab/Gemfile.lock:BUNDLED WITH
./gitlab/Gemfile.lock- 2.1.4
--
./gitlab/tmp/tests/gitaly/danger/Gemfile.lock:BUNDLED WITH
./gitlab/tmp/tests/gitaly/danger/Gemfile.lock- 2.2.22
--
./gitlab/tmp/tests/gitaly/ruby/Gemfile.lock:BUNDLED WITH
./gitlab/tmp/tests/gitaly/ruby/Gemfile.lock- 2.1.4
--
./gitlab/vendor/gems/mail-smtp_pool/Gemfile.lock:BUNDLED WITH
./gitlab/vendor/gems/mail-smtp_pool/Gemfile.lock- 2.1.4
--
./gitlab-shell/Gemfile.lock:BUNDLED WITH
./gitlab-shell/Gemfile.lock- 2.1.4
--
./Gemfile.lock:BUNDLED WITH
./Gemfile.lock- 2.1.4
the one using 1.17
is a fixture and all the others should work with latest
2.x
.
Proposal (optional)
Check gitlab
and gdk
bundler versions, and install the most recent of the two. Any bundler in 2.x should be fine and should work with a Gemfile created by an earlier version.
Running find through the whole directory to find Gemfile.lock files takes about 5.5s in my macbook, if we don't do that traversal and just look at 2 specific files in places we know, we can likely cut that 5.5s entirely