Fix DastProfile Update mutation
What does this MR do and why?
This MR fix the DastProfile Update mutation to delete the tags when tagList is argument is an empty list.
This issue was discussed here.
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
Create a new DastProfile with tags
- Go to
/-/graphql-explorer
- Get a
dastScannerProfile
, anddastSiteProfiles
ids - Type a query like
mutation dastProfileCreate($input: DastProfileCreateInput!) {
dastProfileCreate(input: $input) {
dastProfile {
id
editPath
tagList
}
pipelineUrl
errors
}
}
with a Query Variable like:
{
"input": {
"fullPath": "root/apiscantest",
"name": "Test TagList",
"dastSiteProfileId": "gid://gitlab/DastSiteProfile/16",
"dastScannerProfileId": "gid://gitlab/DastScannerProfile/6",
"tagList": ["ruby", "dast"]
}
}
- Check the result
{
"data": {
"dastProfileCreate": {
"dastProfile": {
"id": "gid://gitlab/Dast::Profile/8",
"editPath": "/root/apiscantest/-/on_demand_scans/8/edit",
"tagList": [
"dast",
"ruby"
]
},
"pipelineUrl": null,
"errors": []
}
}
}
Update the tags of a DastProfile
- Go to
/-/graphql-explorer
- Type a query like
mutation dastProfileUpdate($input: DastProfileUpdateInput!) {
dastProfileUpdate(input: $input) {
errors
dastProfile {
tagList
}
}
}
{
"input": {
"id": "gid://gitlab/Dast::Profile/8",
"name": "Test TagList",
"tagList": []
}
}
- Check the result
{
"data": {
"dastProfileUpdate": {
"errors": [],
"dastProfile": {
"tagList": []
}
}
}
}
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 Drew Blessing