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
dd73af2e
Commit
dd73af2e
authored
Apr 19, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement PipelineBridge worker
parent
38e49069
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
0 deletions
+55
-0
ee/app/workers/all_queues.yml
ee/app/workers/all_queues.yml
+1
-0
ee/app/workers/ci/pipeline_bridge_worker.rb
ee/app/workers/ci/pipeline_bridge_worker.rb
+16
-0
ee/spec/workers/ci/pipeline_bridge_worker_spec.rb
ee/spec/workers/ci/pipeline_bridge_worker_spec.rb
+38
-0
No files found.
ee/app/workers/all_queues.yml
View file @
dd73af2e
...
...
@@ -44,6 +44,7 @@
-
pipeline_default:store_security_reports
-
pipeline_default:ci_create_cross_project_pipeline
-
pipeline_default:ci_pipeline_bridge
-
incident_management:incident_management_process_alert
...
...
ee/app/workers/ci/pipeline_bridge_worker.rb
0 → 100644
View file @
dd73af2e
# frozen_string_literal: true
module
Ci
class
PipelineBridgeWorker
include
::
ApplicationWorker
include
::
PipelineQueue
def
perform
(
pipeline_id
)
::
Ci
::
Pipeline
.
find_by_id
(
pipeline_id
).
try
do
|
pipeline
|
::
Ci
::
PipelineBridgeService
.
new
(
pipeline
.
project
,
pipeline
.
user
)
.
execute
(
pipeline
)
end
end
end
end
ee/spec/workers/ci/pipeline_bridge_worker_spec.rb
0 → 100644
View file @
dd73af2e
# frozen_string_literal: true
require
'spec_helper'
describe
Ci
::
PipelineBridgeWorker
do
describe
'#perform'
do
subject
{
described_class
.
new
.
perform
(
pipeline_id
)
}
context
'when pipeline exists'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:pipeline_id
)
{
pipeline
.
id
}
it
'calls the service'
do
service
=
double
(
'bridge status service'
)
expect
(
Ci
::
PipelineBridgeService
)
.
to
receive
(
:new
)
.
with
(
pipeline
.
project
,
pipeline
.
user
)
.
and_return
(
service
)
expect
(
service
).
to
receive
(
:execute
).
with
(
pipeline
)
subject
end
end
context
'when pipeline does not exist'
do
let
(
:pipeline_id
)
{
1234
}
it
'does not call the service'
do
expect
(
Ci
::
PipelineBridgeService
)
.
not_to
receive
(
:new
)
subject
end
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