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
89b7e503
Commit
89b7e503
authored
Nov 02, 2020
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wording and spelling
parent
561d4f3a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
11 deletions
+11
-11
ee/app/services/issues/create_from_vulnerability_data_service.rb
...services/issues/create_from_vulnerability_data_service.rb
+1
-1
ee/app/services/issues/create_from_vulnerability_service.rb
ee/app/services/issues/create_from_vulnerability_service.rb
+1
-1
ee/app/services/merge_requests/create_from_vulnerability_data_service.rb
.../merge_requests/create_from_vulnerability_data_service.rb
+2
-2
ee/spec/services/ee/issues/create_from_vulnerability_data_service_spec.rb
.../ee/issues/create_from_vulnerability_data_service_spec.rb
+2
-2
ee/spec/services/ee/issues/create_from_vulnerability_service_spec.rb
...vices/ee/issues/create_from_vulnerability_service_spec.rb
+2
-2
ee/spec/services/ee/merge_requests/create_from_vulnerability_data_service_spec.rb
...e_requests/create_from_vulnerability_data_service_spec.rb
+3
-3
No files found.
ee/app/services/issues/create_from_vulnerability_data_service.rb
View file @
89b7e503
...
...
@@ -3,7 +3,7 @@
module
Issues
class
CreateFromVulnerabilityDataService
<
::
BaseService
def
execute
return
error
(
"User not permitted to create issue"
)
unless
can?
(
@current_user
,
:create_issue
,
@project
)
return
error
(
"User
is
not permitted to create issue"
)
unless
can?
(
@current_user
,
:create_issue
,
@project
)
begin
vulnerability
=
Gitlab
::
Vulnerabilities
::
Parser
.
fabricate
(
@params
)
...
...
ee/app/services/issues/create_from_vulnerability_service.rb
View file @
89b7e503
...
...
@@ -2,7 +2,7 @@
module
Issues
class
CreateFromVulnerabilityService
<
::
BaseContainerService
def
execute
return
error
(
"User not permitted to create issue"
)
unless
can?
(
@current_user
,
:create_issue
,
@container
)
return
error
(
"User
is
not permitted to create issue"
)
unless
can?
(
@current_user
,
:create_issue
,
@container
)
vulnerability
=
params
[
:vulnerability
].
present
link_type
=
params
[
:link_type
]
...
...
ee/app/services/merge_requests/create_from_vulnerability_data_service.rb
View file @
89b7e503
...
...
@@ -16,8 +16,8 @@ module MergeRequests
]
target_branch
=
vulnerability
.
target_branch
||
@project
.
default_branch
return
error
(
"User not permitted to create merge request"
)
unless
can_create_merge_request?
(
source_branch
)
return
error
(
"No remdiations available for merge request"
)
if
vulnerability
.
remediations
.
empty?
return
error
(
"User
is
not permitted to create merge request"
)
unless
can_create_merge_request?
(
source_branch
)
return
error
(
"No rem
e
diations available for merge request"
)
if
vulnerability
.
remediations
.
empty?
patch_result
=
create_patch
(
vulnerability
,
source_branch
,
target_branch
)
...
...
ee/spec/services/ee/issues/create_from_vulnerability_data_service_spec.rb
View file @
89b7e503
...
...
@@ -37,7 +37,7 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
it
'returns expected error'
do
expect
(
result
[
:status
]).
to
eq
(
:error
)
expect
(
result
[
:message
]).
to
eq
(
"User not permitted to create issue"
)
expect
(
result
[
:message
]).
to
eq
(
"User
is
not permitted to create issue"
)
end
end
...
...
@@ -47,7 +47,7 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
it
'returns expected error'
do
expect
(
result
[
:status
]).
to
eq
(
:error
)
expect
(
result
[
:message
]).
to
eq
(
"User not permitted to create issue"
)
expect
(
result
[
:message
]).
to
eq
(
"User
is
not permitted to create issue"
)
end
end
...
...
ee/spec/services/ee/issues/create_from_vulnerability_service_spec.rb
View file @
89b7e503
...
...
@@ -80,7 +80,7 @@ RSpec.describe Issues::CreateFromVulnerabilityService, '#execute' do
it
'returns expected error'
do
expect
(
result
[
:status
]).
to
eq
(
:error
)
expect
(
result
[
:message
]).
to
eq
(
"User not permitted to create issue"
)
expect
(
result
[
:message
]).
to
eq
(
"User
is
not permitted to create issue"
)
end
end
...
...
@@ -89,7 +89,7 @@ RSpec.describe Issues::CreateFromVulnerabilityService, '#execute' do
it
'returns expected error'
do
expect
(
result
[
:status
]).
to
eq
(
:error
)
expect
(
result
[
:message
]).
to
eq
(
"User not permitted to create issue"
)
expect
(
result
[
:message
]).
to
eq
(
"User
is
not permitted to create issue"
)
end
end
...
...
ee/spec/services/ee/merge_requests/create_from_vulnerability_data_service_spec.rb
View file @
89b7e503
...
...
@@ -43,7 +43,7 @@ RSpec.describe MergeRequests::CreateFromVulnerabilityDataService, '#execute' do
it
'returns expected error'
do
expect
(
result
[
:status
]).
to
eq
(
:error
)
expect
(
result
[
:message
]).
to
eq
(
"User not permitted to create merge request"
)
expect
(
result
[
:message
]).
to
eq
(
"User
is
not permitted to create merge request"
)
end
end
...
...
@@ -53,7 +53,7 @@ RSpec.describe MergeRequests::CreateFromVulnerabilityDataService, '#execute' do
it
'returns expected error'
do
expect
(
result
[
:status
]).
to
eq
(
:error
)
expect
(
result
[
:message
]).
to
eq
(
"User not permitted to create merge request"
)
expect
(
result
[
:message
]).
to
eq
(
"User
is
not permitted to create merge request"
)
end
end
...
...
@@ -213,7 +213,7 @@ RSpec.describe MergeRequests::CreateFromVulnerabilityDataService, '#execute' do
it
'return expected error'
do
expect
(
result
[
:status
]).
to
eq
(
:error
)
expect
(
result
[
:message
]).
to
eq
(
"No remdiations available for merge request"
)
expect
(
result
[
:message
]).
to
eq
(
"No rem
e
diations available for merge request"
)
end
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