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
bf990fcd
Commit
bf990fcd
authored
Jun 15, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return false in create_builds if not builds created
This fixes compatibility with trigger request create service.
parent
cf292a3f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+2
-3
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+10
-0
No files found.
app/models/ci/pipeline.rb
View file @
bf990fcd
...
@@ -91,7 +91,7 @@ module Ci
...
@@ -91,7 +91,7 @@ module Ci
trigger_requests
.
any?
trigger_requests
.
any?
end
end
def
build_builds
(
user
,
status
=
'success'
,
trigger_request
=
nil
)
def
build_builds
(
user
,
trigger_request
=
nil
,
status
=
'success'
)
return
unless
config_processor
return
unless
config_processor
config_processor
.
stages
.
any?
do
|
stage
|
config_processor
.
stages
.
any?
do
|
stage
|
build_builds_for_stage
(
stage
,
user
,
status
,
trigger_request
).
present?
build_builds_for_stage
(
stage
,
user
,
status
,
trigger_request
).
present?
...
@@ -99,8 +99,7 @@ module Ci
...
@@ -99,8 +99,7 @@ module Ci
end
end
def
create_builds
(
user
,
trigger_request
=
nil
)
def
create_builds
(
user
,
trigger_request
=
nil
)
build_builds
(
user
,
'success'
,
trigger_request
)
build_builds
(
user
,
trigger_request
)
&&
save
save
end
end
def
create_next_builds
(
build
)
def
create_next_builds
(
build
)
...
...
spec/models/ci/pipeline_spec.rb
View file @
bf990fcd
...
@@ -258,6 +258,16 @@ describe Ci::Pipeline, models: true do
...
@@ -258,6 +258,16 @@ describe Ci::Pipeline, models: true do
end
end
end
end
end
end
context
'when no builds created'
do
before
do
stub_ci_pipeline_yaml_file
(
YAML
.
dump
(
before_script:
[
'ls'
]))
end
it
'returns false'
do
expect
(
pipeline
.
create_builds
(
nil
)).
to
be_falsey
end
end
end
end
describe
"#finished_at"
do
describe
"#finished_at"
do
...
...
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