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
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
Hide 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
@command
.
seeds_block
&
.
call
(
pipeline
)
::
Ci
::
CreatePipelineStagesService
.
new
(
project
,
current_user
)
.
execute
(
pipeline
)
pipeline
.
stage_seeds
.
each
do
|
seed
|
seed
.
user
=
current_user
seed
.
to_resource
.
save!
end
# 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
raise
NotImplementedError
end
def
ex
cluded?
def
in
cluded?
raise
NotImplementedError
end
...
...
lib/gitlab/ci/pipeline/seed/stage.rb
View file @
6f20134d
...
...
@@ -31,11 +31,7 @@ module Gitlab
end
def
to_resource
::
Ci
::
Stage
.
new
(
attributes
)
end
def
create!
to_resource
.
tap
do
|
stage
|
::
Ci
::
Stage
.
new
(
attributes
).
tap
do
|
stage
|
@seeds
.
each
do
|
seed
|
seed
.
to_resource
.
tap
do
|
build
|
stage
.
builds
<<
build
...
...
@@ -43,8 +39,6 @@ module Gitlab
end
@pipeline
.
stages
<<
stage
stage
.
save!
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
end
end
describe
'#
create!
'
do
it
'
creates all stages and
builds'
do
subject
.
creat
e!
describe
'#
to_resource
'
do
it
'
builds a valid stage object with all
builds'
do
subject
.
to_resource
.
sav
e!
expect
(
pipeline
.
reload
.
stages
.
count
).
to
eq
1
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