-
Notifications
You must be signed in to change notification settings - Fork 314
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
reporter: Add a very basic SpdxDocumentReporter #2800
Conversation
reporter/src/funTest/assets/spdx-document-reporter-expected-output.spdx.json
Show resolved
Hide resolved
reporter/src/funTest/kotlin/reporters/SpdxDocumentReporterTest.kt
Outdated
Show resolved
Hide resolved
reporter/src/funTest/kotlin/reporters/SpdxDocumentReporterTest.kt
Outdated
Show resolved
Hide resolved
@fviernau Could you add a debug statement to show how long it took to generate the report? Like the other reporter have, see for example https://github.com/oss-review-toolkit/ort/blob/master/reporter/src/main/kotlin/reporters/EvaluatedModelReporter.kt#L68 |
That shouldn't be necessary as the generation of any report is timed. |
957b11c
to
7df851c
Compare
reporter/src/funTest/assets/spdx-document-reporter-expected-output.spdx.json
Show resolved
Hide resolved
reporter/src/funTest/kotlin/reporters/SpdxDocumentReporterTest.kt
Outdated
Show resolved
Hide resolved
To prepare for an upcoming change. Signed-off-by: Frank Viernau <frank.viernau@here.com>
7df851c
to
b9d0089
Compare
reporter/src/funTest/kotlin/reporters/SpdxDocumentReporterTest.kt
Outdated
Show resolved
Hide resolved
c29ade7
to
cac7349
Compare
cac7349
to
8915e7f
Compare
Add an initial SPDX document reporter which for now only creates the document header. Logic for serializing additional data will be added incrementally in following changes. Signed-off-by: Frank Viernau <frank.viernau@here.com>
8915e7f
to
6a285dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I happened to see this linked from another issue in spdx/spdx-spec -- added a couple of comments re: the Document Creation Info section in the generated output samples.
@@ -0,0 +1,14 @@ | |||
{ | |||
"SPDXID" : "SPDXRef-<REPLACE_UUID>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SPDXID
for the document itself should always be the literal text "SPDXRef-DOCUMENT" -- see https://spdx.github.io/spdx-spec/v2-draft/document-creation-information/#63-spdx-identifier-field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @swinslow, greatly appreciated!
I'll merge the PR as is now, and then address your comment(s) in a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @fviernau!
@@ -0,0 +1,14 @@ | |||
{ | |||
"SPDXID" : "SPDXRef-<REPLACE_UUID>", | |||
"spdxVersion" : "SPDX-2.2.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format for the SPDX version field is SPDX-M.N
-- the major and minor versions are included, but not the point releases if there is one -- see https://spdx.github.io/spdx-spec/v2-draft/document-creation-information/#61-spdx-version-field
So this should just be "SPDX-2.2"
, even after the 2.2.1 release of the spec comes out. The intention is that the point release 2.2.1 is not changing anything substantive in the spec, so SPDX 2.2.1 documents should be identical to 2.2.
@@ -0,0 +1,13 @@ | |||
--- | |||
SPDXID: "SPDXRef-<REPLACE_UUID>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as in JSON file, the value here should be SPDXRef-DOCUMENT
@@ -0,0 +1,13 @@ | |||
--- | |||
SPDXID: "SPDXRef-<REPLACE_UUID>" | |||
spdxVersion: "SPDX-2.2.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as in JSON file, the value here should be SPDX-2.2
Add an initial SPDX document reporter which for now only creates the
document header. Logic for serializing additional data will be added
incrementally in following changes.
Signed-off-by: Frank Viernau frank.viernau@here.com