Skip to content

Add vulnerability scanning data objects

Oscar Tovar requested to merge otovar/add-advisory-data-object into master

What does this MR do and why?

This MR creates PORO classes for the Advisory and AffectedComponent objects that are used by the SecurityReportBuilder and FindingBuilder classes. The benefits are the following:

  • A contract of what's required is established. Using YARD doc strings, we're able to know that these types are expected.
  • It's easier to test. With the added factories, we're able to facilitate the spec setup.
  • The class methods provide flexibility in converting from one type to another. See the AffectedComponent.from_sbom_occurrence and AffectedComponent.from_sbom_component methods. I admit that this was borrowed/influenced from Rust which extensively uses the From trait 😅 so it's not what Ruby typically uses, e.g. #to_affected_component.

Relates to #371065 (closed)

MR Series

The following MRs are all related, and set up in the following order.

├ master
├ ο Add vulnerability scanning data objects (!129307 - merged) 👈
├ ο Add service to create vulnerabilities for conti... (!128170 - merged)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Oscar Tovar

Merge request reports