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
f69b5c9f
Commit
f69b5c9f
authored
Oct 16, 2020
by
saikat sarkar
Committed by
Peter Leitzen
Oct 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle 500 error for GraphQL "configureSast" mutation
parent
0c968b0d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
ee/app/services/security/ci_configuration/sast_create_service.rb
...services/security/ci_configuration/sast_create_service.rb
+3
-0
ee/changelogs/unreleased/bug-fix-protect-branch.yml
ee/changelogs/unreleased/bug-fix-protect-branch.yml
+5
-0
ee/spec/services/security/ci_configuration/sast_create_service_spec.rb
...ces/security/ci_configuration/sast_create_service_spec.rb
+6
-0
No files found.
ee/app/services/security/ci_configuration/sast_create_service.rb
View file @
f69b5c9f
...
@@ -22,6 +22,9 @@ module Security
...
@@ -22,6 +22,9 @@ module Security
end
end
result
result
rescue
Gitlab
::
Git
::
PreReceiveError
=>
e
{
status: :error
,
errors:
e
.
message
}
end
end
private
private
...
...
ee/changelogs/unreleased/bug-fix-protect-branch.yml
0 → 100644
View file @
f69b5c9f
---
title
:
Handle 500 error for GraphQL "configureSast" mutation
merge_request
:
43936
author
:
type
:
fixed
ee/spec/services/security/ci_configuration/sast_create_service_spec.rb
View file @
f69b5c9f
...
@@ -38,6 +38,12 @@ RSpec.describe Security::CiConfiguration::SastCreateService, :snowplow do
...
@@ -38,6 +38,12 @@ RSpec.describe Security::CiConfiguration::SastCreateService, :snowplow do
)
)
end
end
it
'raises exception if the user does not have permission to create a new branch'
do
allow
(
project
).
to
receive
(
:repository
).
and_raise
(
Gitlab
::
Git
::
PreReceiveError
,
"You are not allowed to create protected branches on this project."
)
expect
{
subject
}.
to
raise_error
(
Gitlab
::
Git
::
PreReceiveError
)
end
context
'with no parameters'
do
context
'with no parameters'
do
it
'returns the path to create a new merge request'
do
it
'returns the path to create a new merge request'
do
expect
(
result
[
:status
]).
to
eq
(
:success
)
expect
(
result
[
:status
]).
to
eq
(
:success
)
...
...
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