Aggregate project level releases metrics to the group
Problem to solve
For the director level CICD dashboard, we need to display aggregated project metrics at the group level. This is solve the visibility challenge when teams are working across many repos.
Intended users
Further details
During the Multi-project Validation, we discovered many users are just interested in understanding where things are at in a group. This includes common items like runner minutes, releases, last passed pipelines, or last failed pipelines to then triage issues as they come up
Proposal
Expose the following metrics via API to be consumed by Vue Component in later iteration:
- Number of releases in group - simple count of all releases ever created for all projects in the group
- % of projects with releases in Group - the ratio of all projects with at least one release : total number of projects
From the tech evaluation: Number of releases in group - simple count of all releases ever created for all projects in the group
SELECT COUNT(*) FROM "releases" INNER JOIN "projects" ON "projects"."id" = "releases"."project_id" WHERE "projects"."namespace_id" IN (WITH RECURSIVE "base_and_descendants" AS ((SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 9970)
UNION
(SELECT "namespaces".* 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")
Execution plan - https://explain.dalibo.com/plan/5B
% of projects with releases in Group - the ratio of all projects with at least one release : total number of projects
SELECT COUNT(*) AS total, COUNT(*) FILTER (WHERE EXISTS (SELECT 1 FROM releases WHERE releases.project_id = projects.id)) AS with_releases FROM projects WHERE namespace_id IN (WITH RECURSIVE "base_and_descendants" AS ((SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 9970)
UNION
(SELECT "namespaces".* 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")
What is the type of buyer?
- Ultimate
Availability & Testing
Links / references
- Director Dashboard Issue - #199739 (closed)