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
6f20134d
Commit
6f20134d
authored
Mar 21, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove legacy service for creating pipeline stages
parent
3145cbaa
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
24 deletions
+9
-24
app/services/ci/create_pipeline_stages_service.rb
app/services/ci/create_pipeline_stages_service.rb
+0
-10
lib/gitlab/ci/pipeline/chain/create.rb
lib/gitlab/ci/pipeline/chain/create.rb
+4
-3
lib/gitlab/ci/pipeline/seed/base.rb
lib/gitlab/ci/pipeline/seed/base.rb
+1
-1
lib/gitlab/ci/pipeline/seed/stage.rb
lib/gitlab/ci/pipeline/seed/stage.rb
+1
-7
spec/lib/gitlab/ci/pipeline/seed/stage_spec.rb
spec/lib/gitlab/ci/pipeline/seed/stage_spec.rb
+3
-3
No files found.
app/services/ci/create_pipeline_stages_service.rb
deleted
100644 → 0
View file @
3145cbaa
module
Ci
class
CreatePipelineStagesService
<
BaseService
def
execute
(
pipeline
)
pipeline
.
stage_seeds
.
each
do
|
seed
|
seed
.
user
=
current_user
seed
.
create!
end
end
end
end
lib/gitlab/ci/pipeline/chain/create.rb
View file @
6f20134d
...
@@ -11,9 +11,10 @@ module Gitlab
...
@@ -11,9 +11,10 @@ module Gitlab
@command
.
seeds_block
&
.
call
(
pipeline
)
@command
.
seeds_block
&
.
call
(
pipeline
)
::
Ci
::
CreatePipelineStagesService
pipeline
.
stage_seeds
.
each
do
|
seed
|
.
new
(
project
,
current_user
)
seed
.
user
=
current_user
.
execute
(
pipeline
)
seed
.
to_resource
.
save!
end
# TODO populate environments with find_or_initialize_by in the chain too.
# TODO populate environments with find_or_initialize_by in the chain too.
...
...
lib/gitlab/ci/pipeline/seed/base.rb
View file @
6f20134d
...
@@ -7,7 +7,7 @@ module Gitlab
...
@@ -7,7 +7,7 @@ module Gitlab
raise
NotImplementedError
raise
NotImplementedError
end
end
def
ex
cluded?
def
in
cluded?
raise
NotImplementedError
raise
NotImplementedError
end
end
...
...
lib/gitlab/ci/pipeline/seed/stage.rb
View file @
6f20134d
...
@@ -31,11 +31,7 @@ module Gitlab
...
@@ -31,11 +31,7 @@ module Gitlab
end
end
def
to_resource
def
to_resource
::
Ci
::
Stage
.
new
(
attributes
)
::
Ci
::
Stage
.
new
(
attributes
).
tap
do
|
stage
|
end
def
create!
to_resource
.
tap
do
|
stage
|
@seeds
.
each
do
|
seed
|
@seeds
.
each
do
|
seed
|
seed
.
to_resource
.
tap
do
|
build
|
seed
.
to_resource
.
tap
do
|
build
|
stage
.
builds
<<
build
stage
.
builds
<<
build
...
@@ -43,8 +39,6 @@ module Gitlab
...
@@ -43,8 +39,6 @@ module Gitlab
end
end
@pipeline
.
stages
<<
stage
@pipeline
.
stages
<<
stage
stage
.
save!
end
end
end
end
end
end
...
...
spec/lib/gitlab/ci/pipeline/seed/stage_spec.rb
View file @
6f20134d
...
@@ -65,9 +65,9 @@ describe Gitlab::Ci::Pipeline::Seed::Stage do
...
@@ -65,9 +65,9 @@ describe Gitlab::Ci::Pipeline::Seed::Stage do
end
end
end
end
describe
'#
create!
'
do
describe
'#
to_resource
'
do
it
'
creates all stages and
builds'
do
it
'
builds a valid stage object with all
builds'
do
subject
.
creat
e!
subject
.
to_resource
.
sav
e!
expect
(
pipeline
.
reload
.
stages
.
count
).
to
eq
1
expect
(
pipeline
.
reload
.
stages
.
count
).
to
eq
1
expect
(
pipeline
.
reload
.
builds
.
count
).
to
eq
2
expect
(
pipeline
.
reload
.
builds
.
count
).
to
eq
2
...
...
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