Fix finding details headers
What does this MR do and why?
This MR adds a header
field to the Types::VulnerabilityDetails::TableType
. The type currently has a headers
field, but that does not match the name of the data field being processed. It also does not return any data because the field names do not match. The headers
field will be deprecated in favor of the new header
field. Until deprecation, it will use the header
field as its source. This also fixes the spec file to expect correct data. Also refactored to clean up the spec file.
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
- Clone the security reports project locally.
- Run the pipeline.
- Run the following query:
{
project(fullPath: "root/security-reports") {
id
pipeline(iid: "1") {
securityReportFindings(reportType: ["dast"]) {
nodes {
uuid
title
}
}
}
}
}
- Using the
uuid
for the finding with"title": "X-Frame-Options Header Not Set"
, make the following query
{
project(fullPath: "root/security-reports") {
id
pipeline(iid: "1") {
securityReportFinding(uuid: "<uuid>") {
uuid
title
details {
... on VulnerabilityDetailTable {
fieldName
header {
... on VulnerabilityDetailText {
__typename
description
fieldName
name
value
}
}
headers {
... on VulnerabilityDetailText {
__typename
description
fieldName
name
value
}
}
}
}
}
}
}
}
- The response should include (with
headers
==header
:
{
"fieldName": "table",
"header": [
{
"__typename": "VulnerabilityDetailText",
"description": null,
"fieldName": null,
"name": null,
"value": "Number"
},
{
"__typename": "VulnerabilityDetailText",
"description": null,
"fieldName": null,
"name": null,
"value": "Address"
}
],
"headers": [
{
"__typename": "VulnerabilityDetailText",
"description": null,
"fieldName": null,
"name": null,
"value": "Number"
},
{
"__typename": "VulnerabilityDetailText",
"description": null,
"fieldName": null,
"name": null,
"value": "Address"
}
]
},
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.
Related to #389916 (closed)