Skip to content

Add default for vulnerabilitiesCountsQuery injection

What does this MR do and why?

Related #431796 (closed)

The selection_summary.vue component expects vulnerabilitiesCountsQuery to be provided to fetch the counts after a bulk state change mutation has been made.

When pipeline_security_dashboard_graphql is enabled, the selection_summary.vue is used on the pipeline security tab, but that page does show the vulnerability counts in tiles (as opposed to the vulnerability report page that does). This MR makes the injection optional by using null as default. When it's null, the refetchQueries skips the refetch.

Logs

vue.runtime.esm.js:4605 [Vue warn]: Injection "vulnerabilitiesCountsQuery" 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 vulnerabilitiesCountsQuery is not there.
  4. Go to vulnerability report page, select a couple vulnerabilities and change their state. You can validate that the vulnerabilitiesCountQuery will still be called and the counts update

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports