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
- 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
vulnerabilitiesCountsQuery
is not there. - 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.
-
I have evaluated the MR acceptance checklist for this MR.