Skip to content

Fix #97 Duplicate extracted licenses when parsing from RDF #98

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

Merged
merged 2 commits into from
Aug 20, 2019

Conversation

xavierfigueroav
Copy link
Collaborator

@xavierfigueroav xavierfigueroav commented Apr 7, 2019

Fixes #97
The field Document.extracted_licenses contained duplicate ExtractedLicense objects when they are parsed from RDF files. Both extracted licenses in <licenseConcluded> and <licenseDeclared> were being added twice.

This PR makes extracted licenses are parsed only once, when <SpdxDocument> is being parsed.

Signed-off-by: Xavier Figueroa xavierfigueroav@gmail.com

@xavierfigueroav
Copy link
Collaborator Author

@pombredanne I've noticed that there aren't any RDF parsers tests where to add one for this issue. I could eventually write them, but is it OK to meanwhile write only the needed one(s) to test this?

Copy link
Collaborator

@krysnuvadga krysnuvadga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some unit tests to test verify the code change

@xavierfigueroav
Copy link
Collaborator Author

@pombredanne @krysnuvadga I've written some unit tests for the fields that may have been affected by the change.
I would have liked to follow the pattern suggested by @pombredanne in Gitter, as I actually did in tests for YAML/JSON parsers, but, although much of that code is reusable for this tests, it hasn't been merged yet. Moreover, for that code to work for RDF parsers, it would require some changes to avoid #91 consequences.

@xavierfigueroav xavierfigueroav force-pushed the rdfparser-duplicate-ext-lic branch 2 times, most recently from f1348e6 to 9ad3993 Compare June 3, 2019 00:17
@pombredanne
Copy link
Member

@xavierfigueroav This needs some rebasing

@xavierfigueroav xavierfigueroav force-pushed the rdfparser-duplicate-ext-lic branch from 9ad3993 to 693f801 Compare June 8, 2019 05:56
@xavierfigueroav
Copy link
Collaborator Author

@pombredanne Rebased!

Signed-off-by: Xavier Figueroa <xavierfigueroav@gmail.com>
Signed-off-by: Xavier Figueroa <xavierfigueroav@gmail.com>
@xavierfigueroav xavierfigueroav force-pushed the rdfparser-duplicate-ext-lic branch from 693f801 to f0af856 Compare August 18, 2019 00:54
@pombredanne pombredanne merged commit f0af856 into spdx:master Aug 20, 2019
@pombredanne
Copy link
Member

All merged. Thank you again :)

@xavierfigueroav xavierfigueroav deleted the rdfparser-duplicate-ext-lic branch August 20, 2019 22:34
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.

Duplicate extracted licenses when parsing from RDF
3 participants