Fix Created
field format in bill of materials
#939
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When generating a Bill Of Materials, the SPDX specification for the
Created field expect the date with format
YYYY-MM-DDThh:mm:ssZ
.The current implementation does the transformation to express the
current time in UTC, but this has the side effect to add
+00:00
at theend of the date when formatting it. The resulting date
YYYY-MM-DDThh:mm:ss+00:00Z
does not match the SPDX specification andvalidation using the SPDX online tools fail because of this invalid
format.
Make sure to remove
tzinfo
from the date so that time zone informationis not output when formatting the date, so that we can safely append a
Z
at the end to indicate UTC time-zone.Other formats for the time-zone (e.g.
+00:00
) is not allowed by theSPDX specification.
Fixes: #918