Skip to content

Add endpoint to provide a list of detected licenses for filtering

mo khan requested to merge mokhax/422293/licenses-list into master

What does this MR do and why?

This change adds an endpoint for the Group level Dependency List to get a list of detected software licenses withing a group hierarchy. This filter is only available to group hierarchies that are below a specific threshold.

#422293 (closed)

SELECT DISTINCT "sbom_occurrences"."licenses"
FROM "sbom_occurrences"
WHERE "sbom_occurrences"."project_id" IN (
  SELECT "projects"."id"
  FROM "projects"
  WHERE "projects"."namespace_id" IN (
    SELECT namespaces.traversal_ids[array_length(namespaces.traversal_ids, 1)] AS id
    FROM "namespaces"
    WHERE "namespaces"."type" = 'Group'
    AND (traversal_ids @> ('{9970}'))
  )
  AND "projects"."marked_for_deletion_at" IS NULL
  AND "projects"."pending_delete" = FALSE
)
ORDER BY "sbom_occurrences"."licenses" ASC
LIMIT 100 OFFSET 0;
Time: 297.758 ms
  - planning: 9.632 ms
  - execution: 288.126 ms
    - I/O read: 0.000 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 62244 (~486.30 MiB) from the buffer pool
  - reads: 0 from the OS file cache, including disk I/O
  - dirtied: 0
  - writes: 0

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/22853/commands/73727

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 mo khan

Merge request reports