Commit af5d7e13 authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'sk/247536-fix-tech-debt' into 'master'

Rename ForwardDeploymentWorker to DropOlderDeploymentsWorker

See merge request gitlab-org/gitlab!44862
parents 3d77669a 116aeb7e
...@@ -73,7 +73,7 @@ class Deployment < ApplicationRecord ...@@ -73,7 +73,7 @@ class Deployment < ApplicationRecord
next unless deployment.project.forward_deployment_enabled? next unless deployment.project.forward_deployment_enabled?
deployment.run_after_commit do deployment.run_after_commit do
Deployments::ForwardDeploymentWorker.perform_async(id) Deployments::DropOlderDeploymentsWorker.perform_async(id)
end end
end end
......
...@@ -435,6 +435,14 @@ ...@@ -435,6 +435,14 @@
:weight: 1 :weight: 1
:idempotent: true :idempotent: true
:tags: [] :tags: []
- :name: deployment:deployments_drop_older_deployments
:feature_category: :continuous_delivery
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight: 3
:idempotent:
:tags: []
- :name: deployment:deployments_execute_hooks - :name: deployment:deployments_execute_hooks
:feature_category: :continuous_delivery :feature_category: :continuous_delivery
:has_external_dependencies: :has_external_dependencies:
......
# frozen_string_literal: true
module Deployments
class DropOlderDeploymentsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
queue_namespace :deployment
feature_category :continuous_delivery
def perform(deployment_id)
Deployments::OlderDeploymentsDropService.new(deployment_id).execute
end
end
end
# frozen_string_literal: true # frozen_string_literal: true
# This worker is deprecated and will be removed in 14.0
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/266381
module Deployments module Deployments
class FinishedWorker # rubocop:disable Scalability/IdempotentWorker class FinishedWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
......
# frozen_string_literal: true # frozen_string_literal: true
# This worker is deprecated and will be removed in 14.0
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/266381
module Deployments module Deployments
class ForwardDeploymentWorker # rubocop:disable Scalability/IdempotentWorker class ForwardDeploymentWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
......
# frozen_string_literal: true # frozen_string_literal: true
# This worker is deprecated and will be removed in 14.0
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/266381
module Deployments module Deployments
class SuccessWorker # rubocop:disable Scalability/IdempotentWorker class SuccessWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
......
...@@ -122,8 +122,8 @@ RSpec.describe Deployment do ...@@ -122,8 +122,8 @@ RSpec.describe Deployment do
deployment.run! deployment.run!
end end
it 'executes Deployments::ForwardDeploymentWorker asynchronously' do it 'executes Deployments::DropOlderDeploymentsWorker asynchronously' do
expect(Deployments::ForwardDeploymentWorker) expect(Deployments::DropOlderDeploymentsWorker)
.to receive(:perform_async).once.with(deployment.id) .to receive(:perform_async).once.with(deployment.id)
deployment.run! deployment.run!
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Deployments::DropOlderDeploymentsWorker do
subject { described_class.new.perform(deployment&.id) }
describe '#perform' do
let(:deployment) { create(:deployment, :success) }
it 'executes Deployments::OlderDeploymentsDropService' do
expect(Deployments::OlderDeploymentsDropService)
.to receive(:new).with(deployment.id).and_call_original
subject
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