Skip to content

Accept comment in VulnerabilityConfirm GraphQL mutation

What does this MR do and why?

This comment allows you to specify a comment when marking a Vulnerability as confirmed.

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
  4. Run the following mutation
mutation($input: VulnerabilityConfirmInput!) {
  vulnerabilityConfirm(input: $input) {
    vulnerability {
      id
      state
      stateComment
    }
  }
}
{
  "input": {
    "id": "gid://gitlab/Vulnerability/<id here>",
    "clientMutationId": "something",
    "comment": "test"
  }
}
  1. New state should be CONFIRMED, stateComment should be populated 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 #373966 (closed)

Edited by Michał Zając

Merge request reports