Skip to content

Expose commit sha on Vulnerabilities::Occurrence

Arthur Evstifeev requested to merge bug/vulnerability-occurence-blob-path into master

What does this MR do?

As reported #13857 (closed) presenter for Vulnerabilities::Occurrence doesn't generate blob_path if sha is missing which causes occurrence widget to not generate links for affected files. This MR adds sha accessor on Vulnerabilities::Occurrence. SHA will be sourced from pipeline.sha for PipelineVulnerabilitiesFinder and from joined table for VulnerabilityFindingsFinder (via Vulnerabilities::Occurrence.for_pipelines_with_sha)

Screenshots

Before MR:

Screenshot_2019-11-07_Pipeline___ap4y_sast-test Screenshot_2019-11-07_Screenshot

With MR:

Screenshot_2019-11-07_Pipeline___ap4y_sast-test_1_ Screenshot_2019-11-07_Screenshot_1_

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Arthur Evstifeev

Merge request reports