Fixes bug with Warning message regarding SBOM format #99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the current implementation, it is possible for the
Warning: this buildpack is including both old and new format SBOM...
message to be triggered incorrectly. The warning is displayed if the launch or build object are not empty & if the API is0.7
. This isn't right though. If you have no SBOM entries, but you have process types or labels, then it would be not empty & you'd see this message incorrectly.This PR adjust the criteria such that you'll see this warning message if launch or build are not empty, if API is
0.7
and if BOM entries is not empty.This includes tests that validate that the BOM list is squashed to nil when the warning message occurs. We cannot test that the warning did not occur though. If API is
0.7
and we have a non-empty launch/build, the only side-effect we could observe to test is if the log message were written, but that goes to STDOUT so there isn't a good way to validate it.Signed-off-by: Daniel Mikusa [email protected]