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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
ca12079a
Commit
ca12079a
authored
Mar 27, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove code deprecated in pipeline process service
parent
9fc17f6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
74 deletions
+0
-74
app/services/ci/process_pipeline_service.rb
app/services/ci/process_pipeline_service.rb
+0
-15
spec/services/ci/process_pipeline_service_spec.rb
spec/services/ci/process_pipeline_service_spec.rb
+0
-59
No files found.
app/services/ci/process_pipeline_service.rb
View file @
ca12079a
...
...
@@ -5,8 +5,6 @@ module Ci
def
execute
(
pipeline
)
@pipeline
=
pipeline
ensure_created_builds!
# TODO, remove me in 9.0
new_builds
=
stage_indexes_of_created_builds
.
map
do
|
index
|
process_stage
(
index
)
...
...
@@ -73,18 +71,5 @@ module Ci
def
created_builds
pipeline
.
builds
.
created
end
# This method is DEPRECATED and should be removed in 9.0.
#
# We need it to maintain backwards compatibility with previous versions
# when builds were not created within one transaction with the pipeline.
#
def
ensure_created_builds!
return
if
created_builds
.
any?
Ci
::
CreatePipelineBuildsService
.
new
(
project
,
current_user
)
.
execute
(
pipeline
)
end
end
end
spec/services/ci/process_pipeline_service_spec.rb
View file @
ca12079a
...
...
@@ -418,65 +418,6 @@ describe Ci::ProcessPipelineService, '#execute', :services do
end
end
context
'when there are builds that are not created yet'
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
config:
config
)
end
let
(
:config
)
do
{
rspec:
{
stage:
'test'
,
script:
'rspec'
},
deploy:
{
stage:
'deploy'
,
script:
'rsync'
}
}
end
before
do
create_build
(
'linux'
,
stage:
'build'
,
stage_idx:
0
)
create_build
(
'mac'
,
stage:
'build'
,
stage_idx:
0
)
end
it
'processes the pipeline'
do
# Currently we have five builds with state created
#
expect
(
builds
.
count
).
to
eq
(
0
)
expect
(
all_builds
.
count
).
to
eq
(
2
)
# Process builds service will enqueue builds from the first stage.
#
process_pipeline
expect
(
builds
.
count
).
to
eq
(
2
)
expect
(
all_builds
.
count
).
to
eq
(
2
)
# When builds succeed we will enqueue remaining builds.
#
# We will have 2 succeeded, 1 pending (from stage test), total 4 (two
# additional build from `.gitlab-ci.yml`).
#
succeed_pending
process_pipeline
expect
(
builds
.
success
.
count
).
to
eq
(
2
)
expect
(
builds
.
pending
.
count
).
to
eq
(
1
)
expect
(
all_builds
.
count
).
to
eq
(
4
)
# When pending merge_when_pipeline_succeeds in stage test, we enqueue deploy stage.
#
succeed_pending
process_pipeline
expect
(
builds
.
pending
.
count
).
to
eq
(
1
)
expect
(
builds
.
success
.
count
).
to
eq
(
3
)
expect
(
all_builds
.
count
).
to
eq
(
4
)
# When the last one succeeds we have 4 successful builds.
#
succeed_pending
process_pipeline
expect
(
builds
.
success
.
count
).
to
eq
(
4
)
expect
(
all_builds
.
count
).
to
eq
(
4
)
end
end
def
process_pipeline
described_class
.
new
(
pipeline
.
project
,
user
).
execute
(
pipeline
)
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