Backend - Display validity check in MR security modal
What does this MR do and why?
Branched off of !197549 (merged), which adds findingTokenStatus to PipelineSecurityReportFindingType
- In order to display the Validity Check status on the MR security modal, we need to expose
findingTokenStatusonPipelineSecurityReportFindingType, which is whatgetSecurityReportFindingquery uses to render data in the MR modal UI.- Reference: #555009 (comment 2620317736)
- Currently, we're only running
UpdateTokenStatusWorkeron default branch pipelines and not MR pipelines. This MR callsUpdateTokenStatusWorkerfromScanSecurityReportSecretsWorkerto also handle MR findings. - However, MR pipelines only produce
Security::Findingrecords, rather thanVulnerabilityrecords, because these MR findings are not present in the default branch of the project. Only default branch pipelines produceVulnerabilities::Findings. -
findingTokenStatusis tied toVulnerabilities::Finding, notSecurity::Finding. So in order to accessfindingTokenStatus, we need to ensure a correspondingVulnerabilities::Findingexists and look it up. - To do this, we need to run
IngestReportServicefor MR pipelines as well, so there is aVulnerabilities::Findingfor eachSecurity::Findingfor the MR security scan. For each newly createdVulnerabilities::Finding, setpresent_on_default_branch: falseso it doesn't show up in the project Vulnerability Report page. - Once these
Vulnerabilities::Findingrecords exist, the resolver can return afindingTokenStatus. -
getSecurityReportFindingquery returnsPipelineSecurityReportFindingobjects, notVulnerabilities::Finding. So after running ingestion, the frontend still receivesPipelineSecurityReportFinding. - So we have to update
FindingTokenStatusResolverto receive either aVulnerabilities::Finding(from the default branch) or aPipelineSecurityReportFinding(from an MR pipeline). ForPipelineSecurityReportFinding, look up the correspondingVulnerabilities::Finding(created during ingestion) by uuid , and return the linked token status.
We'll add the frontend graphql fragment and the token validity status badge in this MR: !197546
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Serena Fang