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

Relationship field in tag/value parser rejects valid values #59

Closed
matthewkmayer opened this issue Feb 24, 2021 · 1 comment · Fixed by #68
Closed

Relationship field in tag/value parser rejects valid values #59

matthewkmayer opened this issue Feb 24, 2021 · 1 comment · Fixed by #68
Assignees
Labels
bug Something isn't working
Milestone

Comments

@matthewkmayer
Copy link

Thanks for making this Go library! Having the ability to use SPDX files in Go is excellent.

I think I've found a bug in how the tag/value parser handles Relationship fields: SPDX 2.2 specifies this example is valid:

Relationship: SPDXRef-BobBrowser CONTAINS NOASSERTION

However, with a file containing

Relationship: SPDXRef-ion-tester CONTAINS NOASSERTION

the tvloader.Load2_2(r) call returns an error stating missing SPDXRef- prefix for element identifier.

The same file successfully passes with the Java validator:

$ java -jar /tmp/tools-java-0.0.6-jar-with-dependencies.jar Verify ./spdx-test-1.spdx TAG

This SPDX Document is valid.

I've made a reproduction repository at https://github.com/matthewkmayer/spdx-go-repro . It can be cloned then run with go run . to see the error.

I tried to find tests for this scenario in this repo but didn't find any. Perhaps guidance on how to find the relevant tests could help us solve this. 👍

@matthewkmayer matthewkmayer changed the title Relationship filed in tag/value parser rejects valid values Relationship field in tag/value parser rejects valid values Feb 24, 2021
@swinslow
Copy link
Member

Thanks Matt! This is a great catch. You're right, currently the parser for Relationships is probably assuming that both parts of the Relationship will be valid SPDX identifiers -- but yes, as of 2.2 it should catch NOASSERTION (and also NONE) as valid options here.

Thanks for filing this -- I will try to take a look at addressing this soon. I am trying to carve out some time to address a handful of other issues and PRs that folks have filed recently, so hopefully will be able to un-stick things soon :)

@swinslow swinslow added the bug Something isn't working label Mar 20, 2021
@swinslow swinslow added this to the 0.2.0 milestone Jul 4, 2021
@swinslow swinslow self-assigned this Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants