2018-06-27 03:23:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 13:09:10 -05:00
|
|
|
class GitlabShellWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2013-03-21 15:01:14 -04:00
|
|
|
include Gitlab::ShellAdapter
|
2013-01-28 10:22:45 -05:00
|
|
|
|
2019-10-18 07:11:44 -04:00
|
|
|
feature_category :source_code_management
|
2020-03-02 13:07:42 -05:00
|
|
|
urgency :high
|
2020-01-24 13:09:00 -05:00
|
|
|
weight 2
|
2020-06-12 08:08:56 -04:00
|
|
|
loggable_arguments 0
|
2019-10-18 07:11:44 -04:00
|
|
|
|
2013-01-28 14:02:10 -05:00
|
|
|
def perform(action, *arg)
|
2020-03-12 08:09:17 -04:00
|
|
|
# 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
|
2020-03-23 14:09:25 -04:00
|
|
|
if AuthorizedKeysWorker::PERMITTED_ACTIONS.include?(action.to_s)
|
2020-03-12 08:09:17 -04:00
|
|
|
AuthorizedKeysWorker.new.perform(action, *arg)
|
|
|
|
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2019-11-18 13:06:53 -05:00
|
|
|
Gitlab::GitalyClient::NamespaceService.allow do
|
|
|
|
gitlab_shell.__send__(action, *arg) # rubocop:disable GitlabSecurity/PublicSend
|
|
|
|
end
|
2013-01-28 10:22:45 -05:00
|
|
|
end
|
|
|
|
end
|