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
f9004813
Commit
f9004813
authored
Mar 17, 2020
by
Jason Goodman
Committed by
Kamil Trzciński
Mar 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return bad request from pipelines controller for invalid ci yaml
Change response from ok
parent
de84743f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+2
-2
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+2
-1
No files found.
app/controllers/projects/pipelines_controller.rb
View file @
f9004813
...
...
@@ -60,10 +60,10 @@ class Projects::PipelinesController < Projects::ApplicationController
.
new
(
project
,
current_user
,
create_params
)
.
execute
(
:web
,
ignore_skip_ci:
true
,
save_on_errors:
false
)
if
@pipeline
.
persisted
?
if
@pipeline
.
created_successfully
?
redirect_to
project_pipeline_path
(
project
,
@pipeline
)
else
render
'new'
render
'new'
,
status: :bad_request
end
end
...
...
spec/controllers/projects/pipelines_controller_spec.rb
View file @
f9004813
...
...
@@ -634,7 +634,8 @@ describe Projects::PipelinesController do
it
'does not persist a pipeline'
do
expect
{
post_request
}.
not_to
change
{
project
.
ci_pipelines
.
count
}
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
response
).
to
render_template
(
'new'
)
end
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