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

Fix document-level SPDX identifiers #21

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Fix document-level SPDX identifiers #21

merged 1 commit into from
Aug 21, 2024

Conversation

twaugh
Copy link
Collaborator

@twaugh twaugh commented Aug 21, 2024

No description provided.

@twaugh twaugh force-pushed the SPDX-Document branch 2 times, most recently from 59c21e6 to a0ed2ed Compare August 21, 2024 10:49
@mprpic
Copy link
Contributor

mprpic commented Aug 21, 2024

Ha, I was actually writing this up into the docs and thought about fixing this to resemble something closer to reality. Any reason not to set it to just SPDXRef-[UUID] here? In the docs I also noted that we could have some name between the SPDXRef part and the UUID part to help humans identify things when browsing relationships, but I'm not sure which exact values I'd add there.

@mprpic
Copy link
Contributor

mprpic commented Aug 21, 2024

Mmm, now I saw the Slack thread about this. Re-reading the SPDX docs, I guess I misunderstood what this value should be set to. It's merely an ID of the document itself that can be used within the relationship objects. The unique identifier of the document in a set of documents should be the documentNamespace then (even though in the JSON schema it's not a required attaibute)? Am I reading the spec wrong?

Also, if references are used between two different docs, shouldn't they use the SPDXID value?

@twaugh
Copy link
Collaborator Author

twaugh commented Aug 21, 2024

Mmm, now I saw the Slack thread about this. Re-reading the SPDX docs, I guess I misunderstood what this value should be set to. It's merely an ID of the document itself that can be used within the relationship objects. The unique identifier of the document in a set of documents should be the documentNamespace then (even though in the JSON schema it's not a required attaibute)? Am I reading the spec wrong?

Spec says it has to be that specific string: https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#631-description

And yes, documentNamespace is the unique identifier in a document set, and the spec says it is required: https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#65-spdx-document-namespace-field

Both of these points are not reflected accurately in the JSON Schema I think.

Also, if references are used between two different docs, shouldn't they use the SPDXID value?

For externalDocumentRef? It would be something like "my-external-doc:SPDXRef-Document" if you want to refer to the actual document itself.

@mprpic
Copy link
Contributor

mprpic commented Aug 21, 2024

Also, if references are used between two different docs, shouldn't they use the SPDXID value?

For externalDocumentRef? It would be something like "my-external-doc:SPDXRef-Document" if you want to refer to the actual document itself.

Gotcha, and my-external-doc here is the documentNamespace value.

That JSON schema really isn't great...

@mprpic mprpic merged commit 71fb100 into main Aug 21, 2024
3 checks passed
@mprpic mprpic deleted the SPDX-Document branch August 21, 2024 15:43
@twaugh
Copy link
Collaborator Author

twaugh commented Aug 21, 2024

Also, if references are used between two different docs, shouldn't they use the SPDXID value?

For externalDocumentRef? It would be something like "my-external-doc:SPDXRef-Document" if you want to refer to the actual document itself.

Gotcha, and my-external-doc here is the documentNamespace value.

It would be the short ID string. So actually it would be more like "DocumentRef-my-doc:SPDXRef-Document". https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#66-external-document-references-field

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.

2 participants