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
38e49069
Commit
38e49069
authored
Apr 19, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement PipelineBridge service
parent
0be6a04d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
ee/app/services/ci/pipeline_bridge_service.rb
ee/app/services/ci/pipeline_bridge_service.rb
+11
-0
ee/spec/services/ci/pipeline_bridge_service_spec.rb
ee/spec/services/ci/pipeline_bridge_service_spec.rb
+25
-0
No files found.
ee/app/services/ci/pipeline_bridge_service.rb
0 → 100644
View file @
38e49069
# frozen_string_literal: true
module
Ci
class
PipelineBridgeService
<
::
BaseService
def
execute
(
pipeline
)
pipeline
.
bridged_jobs
.
each
do
|
bridged_job
|
bridged_job
.
update
(
status:
pipeline
.
status
)
end
end
end
end
ee/spec/services/ci/pipeline_bridge_service_spec.rb
0 → 100644
View file @
38e49069
# frozen_string_literal: true
require
'spec_helper'
describe
Ci
::
PipelineBridgeService
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:success
,
project:
project
)
}
describe
'#execute'
do
subject
{
described_class
.
new
(
project
,
user
).
execute
(
pipeline
)
}
context
'when pipeline has bridged jobs'
do
let
(
:bridge
)
{
create
(
:ci_bridge
,
status: :pending
)
}
before
do
pipeline
.
bridged_jobs
<<
bridge
end
it
'updates the bridge status with the pipeline status'
do
expect
{
subject
}.
to
change
{
bridge
.
status
}.
from
(
'pending'
).
to
(
'success'
)
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