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

Broken test data in valid-service-1.x.json #294

Closed
tokcum opened this issue Sep 10, 2023 · 3 comments · Fixed by #295
Closed

Broken test data in valid-service-1.x.json #294

tokcum opened this issue Sep 10, 2023 · 3 comments · Fixed by #295
Assignees
Labels
test-data related to test-resources and -data validated

Comments

@tokcum
Copy link
Contributor

tokcum commented Sep 10, 2023

Hi,

working on cyclonedx-rust-cargo to support 1.4 I'm experiencing failed integration tests when verifying against valid-service-1.4.json while valid-service-1.4.xml just works.

The error tells me that a dependency references a bom which is not available in the file. Comparing the JSON to the XML file, I found that in JSON, the bom-ref is different. Setting the bom-ref to the value referenced in ref (like it is in XML), the test works fine.

"components": [
    {
      "bom-ref": "pkg:npm/acme/[email protected]",
      [...]

"dependencies": [
    {
      "ref": "pkg:maven/com.acme/[email protected]",

In XML it looks like this:

<components>
        <component type="library" bom-ref="pkg:maven/com.acme/[email protected]">
        [...]

<dependencies>
        <dependency ref="pkg:maven/com.acme/[email protected]">

It looks like this derivation existed from the very beginning of the test data. So, maybe I'm missing something or the implementation in cyclonedx-rust-cargo is stricter than other projects using the spec's test data.

I've prepared a fix in my own fork. If my analysis above is correct, let me know. I will create a pull request. Thanks.

@jkowalleck
Copy link
Member

jkowalleck commented Sep 11, 2023

Thank you very much for the report, @tokcum .

I've prepared a fix in my own fork. If my analysis above is correct, let me know. I will create a pull request. Thanks.

Could you link the fixed version you used?
Or even provide a pullrequest wit the fix that worked for you?

Having the diff as a working "expected input" would help analyze the issue.

@jkowalleck jkowalleck self-assigned this Sep 11, 2023
@tokcum
Copy link
Contributor Author

tokcum commented Sep 11, 2023

@jkowalleck, great. I've created a PR.

jkowalleck pushed a commit that referenced this issue Sep 11, 2023
…ce` (#295)

Fixes an inconsistency in test data of valid-service. First experienced in valid-service-1.4.json, other files (other versions and filetypes) showed the same deviation. The fix was derived from working test data of valid-service.

closes #294


Signed-off-by: tokcum <[email protected]>
jkowalleck pushed a commit to jkowalleck/fork_CycloneDX-specification that referenced this issue Sep 11, 2023
…ce` (CycloneDX#295)

Fixes an inconsistency in test data of valid-service. First experienced in valid-service-1.4.json, other files (other versions and filetypes) showed the same deviation. The fix was derived from working test data of valid-service.

closes CycloneDX#294


Signed-off-by: tokcum <[email protected]>
jkowalleck added a commit to jkowalleck/fork_CycloneDX-specification that referenced this issue Sep 11, 2023
forward-port of CycloneDX#295
fixes CycloneDX#294 in 1.6

Signed-off-by: Jan Kowalleck <[email protected]>
@jkowalleck
Copy link
Member

✔️ issue was validated
🏁 issue was fixed via #295
🏁 fix was forward-ported to v1.6 via #297

@jkowalleck jkowalleck added the test-data related to test-resources and -data label Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-data related to test-resources and -data validated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants