Make name in ScanExecutionPolicyCommit mutation mandatory
What does this MR do and why?
We added name
field in ScanExecutionPolicyCommit
graphql mutation as a non-mandatory field to make it backward compatible with frontend.
However now that #342695 (closed) is finished, we need to make it required.
Corresponding issue: #343009 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Go to
/-/graphql-explorer
- Type a query like:
mutation updatePolicy($input: ScanExecutionPolicyCommitInput!) {
scanExecutionPolicyCommit(input: $input) {
branch
errors
}
}
with an input like
{
"input": {
"fullPath": "testscanresultpolicies/license-approval-policies-test",
"operationMode": "REPLACE",
"policyYaml": ""
}
}
- Check the result
{
"errors": [
{
"message": "Variable $input of type ScanExecutionPolicyCommitInput! was provided invalid value for name (Expected value to not be null)",
"locations": [
{
"line": 1,
"column": 23
}
],
"extensions": {
"value": {
"fullPath": "testscanresultpolicies/license-approval-policies-test",
"operationMode": "REPLACE",
"policyYaml": ""
},
"problems": [
{
"path": [
"name"
],
"explanation": "Expected value to not be null"
}
]
}
}
]
}
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.
Edited by Marcos Rocha