Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
237d7a54
Commit
237d7a54
authored
Aug 03, 2021
by
Siddharth Asthana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated deployment workers
Changelog: other
parent
1af8722a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
201 deletions
+0
-201
app/workers/all_queues.yml
app/workers/all_queues.yml
+0
-27
app/workers/build_success_worker.rb
app/workers/build_success_worker.rb
+0
-2
app/workers/deployments/finished_worker.rb
app/workers/deployments/finished_worker.rb
+0
-24
app/workers/deployments/forward_deployment_worker.rb
app/workers/deployments/forward_deployment_worker.rb
+0
-20
app/workers/deployments/success_worker.rb
app/workers/deployments/success_worker.rb
+0
-25
spec/workers/deployments/finished_worker_spec.rb
spec/workers/deployments/finished_worker_spec.rb
+0
-65
spec/workers/deployments/success_worker_spec.rb
spec/workers/deployments/success_worker_spec.rb
+0
-38
No files found.
app/workers/all_queues.yml
View file @
237d7a54
...
...
@@ -673,24 +673,6 @@
:idempotent:
:tags:
- :exclude_from_kubernetes
-
:name: deployment:deployments_finished
:worker_name: Deployments::FinishedWorker
:feature_category: :continuous_delivery
:has_external_dependencies:
:urgency: :low
:resource_boundary: :cpu
:weight:
3
:idempotent:
:tags: []
-
:name: deployment:deployments_forward_deployment
:worker_name: Deployments::ForwardDeploymentWorker
:feature_category: :continuous_delivery
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight:
3
:idempotent:
:tags: []
-
:name: deployment:deployments_hooks
:worker_name: Deployments::HooksWorker
:feature_category: :continuous_delivery
...
...
@@ -709,15 +691,6 @@
:weight:
3
:idempotent:
true
:tags: []
-
:name: deployment:deployments_success
:worker_name: Deployments::SuccessWorker
:feature_category: :continuous_delivery
:has_external_dependencies:
:urgency: :low
:resource_boundary: :cpu
:weight:
3
:idempotent:
:tags: []
-
:name: deployment:deployments_update_environment
:worker_name: Deployments::UpdateEnvironmentWorker
:feature_category: :continuous_delivery
...
...
app/workers/build_success_worker.rb
View file @
237d7a54
...
...
@@ -21,8 +21,6 @@ class BuildSuccessWorker # rubocop:disable Scalability/IdempotentWorker
private
##
# TODO: This should be processed in DeploymentSuccessWorker once we started storing `action` value in `deployments` records
def
stop_environment
(
build
)
build
.
persisted_environment
.
fire_state_event
(
:stop
)
end
...
...
app/workers/deployments/finished_worker.rb
deleted
100644 → 0
View file @
1af8722a
# 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
class
FinishedWorker
# rubocop:disable Scalability/IdempotentWorker
include
ApplicationWorker
data_consistency
:always
sidekiq_options
retry:
3
queue_namespace
:deployment
feature_category
:continuous_delivery
worker_resource_boundary
:cpu
def
perform
(
deployment_id
)
if
(
deploy
=
Deployment
.
find_by_id
(
deployment_id
))
LinkMergeRequestsService
.
new
(
deploy
).
execute
deploy
.
execute_hooks
(
Time
.
current
)
end
end
end
end
app/workers/deployments/forward_deployment_worker.rb
deleted
100644 → 0
View file @
1af8722a
# 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
class
ForwardDeploymentWorker
# rubocop:disable Scalability/IdempotentWorker
include
ApplicationWorker
data_consistency
:always
sidekiq_options
retry:
3
queue_namespace
:deployment
feature_category
:continuous_delivery
def
perform
(
deployment_id
)
Deployments
::
OlderDeploymentsDropService
.
new
(
deployment_id
).
execute
end
end
end
app/workers/deployments/success_worker.rb
deleted
100644 → 0
View file @
1af8722a
# 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
class
SuccessWorker
# rubocop:disable Scalability/IdempotentWorker
include
ApplicationWorker
data_consistency
:always
sidekiq_options
retry:
3
queue_namespace
:deployment
feature_category
:continuous_delivery
worker_resource_boundary
:cpu
def
perform
(
deployment_id
)
Deployment
.
find_by_id
(
deployment_id
).
try
do
|
deployment
|
break
unless
deployment
.
success?
Deployments
::
UpdateEnvironmentService
.
new
(
deployment
).
execute
end
end
end
end
spec/workers/deployments/finished_worker_spec.rb
deleted
100644 → 0
View file @
1af8722a
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Deployments
::
FinishedWorker
do
let
(
:worker
)
{
described_class
.
new
}
describe
'#perform'
do
before
do
allow
(
ProjectServiceWorker
).
to
receive
(
:perform_async
)
end
it
'links merge requests to the deployment'
do
deployment
=
create
(
:deployment
)
service
=
instance_double
(
Deployments
::
LinkMergeRequestsService
)
expect
(
Deployments
::
LinkMergeRequestsService
)
.
to
receive
(
:new
)
.
with
(
deployment
)
.
and_return
(
service
)
expect
(
service
).
to
receive
(
:execute
)
worker
.
perform
(
deployment
.
id
)
end
it
'executes project services for deployment_hooks'
do
deployment
=
create
(
:deployment
)
project
=
deployment
.
project
service
=
create
(
:service
,
type:
'SlackService'
,
project:
project
,
deployment_events:
true
,
active:
true
)
worker
.
perform
(
deployment
.
id
)
expect
(
ProjectServiceWorker
).
to
have_received
(
:perform_async
).
with
(
service
.
id
,
an_instance_of
(
Hash
))
end
it
'does not execute an inactive service'
do
deployment
=
create
(
:deployment
)
project
=
deployment
.
project
create
(
:service
,
type:
'SlackService'
,
project:
project
,
deployment_events:
true
,
active:
false
)
worker
.
perform
(
deployment
.
id
)
expect
(
ProjectServiceWorker
).
not_to
have_received
(
:perform_async
)
end
it
'does nothing if a deployment with the given id does not exist'
do
worker
.
perform
(
0
)
expect
(
ProjectServiceWorker
).
not_to
have_received
(
:perform_async
)
end
it
'execute webhooks'
do
deployment
=
create
(
:deployment
)
project
=
deployment
.
project
web_hook
=
create
(
:project_hook
,
deployment_events:
true
,
project:
project
)
expect_next_instance_of
(
WebHookService
,
web_hook
,
an_instance_of
(
Hash
),
"deployment_hooks"
)
do
|
service
|
expect
(
service
).
to
receive
(
:async_execute
)
end
worker
.
perform
(
deployment
.
id
)
end
end
end
spec/workers/deployments/success_worker_spec.rb
deleted
100644 → 0
View file @
1af8722a
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Deployments
::
SuccessWorker
do
subject
{
described_class
.
new
.
perform
(
deployment
&
.
id
)
}
context
'when successful deployment'
do
let
(
:deployment
)
{
create
(
:deployment
,
:success
)
}
it
'executes Deployments::UpdateEnvironmentService'
do
expect
(
Deployments
::
UpdateEnvironmentService
)
.
to
receive
(
:new
).
with
(
deployment
).
and_call_original
subject
end
end
context
'when canceled deployment'
do
let
(
:deployment
)
{
create
(
:deployment
,
:canceled
)
}
it
'does not execute Deployments::UpdateEnvironmentService'
do
expect
(
Deployments
::
UpdateEnvironmentService
).
not_to
receive
(
:new
)
subject
end
end
context
'when deploy record does not exist'
do
let
(
:deployment
)
{
nil
}
it
'does not execute Deployments::UpdateEnvironmentService'
do
expect
(
Deployments
::
UpdateEnvironmentService
).
not_to
receive
(
:new
)
subject
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment