Singular security report finding should always respond with finding regardless of state
Summary
The Resolvers::SecurityReport::FindingResolver
should always return the requested finding even when dismissed. This is different than when querying for multiple findings where the default action is to not include dismissed findings. For the singular, we want that finding whether or not it's dismissed. This can be done by including {scope: all}
in the params sent to the FindingsFinder
.
Steps to reproduce
Call securityReportFinding
on a dismissed vulnerability.
query pipelineFindings {
project(fullPath: "jschafer/security-reports") {
pipelines(first: 1) {
nodes {
securityReportFinding(uuid: "e97672f2-7f81-58b2-b7b8-2c654f3f5f25") {
uuid
state
title
}
}
}
}
}
Example Project
https://gitlab.com/jschafer/security-reports/-/pipelines/720317512/security
What is the current bug behavior?
The finding is null
What is the expected correct behavior?
The finding data is returned.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
The Resolvers::SecurityReport::FindingResolver
should include {scope: all}
in the params sent to the FindingsFinder
.
Implementation Plan
-
backend Change the params
variable when creating the finder to includescope: all
. -
backend Add test to security_report_finding_spec.rb to ensure that the query will return a finding if it has been dismissed.