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

Using diff command always produces empty output even if there are changes in SBOM's provided as inputs. #380

Open
bharathkolanda opened this issue Jul 12, 2024 · 3 comments

Comments

@bharathkolanda
Copy link

When i use "cyclonedx diff newBOM.json oldBOM.json > sbomDiff.txt" always produces empty sbomDiff.txt file even if there are differences.

If i use the option --component-versions the i get an "Unhandled exception: System.ArgumentNullException: Value cannot be null. (Parameter 'collection')"

When i tried to convert json to xml, conversion succeeds but the converted xml file is empty.

@andreas-hilti
Copy link
Contributor

@bharathkolanda Can you please attach your BOM files (or samples) such that we can reproduce your issue?

@bharathkolanda
Copy link
Author

@andreas-hilti : Please find the details below
existing-bom.json
standard-bom.json
sbomDiff.txt

And my ci pipeline looks as below
sbom-diff:
stage: check-sbom

needs:

- scp-codescanner-check

image:
name: cyclonedx/cyclonedx-cli:latest@sha256:269b82d4346362cbd2b1830bceece5e8a7e00921fa26ebba1c9e7291ea772be0
entrypoint: [""]
script:
- newSBOM=$(find . -iname standard-bom.json)
- oldSBOM=$(find . -iname existing-bom.json)
- cyclonedx diff $newSBOM $oldSBOM --output-format text > sbomDiff.txt
#- cat sbomDiff.txt
#- exit $(grep ^[+-] sbomDiff.txt | wc -l)
artifacts:
when: always
paths:
- sbomDiff.txt
- .//standard-bom.json
- ./
/existing-bom.json

@andreas-hilti
Copy link
Contributor

@bharathkolanda The two files are not valid cyclonedx BOM files. I think you need to specify the correct output file format when generating the BOMs (maybe --cyclonedx).

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

No branches or pull requests

2 participants