Skip to content

Organization - calculate group, project, and user counts

What does this MR do and why?

In response to issue #424531 (closed) and the proposed solution, we are introducing a new finder that will count groups, projects, and users at the organization level.

Query plan

Query postgres.ai Screenshot
SELECT COUNT(*) FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."organization_id" = 1; https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/26250/commands/82593 image
SELECT COUNT(*) FROM "projects" WHERE "projects"."organization_id" = 1 https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/26250/commands/82592 image
SELECT COUNT(*) FROM "organization_users" WHERE "organization_users"."organization_id" = 1 https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/26250/commands/82594 image

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Checkout the branch
  2. Visit the default organization - note: enable ui_for_organizations FF if not visible
  3. Verify that correct metrics are displayed

Related to #424531 (closed)

Edited by Bojan Marjanovic

Merge request reports