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

[issue_589] fix json parser: process fields that can be "NOASSERTION"… #590

Merged
merged 1 commit into from Apr 18, 2023

Conversation

meretp
Copy link
Collaborator

@meretp meretp commented Apr 17, 2023

… or "NONE" correctly
The issue is only related to the homepage field, while working on the fix, I noticed that the issue also applies to other fields.

fixes #589

… or "NONE" correctly

Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Copy link
Collaborator

@armintaenzertng armintaenzertng left a comment

Choose a reason for hiding this comment

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

Good catch! :)
I have a small remark that I don't feel very strongly about.

Comment on lines +21 to +58
"homepage, expected_homepage, download_location, expected_download_location, "
"copyright_text, expected_copyright_text, originator, expected_originator, supplier, expected_supplier",
[
(
"http://ftp.gnu.org/gnu/glibc",
"http://ftp.gnu.org/gnu/glibc",
"NOASSERTION",
SpdxNoAssertion(),
"NONE",
SpdxNone(),
"Organization: ExampleCodeInspect (contact@example.com)",
Actor(ActorType.ORGANIZATION, "ExampleCodeInspect", "contact@example.com"),
"NOASSERTION",
SpdxNoAssertion(),
),
(
"NOASSERTION",
SpdxNoAssertion(),
"NONE",
SpdxNone(),
"Copyright 2008-2010 John Smith",
"Copyright 2008-2010 John Smith",
None,
None,
None,
None,
),
(
"NONE",
SpdxNone(),
"http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
"http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
"NOASSERTION",
SpdxNoAssertion(),
"NOASSERTION",
SpdxNoAssertion(),
"Person: Jane Doe (jane.doe@example.com)",
Actor(ActorType.PERSON, "Jane Doe", "jane.doe@example.com"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is kind of hard to comprehend due to the scrambling of normal, none and no assertion cases. I get that this might make the test cases more diverse, but I don't think it is really worth it compared to just having test cases where all values are normal values or None/NONE etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, my intention was to make the test cases more diverse. I think both options doesn't really make a difference and as they are also just test cases I would stick to the current implementation and merge it like that.

@meretp meretp merged commit d9a2e01 into spdx:main Apr 18, 2023
32 checks passed
@meretp meretp deleted the issue-589 branch April 18, 2023 06: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.

JSON parser: homepage of package not parsed correctly
2 participants