Flag duplicate versions of the same gem

We should avoid shipping multiple versions of the same gem if possible. Omnibus currently pulls gems from Gitaly, GitLab CE/EE, etc., and it's possible that certain gems need to be updated across the board (e.g. https://gitlab.com/gitlab-org/gitaly/issues/1296).

For example, in GitLab 13.11.0 (ee), I see in /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems some potentially unnecessary versions:

script: (cd /opt/gitlab/embedded/lib/ruby/gems/*/gems; for g in $(ls | sed 's/-[^-]*$//' | uniq -c | grep -v '^ *1' | sed 's/^.* //'); do grep ^${g}-[0-9] <(ls) | paste -s -d ',,' | sed -z "s/$g-//g; s/^/- $g: /; s/\n//"; echo ": https://rubygems.org/gems/$g"; done)

Difference in GitLab 11.1.0 by @stanhu

For example, in GitLab 11.1.0, I see in /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems some potentially unnecessary versions:

  • sidekiq-4.2.10, sidekiq-5.1.3 (this one surprised me the most!)
  • bundler-1.16.1, bundler-1.16.2
  • faraday-0.12.2, faraday-0.15.2
  • tzinfo-1.2.2, tzinfo-1.2.5
  • tilt-2.0.6, tilt-2.0.8
  • rspec-3.6.0, rspec-3.7.0
  • rspec-core-3.6.0, rspec-core-3.7.1
  • rspec-expectations-3.6.0, rspec-expectations-3.7.0
  • ruby-progressbar-1.8.3, ruby-progressbar-1.9.0
Edited by Takuya Noguchi