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

Replace imports/ExternalMap with SpdxDocument #431

Closed
wants to merge 1 commit into from

Conversation

davaya
Copy link
Contributor

@davaya davaya commented Jul 23, 2023

Issue #415 calls for clarifying the roles of Bom and SpdxDocument:

  • a Bundle/Bom/Sbom lists elements that are members of a logical collection without regard to where they are serialized.
  • an SpdxDocument element lists elements serialized in a payload, used to import elements from another payload.

This PR addresses logical/physical separation and the import use case by:

  • deleting the ExternalMap type and the ElementCollection imports property that references it because "external" isn't a concept that applies to the logical element graph.
  • adding locationHint and verifiedUsing properties to SpdxDocument to locate and verify the referenced payload.

The serialization playground has an example of one payload referencing elements carried in another payload using SpdxDocument.

## External properties restrictions

- /Core/Element/name
- element
Copy link
Member

Choose a reason for hiding this comment

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

isn't a Element with the list of elements a Bundle or Collection? Why not inherit from one of those?

Copy link
Contributor Author

@davaya davaya Jul 28, 2023

Choose a reason for hiding this comment

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

In general because SpdxDocument has nothing to do with the logical model, or as Sean put it yesterday, with the "SPDX graph". When you define a Bundle element you are saying "the graph is saying something meaningful and worth remembering about this group of elements", whereas SpdxDocument is saying "if you have a payload or find it based on locationHint, you can verify the elements in it". The fact that some elements are in the same payload is not worth memorializing in the graph, particularly since the same elements can appear in different payloads in different combinations. ElementCollection is a persistent grouping, the SpdxDocument Element is purely transactional, as opposed to the SpdxDocument (payload) itself, which is a concrete persistent object itself that has meaning and is used at the physical layer, outside the graph, regardless of whether an SpdxDocument Element has ever been created to reference it.

In particular, because even ElementCollection has rootElement, which doesn't have anything to do with serialized data payloads. The payload itself must contain everything needed to understand and use it; anything in the SpdxDocument Element beyond what is needed to find and verify serialized data is just another dependency / coupling between logical and physical layers that should not exist.

Or to put it another way, if an application maintains "the graph", having done everything necessary to populate it with valid node data, every SpdxDocument Element (node) can be thown away without losing anything other than hints about where payloads were or might be found. The entire graph can be (re-)constructed from the SpdxDocuments (payloads) themselves with zero SpdxDocument Elements/nodes.

Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

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

Finally got a chance to not only review, but think through the different scenarios. I believe these changes make sense and better represents the intent of SPDX Document and better separates the logical and physical model.

That being said, since we came up with the current model after lots (and lots) of discussion on the tech call, I'm reluctant to merge before discussing at least briefly.

I'm particularly interested in @iamwillbar and @sbarnum views on this.

@goneall goneall added this to the 3.0-rc2 milestone Jul 28, 2023
@davaya davaya mentioned this pull request Aug 7, 2023
@zvr zvr added the serialization Something about the representation of data in bytes label Oct 17, 2023
@goneall
Copy link
Member

goneall commented Nov 3, 2023

To avoid confusion, I'm going to close this since it conflicts with our recent decision.

@davaya - we can re-open if our test of the external map proves that it doesn't work efficiently.

@goneall goneall closed this Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Profile:Core serialization Something about the representation of data in bytes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants