Commit 63fd15f5 authored by Yaya's avatar Yaya Committed by Yureka
Browse files

gitlab: Un-vendor sidekiq

The sidekiq dependency was vendored to maintain compatibility with Redis
6.0 (as stated in this [comment]) but unfortunately, it seems to cause a
crash in the application, as noted in this [upstream issue].

We can safely swap out the dependency, as our Redis release in nixpkgs
is >= 7.0.

[comment]: https://gitlab.com/gitlab-org/gitlab/-/issues/468435#note_1979750600
[upstream issue]: https://gitlab.com/gitlab-org/gitlab/-/issues/468435
parent 6c877bbd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ gem 'state_machines-activerecord', '~> 0.8.0' # rubocop:todo Gemfile/MissingFeat
gem 'acts-as-taggable-on', '~> 10.0' # rubocop:todo Gemfile/MissingFeatureCategory

# Background jobs
gem 'sidekiq', path: 'vendor/gems/sidekiq-7.1.6', require: 'sidekiq', feature_category: :scalability
gem 'sidekiq', '~> 7.1.6', feature_category: :scalability
gem 'sidekiq-cron', '~> 1.12.0', feature_category: :scalability
gem 'gitlab-sidekiq-fetcher',
  path: 'vendor/gems/sidekiq-reliable-fetch',
+6 −10
Original line number Diff line number Diff line
@@ -173,15 +173,6 @@ PATH
      nokogiri (>= 1.4.4)
      omniauth (~> 2.0)

PATH
  remote: vendor/gems/sidekiq-7.1.6
  specs:
    sidekiq (7.1.6)
      concurrent-ruby (< 2)
      connection_pool (>= 2.3.0)
      rack (>= 2.2.4)
      redis-client (>= 0.14.0)

PATH
  remote: vendor/gems/sidekiq-reliable-fetch
  specs:
@@ -1668,6 +1659,11 @@ GEM
    shellany (0.0.1)
    shoulda-matchers (5.1.0)
      activesupport (>= 5.2.0)
    sidekiq (7.1.6)
      concurrent-ruby (< 2)
      connection_pool (>= 2.3.0)
      rack (>= 2.2.4)
      redis-client (>= 0.14.0)
    sidekiq-cron (1.12.0)
      fugit (~> 1.8)
      globalid (>= 1.0.1)
@@ -2213,7 +2209,7 @@ DEPENDENCIES
  sentry-ruby (~> 5.17.3)
  sentry-sidekiq (~> 5.17.3)
  shoulda-matchers (~> 5.1.0)
  sidekiq!
  sidekiq (~> 7.1.6)
  sidekiq-cron (~> 1.12.0)
  sigdump (~> 0.2.4)
  simple_po_parser (~> 1.1.6)
+3 −2
Original line number Diff line number Diff line
@@ -6175,8 +6175,9 @@ src:
    groups = ["default"];
    platforms = [];
    source = {
      path = "${src}/vendor/gems/sidekiq-7.1.6";
      type = "path";
      remotes = ["https://rubygems.org"];
      sha256 = "18j3g31ps6ga9nzza0z0d00qjrn810fhkhx2pqi3rvxwsmkdlnbq";
      type = "gem";
    };
    version = "7.1.6";
  };
+16 −1
Original line number Diff line number Diff line
@@ -180,6 +180,21 @@ def update_rubyenv():
        cwd=rubyenv_dir,
    )

    # Un-vendor sidekiq
    #
    # The sidekiq dependency was vendored to maintain compatibility with Redis 6.0 (as
    # stated in this [comment]) but unfortunately, it seems to cause a crash in the
    # application, as noted in this [upstream issue].
    #
    # We can safely swap out the dependency, as our Redis release in nixpkgs is >= 7.0.
    #
    # [comment]: https://gitlab.com/gitlab-org/gitlab/-/issues/468435#note_1979750600
    # [upstream issue]: https://gitlab.com/gitlab-org/gitlab/-/issues/468435
    subprocess.check_output(
        ["sed", "-i", "s|gem 'sidekiq', path: 'vendor/gems/sidekiq-7.1.6', require: 'sidekiq'|gem 'sidekiq', '~> 7.1.6'|g", "Gemfile"],
        cwd=rubyenv_dir,
    )

    # Fetch vendored dependencies temporarily in order to build the gemset.nix
    subprocess.check_output(["mkdir", "-p", "vendor/gems", "gems"], cwd=rubyenv_dir)
    subprocess.check_output(
@@ -194,7 +209,7 @@ def update_rubyenv():
        [
            "sh",
            "-c",
            f"curl -L https://gitlab.com/gitlab-org/gitlab/-/archive/v{version}-ee/gitlab-v{version}-ee.tar.bz2?path=gems | tar -xj --strip-components=3",
            f"curl -L https://gitlab.com/gitlab-org/gitlab/-/archive/v{version}-ee/gitlab-v{version}-ee.tar.bz2?path=gems | tar -xj --strip-components=2",
        ],
        cwd=f"{rubyenv_dir}/gems",
    )