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

Package the cyclonedx-cli tool for testing purpose #13

Merged
merged 5 commits into from
Jan 17, 2024

Conversation

ErinvanderVeen
Copy link

@ErinvanderVeen ErinvanderVeen commented Jan 12, 2024

Especially the cyclonedx validate --input-file <PATH> is a very good one. This one validates the provided json file against the cyclonedx spec, and is how I caught multiple non-conformities.

TODO: Add to CI in some way.
Especially the cyclonedx validate --input-file <PATH> is a very good one. This one validates the provided json file against the cyclonedx spec, and is how I caught multiple non-conformities.
@ErinvanderVeen ErinvanderVeen marked this pull request as draft January 12, 2024 20:17
@raboof
Copy link
Contributor

raboof commented Jan 13, 2024

Interesting! I started on this in NixOS/nixpkgs#197689 at some point, but IIRC validating with https://github.com/python-jsonschema/check-jsonschema against https://github.com/CycloneDX/specification/blob/master/schema/bom-1.5.schema.json provided more useful error messages for me. Did you find the tool improved or catches errors not found by just validating against the schema?

@ErinvanderVeen
Copy link
Author

Hoi @raboof!

I did not even consider testing against the schema (stupid me), and agree with you that your proposed way provides much, much better feedback than the cyclonedx-cli tool. With that, I think cyclonedx-cli is still worth keeping for CI purposes. As an "official" tool, I feel it has a lot of authority.

However, I'll absolutely also include a check against the schema.

@ErinvanderVeen
Copy link
Author

The cyclonedx-cli tool doesn't return a non-zero error code when validation fails...

@ErinvanderVeen ErinvanderVeen marked this pull request as ready for review January 17, 2024 10:57
@ErinvanderVeen ErinvanderVeen merged commit 97bff5b into master Jan 17, 2024
4 checks passed
@ErinvanderVeen ErinvanderVeen deleted the cyclonedx-cli branch January 17, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants