Add default for scanners injection in vulnerability_filters
What does this MR do and why?
Related to #431800 (closed)
The vulnerability_filters.vue
component expects scanners
to be provided to determine whether to show the ToolWithScannerFilter
or ToolFilter
component when the 'tool with vendor' filter is passed.
When pipeline_security_dashboard_graphql
is enabled, the vulnerability_filters.vue
is used on the pipeline security tab, but that page does not provide scanners
yet. This MR makes the injection optional by using an empty array as default.
At a later time, we can look at adding the scanners
for the pipeline security tab.
Logs
console error before MR:
vue.runtime.esm.js:4605 [Vue warn]: Injection "scanners" not found
How to set up and validate locally
Prerequisites
- You need an EE license
- You need to have runners enabled (See $2408961 for setting up a runner)
- Import https://gitlab.com/gitlab-examples/security/security-reports
- Run a pipeline on master
Validate
- Enable feature flag:
echo "Feature.enable(:pipeline_security_dashboard_graphql)" | rails c
- Go to latest pipeline security tab in security reports
- Check console and see that error regarding injection of
scanners
is not there (you'll likely see an error for another injection, which is not related to this MR)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Lorenz van Herwaarden