Skip to content

VulnerabilityRevertToDetected: dont fail when no comment is given

What does this MR do and why?

This MR fixes VulnerabilityRevertToDetected GraphQL mutation so it doesn't error out when no comment is provided

How to set up and validate locally

  1. Make sure you have a project with Vulnerabilities
  2. Feature.enable(:deprecate_vulnerabilities_feedback) (this is optional but stateComment field will be null no matter what you pass
  3. Go to Vulnerability report, find a vulnerability, note down the id and mark it as resolved
  4. Run the following mutation
mutation($input: VulnerabilityRevertToDetectedInput!) {
  vulnerabilityRevertToDetected(input: $input) {
    vulnerability {
      id
      state
      stateComment
    }
  }
}
{
  "input": {
    "id": "gid://gitlab/Vulnerability/<id here>",
    "clientMutationId": "something"
  }
}
  1. New state should be DETECTED, stateComment should be nil if you enabled the feature flag

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #394846 (closed)

Merge request reports

Loading