Commit 5d4c627a authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@13-12-stable-ee

parent c6bad18a
...@@ -2116,6 +2116,15 @@ ...@@ -2116,6 +2116,15 @@
:idempotent: true :idempotent: true
:tags: :tags:
- :exclude_from_kubernetes - :exclude_from_kubernetes
- :name: git_garbage_collect
:worker_name: GitGarbageCollectWorker
:feature_category: :gitaly
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight: 1
:idempotent:
:tags: []
- :name: github_import_advance_stage - :name: github_import_advance_stage
:worker_name: Gitlab::GithubImport::AdvanceStageWorker :worker_name: Gitlab::GithubImport::AdvanceStageWorker
:feature_category: :importers :feature_category: :importers
......
# frozen_string_literal: true
# According to our docs, we can only remove workers on major releases
# https://docs.gitlab.com/ee/development/sidekiq_style_guide.html#removing-workers.
#
# We need to still maintain this until 14.0 but with the current functionality.
#
# In https://gitlab.com/gitlab-org/gitlab/-/issues/299290 we track that removal.
class GitGarbageCollectWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: false
feature_category :gitaly
loggable_arguments 1, 2, 3
def perform(project_id, task = :gc, lease_key = nil, lease_uuid = nil)
::Projects::GitGarbageCollectWorker.new.perform(project_id, task, lease_key, lease_uuid)
end
end
...@@ -152,6 +152,8 @@ ...@@ -152,6 +152,8 @@
- 1 - 1
- - geo - - geo
- 1 - 1
- - git_garbage_collect
- 1
- - github_import_advance_stage - - github_import_advance_stage
- 1 - 1
- - github_importer - - github_importer
......
# frozen_string_literal: true
require 'fileutils'
require 'spec_helper'
RSpec.describe GitGarbageCollectWorker do
let_it_be(:project) { create(:project, :repository) }
let(:lease_uuid) { SecureRandom.uuid }
let(:lease_key) { "project_housekeeping:#{project.id}" }
let(:task) { :full_repack }
let(:params) { [project.id, task, lease_key, lease_uuid] }
subject { described_class.new }
describe "#perform" do
it 'calls the Projects::GitGarbageGitGarbageCollectWorker with the same params' do
expect_next_instance_of(Projects::GitGarbageCollectWorker) do |instance|
expect(instance).to receive(:perform).with(*params)
end
subject.perform(*params)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment