Skip to content

Add GraphQL mutation to refresh standards adherence checks

What does this MR do and why?

This API triggers the ComplianceManagement::Standards::RefreshService which refreshes the standards adherence checks for all the projects within that group.

MR acceptance checklist

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

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Ensure you have ultimate license on your GDK.
  2. Visit the standards adherence dashboard. Eg: https://gdk.test:3000/groups/twitter/-/security/compliance_dashboard/standards_adherence
  3. Delete all the adherence records for all the projects within this group by running the following in rails console
group = Group.find(<id_of_your_group>)
Projects::ComplianceStandards::Adherence.for_group_and_its_subgroups(group).each(&:destroy)
  1. Visit the standards adherence dashboard again for that group and ensure that it is empty.
  2. Visit the GraphiQL explorer. Eg: https://gdk.test:3000/-/graphql-explorer
  3. Run the following mutation
mutation runStandardsAdherenceChecks {
  refreshStandardsAdherenceChecks(input: {groupPath: "twitter"}) {
    adherenceChecksStatus {
      startedAt,
      totalChecks,
      checksCompleted
    }
  }
}
  1. Visit the standards adherence dashboard again for that group and ensure that it has all the records again.

Closes #434199 (closed)

Merge request reports