spdx / spdx-3-model

The model for the information captured in SPDX version 3 standard.
https://spdx.dev/use/specifications/
Other
70 stars 45 forks source link

A complete(?) algorithm to resolve dependencies in the SPDX 3 model #242

Open maxhbr opened 1 year ago

maxhbr commented 1 year ago

Here I want to try to find a complete and correct algorithm to identify the direct dependencies of some package element.

Assumptions:

The Algorihm:

(one initially should freeze some timestamp, that is used to identify validity, to avoid inconsistencies)

Step 1: early exit

Step 1.a: Look, that the type is matching

Step 1.b: Look at relations

If there is a validity date attached to relations, this needs to be respected and relations need to be filtered accordingly.

Step 2: identify relevant relationships

If there is a validity date attached to relations, this needs to be respected and relations need to be filtered accordingly.

Step 2.a:

Step 2.b:

Step 2.c:

Step 3:

Output:

The result is the merged list of all above found artifacts.

Transitive dependencies:

To collect transitive dependencies, one should recursively call the above algorithm, with some kind of cycle detection

Questions:

kestewart commented 1 year ago

@iamwillbar - does the flow as Max articulates, align with your understanding?

goneall commented 7 months ago

This should probably be re-worked for the latest relationship definitions.

I don't think this will impact the 3.0 spec - moving to 3.1