Skip to content

Add mergeRequest to PipelineSecurityReporyFinding

What does this MR do and why?

This MR adds the mergeRequest field to the PipelineSecurityReportFinding GraphQL type.

Screenshots or screen recordings

Screen_Shot_2022-12-20_at_10.12.44_AM

Database

Queries

analysis

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/14373/commands/50524

SELECT "vulnerability_feedback".* FROM "vulnerability_feedback" WHERE "vulnerability_feedback"."finding_uuid" IN ('35bf1df3-f95f-5090-ade6-84a70a19132e') AND "vulnerability_feedback"."feedback_type" = 2

Time: 17.553 ms  
  - planning: 2.458 ms  
  - execution: 15.095 ms  
    - I/O read: 14.738 ms  
    - I/O write: 0.000 ms  
  
Shared buffers:  
  - hits: 0 from the buffer pool  
  - reads: 3 (~24.00 KiB) from the OS file cache, including disk I/O  
  - dirtied: 0  
  - writes: 0  

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/14373/commands/50525

SELECT "users".* FROM "users" WHERE "users"."id" = 4473655

Time: 13.174 ms  
  - planning: 5.766 ms  
  - execution: 7.408 ms  
    - I/O read: 7.286 ms  
    - I/O write: 0.000 ms  
  
Shared buffers:  
  - hits: 0 from the buffer pool  
  - reads: 4 (~32.00 KiB) from the OS file cache, including disk I/O  
  - dirtied: 0  
  - writes: 0

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/14373/commands/50526

SELECT "projects".* FROM "projects" WHERE "projects"."id" = 40263106

Time: 10.636 ms  
  - planning: 4.195 ms  
  - execution: 6.441 ms  
    - I/O read: 6.315 ms  
    - I/O write: 0.000 ms  
  
Shared buffers:  
  - hits: 0 from the buffer pool  
  - reads: 4 (~32.00 KiB) from the OS file cache, including disk I/O  
  - dirtied: 0  
  - writes: 0

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/14373/commands/50529

SELECT "merge_requests".* FROM "merge_requests" WHERE "merge_requests"."id" IN (198512707, 198514970, 198515200)

Time: 14.376 ms  
  - planning: 5.949 ms  
  - execution: 8.427 ms  
    - I/O read: 8.271 ms  
    - I/O write: 0.000 ms  
  
Shared buffers:  
  - hits: 12 (~96.00 KiB) from the buffer pool  
  - reads: 3 (~24.00 KiB) from the OS file cache, including disk I/O  
  - dirtied: 0  
  - writes: 0 

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/14373/commands/50528

SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."id" = 668163483

Time: 1.878 ms  
  - planning: 1.837 ms  
  - execution: 0.041 ms  
    - I/O read: 0.000 ms  
    - I/O write: 0.000 ms  
  
Shared buffers:  
  - hits: 2 (~16.00 KiB) from the buffer pool  
  - reads: 0 from the OS file cache, including disk I/O  
  - dirtied: 0  
  - writes: 0 

How to set up and validate locally

  1. Run a pipeline on a main branch of a project
  2. Create a merge request for a security finding
  3. Run the following GraphQL query. You should see the merge request data
{
  project(fullPath: "<project_path>") {
    pipeline(iid: "1") {
      id
      securityReportFindings {
        nodes {
          mergeRequest {
            description
          }
        }
      }
    }
  }
}

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 #384509 (closed)

Edited by Doug Stull

Merge request reports