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
Boxiang Sun
gitlab-ce
Commits
22f1b046
Commit
22f1b046
authored
Aug 18, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update merge request pipeline even if if has errors
parent
accaf7ea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
app/services/ci/create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+8
-3
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+19
-1
No files found.
app/services/ci/create_pipeline_service.rb
View file @
22f1b046
...
@@ -176,9 +176,14 @@ module Ci
...
@@ -176,9 +176,14 @@ module Ci
end
end
def
error
(
message
,
save:
false
)
def
error
(
message
,
save:
false
)
pipeline
.
tap
do
pipeline
.
errors
.
add
(
:base
,
message
)
pipeline
.
errors
.
add
(
:base
,
message
)
pipeline
.
drop
if
save
pipeline
if
save
pipeline
.
drop
update_merge_requests_head_pipeline
end
end
end
end
def
pipeline_created_counter
def
pipeline_created_counter
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
22f1b046
...
@@ -110,11 +110,29 @@ describe Ci::CreatePipelineService do
...
@@ -110,11 +110,29 @@ describe Ci::CreatePipelineService do
allow_any_instance_of
(
Ci
::
Pipeline
)
allow_any_instance_of
(
Ci
::
Pipeline
)
.
to
receive
(
:latest?
).
and_return
(
false
)
.
to
receive
(
:latest?
).
and_return
(
false
)
pipelin
e
execute_servic
e
expect
(
merge_request
.
reload
.
head_pipeline
).
to
be_nil
expect
(
merge_request
.
reload
.
head_pipeline
).
to
be_nil
end
end
end
end
context
'when pipeline has errors'
do
before
do
stub_ci_pipeline_yaml_file
(
'some invalid syntax'
)
end
it
'updates merge request head pipeline reference'
do
merge_request
=
create
(
:merge_request
,
source_branch:
'master'
,
target_branch:
'feature'
,
source_project:
project
)
head_pipeline
=
execute_service
expect
(
head_pipeline
).
to
be_persisted
expect
(
head_pipeline
.
yaml_errors
).
to
be_present
expect
(
merge_request
.
reload
.
head_pipeline
).
to
eq
head_pipeline
end
end
end
end
context
'auto-cancel enabled'
do
context
'auto-cancel enabled'
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