Skip to content

List project requirement statuses for project dashboard

What does this MR do and why?

This MR adds a graphql API for listing project requirement statuses for a specific project.

References

Database

Query for listing project requirement statuses for a single project

Query plan: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/39167/commands/120414

SQL:

SELECT 
  "project_requirement_compliance_statuses".* 
FROM 
  "project_requirement_compliance_statuses" 
WHERE 
  "project_requirement_compliance_statuses"."project_id" = 67565289 
ORDER BY 
  "project_requirement_compliance_statuses"."updated_at" DESC, 
  "project_requirement_compliance_statuses"."id" DESC 
LIMIT 
  100 OFFSET 0;

Query for group requirement statuses when filter for project is present

Note: Because of the new changes, the in query will be removed and an efficient query is added.

Query plan: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/39167/commands/120416

How to set up and validate locally

  1. You need to have a group with Ultimate license.
  2. Create at least one framework in the group with atleast one requirement and a control.
  3. You should also have atleast one project in the group.
  4. Apply the framework(s) to the project.
  5. Wait for 5 minutes for the compliance requirement statuses to get generated for the project.
  6. Now run following graphql query for listing all the compliance requirement statuses for the project.
query projectWithRequirementStatuses {
  project(fullPath: "<project_full_path>") {
    id
    name
    complianceRequirementStatuses {
      nodes {
        id
        updatedAt
        passCount
        failCount
        pendingCount
        project {
          id
          name
        }
        complianceRequirement {
          id
          name
        }
        complianceFramework {
          id
          name
          color
          editPath
        }
      }
    }
  }
}
  1. It should return a json of all the compliance requirement statuses for the project.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #525951 (closed)

Edited by Hitesh Raghuvanshi

Merge request reports

Loading