Skip to content

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

  1. You need an EE license
  2. You need to have runners enabled (See $2408961 for setting up a runner)
  3. Import https://gitlab.com/gitlab-examples/security/security-reports
  4. Run a pipeline on master

Validate

  1. Enable feature flag: echo "Feature.enable(:pipeline_security_dashboard_graphql)" | rails c
  2. Go to latest pipeline security tab in security reports
  3. 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.

Edited by Lorenz van Herwaarden

Merge request reports