Fix undefined framework_id error when unassigning framework
What does this MR do and why?
This MR fixes an exception raised when a project's compliance framework is unassigned when there is no compliance_framework_setting
for the project. It is not straight forward to reproduce the issue, but it can be reproduced by calling the setComplianceFramework
graphql mutation.
Screenshots or screen recordings
Before
After
How to set up and validate locally
- Create a top level group and create a compliance framework
- Create a project within the group
- Assign the compliance framework to one of the projects in the group (
Settings
->General
->Compliance Frameworks
) - Go to
graphql-explorer
and execute the mutation twice and observe that there are no errors:
mutation {
projectSetComplianceFramework(input:{projectId:"gid://gitlab/Project/<id>", complianceFrameworkId:null}) {
project {
complianceFrameworks {
nodes {
id
}
}
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.