Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab_shell_worker.rb « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1bcaf5a42be406bed84288151cdf06c05ac02c33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true

class GitlabShellWorker # rubocop:disable Scalability/IdempotentWorker
  include ApplicationWorker

  data_consistency :always

  sidekiq_options retry: 3
  include Gitlab::ShellAdapter

  feature_category :source_code_management
  urgency :high
  weight 2
  loggable_arguments 0

  def perform(action, *arg)
    # Gitlab::Shell is being removed but we need to continue to process jobs
    # enqueued in the previous release, so handle them here.
    #
    # See https://gitlab.com/gitlab-org/gitlab/-/issues/25095 for more details
    if AuthorizedKeysWorker::PERMITTED_ACTIONS.include?(action.to_s)
      AuthorizedKeysWorker.new.perform(action, *arg)

      return
    end

    Gitlab::GitalyClient::NamespaceService.allow do
      gitlab_shell.__send__(action, *arg) # rubocop:disable GitlabSecurity/PublicSend
    end
  end
end