Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug with Warning message regarding SBOM format #99

Merged
merged 1 commit into from
Nov 29, 2021
Merged

Fixes bug with Warning message regarding SBOM format #99

merged 1 commit into from
Nov 29, 2021

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Nov 29, 2021

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 is 0.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]

@dmikusa dmikusa added type:bug A general bug semver:patch A change requiring a patch version bump labels Nov 29, 2021
@dmikusa dmikusa requested a review from sambhav November 29, 2021 21:32
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 is `0.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.

Signed-off-by: Daniel Mikusa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants