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

Migrate2spdx tools 0.8.0a1 #122

Conversation

meretp
Copy link
Contributor

@meretp meretp commented May 15, 2023

This PR adds new test data from the spdx-spec repo to the migration branch and adapts the code according to the changes in the spdx-tools.

With the refactored version of spdx-tools the parser is stricter in terms of mandatory properties and their types and wouldn't allow empty fields for creator, created or any spdx_id. Therefore we need to catch a possibly thrown SPDXParsingError and adapt the output generated from the conformance checker. Additionally, the refactored version has a separate validation layer to check if documents are valid according to the spec. This is used to e.g. check that all spdx_ids used in the document are unique. If a document is not valid it is makred as not ntia-conformant (although it could contain all minimum fields).

I also changed the formatting of the html output as the test was failing due to a different number of whitespaces. Using a string there prevents this, although I wasn't sure where this output is used and if the generated output if the provided document can't be parsed is correctly formatted.

There are still 4 failing tests due to bugs in the spdx-tools. Three of these bugs are already solved, as soon as spdx/tools-python#653 is merged we will make a second alpha release which should then be used as the dependency for the migration here and make the last tests pass.

Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
- some elements were deleted to match the ntia minimum elements

Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
- the parser of the refactored version of spdx-tools is stricter and raises an error if the provided document doesn't contain a creator, created date or SPDXIDs for any element. We catch this error and create an individual output in this case.
- update the test data
- assert for parsing error

Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
…cation

Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
@jspeed-meyers jspeed-meyers self-requested a review May 15, 2023 12:15
@jspeed-meyers jspeed-meyers added the enhancement New feature or request label May 15, 2023
@jspeed-meyers jspeed-meyers merged commit b8b5712 into spdx:migrate2spdx-tools-0.8.0a1 May 15, 2023
@meretp meretp deleted the migrate2spdx-tools-0.8.0a1 branch May 15, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants