Add securityPoliciesSyncStatus GraphQL query
What does this MR do and why?
We are working on visualising the synchronisation status of merge request approval policies in the policy overview UI (&19049).
Currently we only publish updates during the sync through the GraphQL subscription introduced by !201777 (merged). Since we have the product requirement that sync status remains accessible for 24 hours, this merge request:
- only partially clears Redis state once policy sync completes
- adds a
securityPoliciesSyncUpdatedGraphQL query that returns the same data structure as the subscription - both the query and the subscription now contain an
inProgressfield that signals whether a sync is ongoing
In !202376, the progress bar UI will use this query to hydrate itself on page load.
References
How to set up and validate locally
Follow How to set up and validate locally but use the following subscription and query:
query {
securityPoliciesSyncStatus(policyConfigurationId: "gid://gitlab/Security::OrchestrationPolicyConfiguration/$CONFIGURATION_ID") {
projects
projectsTotal
failedProjects
mergeRequests
mergeRequestsTotal
inProgress
}
}
subscription {
securityPoliciesSyncUpdated(policyConfigurationId: "gid://gitlab/Security::OrchestrationPolicyConfiguration/$CONFIGURATION_ID") {
projectsProgress
projectsTotal
failedProjects
mergeRequestsProgress
mergeRequestsTotal
inProgress
}
}
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 #562958 (closed)
Edited by Dominic Bauer