Adjust `Mutations::Vulnerabilities::Resolve` to accept `comment`

Why are we doing this work

One of the points of Vulnerability bulk status updates (&4649 - closed) is to allow bulk status updates on Vulnerabilities with a comment. To achieve this, we need to adjust our GraphQL mutations and/or service objects to accept a comment

Relevant links

Implementation plan

  • Adjust ee/app/graphql/mutations/vulnerabilities/resolve.rb to accept comment
  • Adjust ee/app/services/vulnerabilities/resolve_service.rb to accept comment and create appropriate Vulnerabilities::StateTransition
  • Adjust specs

Verification

mutation($input: VulnerabilityResolveInput!) {
  vulnerabilityResolve(input: $input) {
    vulnerability {
      id
      state
      stateComment
    }
  }
}

query variables:

{
  "input": {
    "id": "gid://gitlab/Vulnerability/<vulnerability_id>",
    "clientMutationId": "ANY_STRING",
    "comment": "Test Resolve Comment"
  }
}
  • There is currently no UI to view the stateComment, but you can check it has persisted by running the following graphql query.
query {
  vulnerability(id: "gid://gitlab/Vulnerability/<vulnerability_id>") {
    id
    state
    stateComment
  }
}
Edited by Malcolm Locke