Add clusterAgents field to Project/Group/Security Dashboard GraphQL API
What does this MR do and why?
We're adding ability to filter vulnerabilities based on Kubernetes Agent, so you will be able to see vulnerabilities created for selected cluster (using cluster-image-scanning
capabilities).
Queries
Group query
explain SELECT "cluster_agents".* FROM "cluster_agents" WHERE "cluster_agents"."project_id" IN (SELECT "projects"."id" FROM "projects" WHERE "projects"."namespace_id" IN (WITH RECURSIVE "base_and_descendants" AS ((SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 9970)
UNION
(SELECT "namespaces"."id" FROM "namespaces", "base_and_descendants" WHERE "namespaces"."type" = 'Group' AND "namespaces"."parent_id" = "base_and_descendants"."id")) SELECT "namespaces"."id" FROM "base_and_descendants" AS "namespaces"))
Summary:
Time: 531.206 ms
- planning: 9.113 ms
- execution: 522.093 ms
- I/O read: 491.574 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 10216 (~79.80 MiB) from the buffer pool
- reads: 1356 (~10.60 MiB) from the OS file cache, including disk I/O
- dirtied: 186 (~1.50 MiB)
- writes: 0
Details and visualization: https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/10542/commands/37862.
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.
Related to GraphQL filter for vulnerabilities by container... (#358763 - closed)
Edited by Alan (Maciej) Paruszewski