microsoft / component-detection

Scans your project to determine what components you use
MIT License
418 stars 86 forks source link

Adds an entry point for the sbom-tool use the ScanCommand class. #936

Closed sebasgomez238 closed 8 months ago

sebasgomez238 commented 9 months ago

Currently the ScanCommand class returns an int. In the sbom-tool we rely on the ScanResult object which forced us to go a step below and use the ScanExecution itself. This is causing us to miss out on a few features such as the ability to write a ScanManifest file (https://github.com/microsoft/sbom-tool/issues/452).

This PR adds an extra method to the ScanCommand class that returns a ScanResult object instead of an int.

Let me know if there is more suitable name the current name is "ExecuteAsync" the method I added is "ExecuteScanAsync"

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (d4ca976) 74.9% compared to head (af562e8) 74.9%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #936 +/- ## ===================================== Coverage 74.9% 74.9% ===================================== Files 235 235 Lines 9996 10002 +6 Branches 981 981 ===================================== + Hits 7488 7494 +6 Misses 2234 2234 Partials 274 274 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sebasgomez238 commented 9 months ago

Thanks! @cobya I added unit tests since I saw the codecov comments.