Add dismissal reason to vulnerability details head
What does this MR do and why?
This MR introduces a new feature flag for dismissing a vulnerability with a reason:
dismissal_reason
This MR adds the dismissal reason (if any) to the vulnerability details head. The feature flag needs to be enabled to be able to show this. It's part of the epic &4942 (closed).
It also updates the spec to test for all possible dismissal reasons.
Screenshots or screen recordings
How to set up and validate locally
You'll need an EE license
- enable feature flag
echo "Feature.enable(:dismissal_reason)" | rails c - import security-reports
- you'll need to create a vulnerability which has been dismissed with a reason, one way of doing this (patch for this: fake-dismissal-reason.patch):
- add
dismissalReason: 'USED_IN_TESTS'to thepayloadon line 53 inee/app/assets/javascripts/vulnerabilities/constants.js - add
$dismissalReason: VulnerabilityDismissalReasonon line 4 and adddismissalReason: $dismissalReasonto the input on line 5 inee/app/assets/javascripts/security_dashboard/graphql/mutations/vulnerability_dismiss.mutation.graphql - go to any vulnerability details page of security-reports
- change status to dismiss
- refresh page
- add
- validate that the header displays "Dismissed: Used in tests"
Note
This MR does not handle providing the dismissal reason. In addition, when testing the steps to validate and create a vulnerability with a dismissal reason, the graphql response does not yet provide the
dismissalReason. This will be tackled in another MR. Only after refreshing the page is the dismissalReason provided (viainitialVulnerability).
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.
Closes #296920 (closed)
