Make name field in ScanExecutionPolicyCommit mutation mandatory
Why are we doing this work
We added name
field in ScanExecutionPolicyCommit
graphql mutation which was made as non-mandatory field to make it backward compatible with frontend. After #342695 (closed) is finished, we need to make it required: true
.
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
-
backend Add required: true
toname
argument inee/app/graphql/mutations/security_policy/commit_scan_execution_policy.rb
:argument :name, GraphQL::Types::String, required: true, description: 'Name of the policy. If the name is null, the `name` field from `policy_yaml` is used.'
Verification steps
- 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 error message
Edited by Marcos Rocha