Skip to content

Database 1/2: Add hasMergeRequest filter to VulnerabilityReport

Issue to track the database implementation work to add has_merge_request filter to VulnerabilityReport.

So that the following CQL is supported see: #371313 (closed)

query {
  project(fullPath: "gitlab-org/gitlab") {
    vulnerabilities(reportType:DEPENDENCY_SCANNING, hasMergeRequest: true) {
      nodes {
        hasMergeRequest
      }
    }
  }
}

Implementation plan:

  • database MR 1: Add has_merge_request column to vulnerability_reads table
  • database MR 2: Update trigger in database for has_merge_request field
    • Use the has_issues trigger as an example for this

Other MRs required are tracked in issue #421736 (closed)

Non-functional requirements

  • Performance: Need to see how this would affect the performance of vulnerability_reads
  • Testing: New tests will need to be added
  • E2E testing: Make sure e2e: package-and-test is run and govern specs are green
Edited by Bala Kumar