Skip to content

Fix N+1 issues when associating DAST profiles and CI Builds

Problem Statement

when dast profiles are associated with builds (see yaml below) there are two N+1 issues when there are multiple builds with the dast_configuration keyword:

  1. associating profiles.
  2. finding profiles.
stages:
  - dast
dast:
  stage: dast
  dast_configuration:
    site_profile: Some site
    scanner_profile: Some scanner
  script:
    - exit 0
dast2:
  stage: dast
  dast_configuration:
    site_profile: Another site
    scanner_profile: Another scanner       
  script:
    - exit 0

Proposed Solution

  • batch associate profiles.
  • batch load profiles.

Implementation Plan

following on from the work added in !74967 (merged):

  • extract service that takes a number of builds and profiles and associates them inside a single database insert.
  • extend finder to batch load profiles.
Edited by Philip Cunningham