Bulk add frameworks mutation
What does this MR do and why?
Bulk add frameworks mutation
Add a mutation for bulk adding compliance frameworks to all projects underneath a given group.
This mutation uses a sidekiq worker to asynchronously add the frameworks to the projects.
References
Related to #477191
Screenshots
How to set up and validate locally
- Go to the graphql explorer (
/-/graphql-explorer) - Query a group to get all of the compliance frameworks available
query getComplianceFrameworks($fullPath: ID!) {
group(fullPath: $fullPath) {
id
complianceFrameworks(first: 20) {
nodes {
id
name
}
}
}
}
- Using the compliance framework IDs listed, create a mutation to add frameworks to a group's projects
mutation addComplianceFrameworks($input: BulkAddComplianceFrameworksInput!) {
bulkAddComplianceFrameworks(input: $input) {
errors
group {
id
path
fullPath
}
}
}
Variables
{
"input": {
"groupId": "gid://gitlab/Group/<ID>",
"complianceFrameworkIds": [
"gid://gitlab/ComplianceManagement::Framework/<ID>",
"gid://gitlab/ComplianceManagement::Framework/<ID>"
],
"includeSubgroups": true
}
}
- Query the group's projects to verify they were added
query getProjectsComplianceFrameworks($fullPath: ID!) {
group(fullPath: $fullPath) {
id
projects(first: 20) {
nodes {
id
name
path
complianceFrameworks {
nodes {
id
}
}
}
}
}
}
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.
Edited by Scott Hampton