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

Revisit relationship naming / model #3287

Open
kzantow opened this issue Sep 27, 2024 · 0 comments
Open

Revisit relationship naming / model #3287

kzantow opened this issue Sep 27, 2024 · 0 comments
Labels
enhancement New feature or request needs-discussion
Milestone

Comments

@kzantow
Copy link
Contributor

kzantow commented Sep 27, 2024

What would you like to be added:
Align the terminology used to define relationships.

Today, in the Syft internal data model, relationships have the fields: From and To, but the Syft JSON has Parent and Child. These are all part of the public Syft 1.0 API at this point.

Additional context:
Recently, while adding dependency relationships, I found these confusing to follow due in part to this discrepancy in naming. From is mapped to Parent, so adding a dependency relationship is: From: PKG-A Dependency-Of To: PKG-B, to indicate PKG-B has a dependency of PKG-A, or PKG-A is a dependency of PKG-B depending on how you prefer to phrase the relationship. However this maps to Parent: PKG-A and Child: PKG-B, which seems backwards in terms of dependencies: I would consider the "parent" in a dependency relationship to be the one containing the other.

Additionally, if we are modifying relationships, I would strongly encourage considering using a one-to-many relationship model, similar to SPDX 3. I believe this would help to significantly reduce the size of SBOMs but would mean that we would have to invert Dependency-Of and only allow for relationship types of similar directionality.

Example from this pseudo-proposal:

"relationships": [
{
  "from": "PKG-B",
  "type": "dependencies",
  "to": [ "PKG-A" ]
}
@kzantow kzantow added the enhancement New feature or request label Sep 27, 2024
@kzantow kzantow added this to the Syft 2.0 milestone Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-discussion
Projects
Status: No status
Development

No branches or pull requests

2 participants