Skip to content

Add AffectedComponent and Advisory data objects for vulnerability scanning

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.

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

Loading