Skip to content

Generate system notes for same state dismissals

Zamir Martins requested to merge generate_system_notes_for_same_state into master

What does this MR do and why?

Generate system notes for same state dismissals.

Validation is already available here and will rescued here.

Related issue: #404570 (closed)

Screenshots or screen recordings

Screenshot_2023-04-05_at_12.21.53

How to set up and validate locally

  1. Go to a the vulnerability page of a respective vulnerability (i.e., http:///<PROJECT_FULL_PATH>/-/security/vulnerabilities/<VULNERABILITY_ID>)

  2. Trigger the dismissal for different dismissalReason via Graphql as the following:

mutation {
  vulnerabilityDismiss( input: {id: "gid://gitlab/Vulnerability/697", dismissalReason: ACCEPTABLE_RISK}){
    vulnerability {
      state
      stateTransitions {
        nodes {
          dismissalReason
	  			createdAt
	  			fromState
          toState
        }
      }
    }
  }
}

Expectation:

Graphql response should be similar to the following:

{
  "data": {
    "vulnerabilityDismiss": {
      "vulnerability": {
        "state": "DISMISSED",
        "stateTransitions": {
          "nodes": [
            {
              "dismissalReason": "ACCEPTABLE_RISK",
              "createdAt": "2023-04-05T10:21:18Z",
              "fromState": "DISMISSED",
              "toState": "DISMISSED"
            },
            {
              "dismissalReason": "NOT_APPLICABLE",
              "createdAt": "2023-04-05T10:21:00Z",
              "fromState": "DISMISSED",
              "toState": "DISMISSED"
            },
            {
              "dismissalReason": "FALSE_POSITIVE",
              "createdAt": "2023-04-05T10:20:50Z",
              "fromState": "DETECTED",
              "toState": "DISMISSED"
            }
          ]
        }
      }
    }
  }
}

Vulnerability page should include system notes similar to this screenshot

MR acceptance checklist

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

Edited by Zamir Martins

Merge request reports