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
af4eb9be
Commit
af4eb9be
authored
Nov 12, 2021
by
Mehmet Emin INAC
Committed by
Stan Hu
Nov 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not propagate parsing exceptions to clients for `pipelineFindings`
parent
32fe1691
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
ee/app/graphql/resolvers/pipeline_security_report_findings_resolver.rb
...l/resolvers/pipeline_security_report_findings_resolver.rb
+5
-0
ee/spec/graphql/resolvers/pipeline_security_report_findings_resolver_spec.rb
...olvers/pipeline_security_report_findings_resolver_spec.rb
+12
-0
No files found.
ee/app/graphql/resolvers/pipeline_security_report_findings_resolver.rb
View file @
af4eb9be
...
...
@@ -23,7 +23,12 @@ module Resolvers
description:
'Filter vulnerability findings by state.'
def
resolve
(
**
args
)
# This finder class has been deprecated and will be removed by
# https://gitlab.com/gitlab-org/gitlab/-/issues/334488.
# We can remove the rescue block while addressing that issue.
Security
::
PipelineVulnerabilitiesFinder
.
new
(
pipeline:
pipeline
,
params:
args
).
execute
.
findings
rescue
Security
::
PipelineVulnerabilitiesFinder
::
ParseError
[]
end
end
end
ee/spec/graphql/resolvers/pipeline_security_report_findings_resolver_spec.rb
View file @
af4eb9be
...
...
@@ -63,5 +63,17 @@ RSpec.describe Resolvers::PipelineSecurityReportFindingsResolver do
expect
(
Security
::
PipelineVulnerabilitiesFinder
).
to
have_received
(
:new
).
with
(
pipeline:
pipeline
,
params:
params
)
end
end
context
'when the finder class raises parsing error'
do
before
do
allow_next_instance_of
(
Security
::
PipelineVulnerabilitiesFinder
)
do
|
finder
|
allow
(
finder
).
to
receive
(
:execute
).
and_raise
(
Security
::
PipelineVulnerabilitiesFinder
::
ParseError
)
end
end
it
'does not propagate the error to the client'
do
expect
{
resolve_query
}.
not_to
raise_error
end
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