-
Notifications
You must be signed in to change notification settings - Fork 38
feat(referrers): persistence layer #416
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
Conversation
@jotadrilo, since you mentioned the OCI's referrer API. I am curious to get your take on this, especially on the broader picture #415 |
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 code looks good to me, but keep in mind that my high-level picture is not fully developed yet
What instead of bool for |
I think it would be good to add more info here about why we add the artifact type and
sha256 for a container image and for a container image manifest file can be the same. |
makes sense, will do! |
I do not think so, some reasons
But I am curious on what you think, I might be missing something. |
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 for the online review together
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
1f93a18
to
228b90e
Compare
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Persistence layer for #415. once we merge this code, newly received attestations will get denormalized and their materials and subjects will be stored in this new index. On a following patch, we'll add an API endpoint to read the stored data.
Data model
It extends the data model by storing referrers, which are entities represented by their content digest + artifact type.
In addition to that table, two more are added. One to link to the organizations where these items have been present (the attestation that contained them was for) + dependencies (which are other referrers). The dependencies table is meant to map material/subject <-> attestation relationships.
Entrypoint
When an attestation is received, it gets unpacked and persisted.
Retrieve information
A method
GetFromRoot(ctx context.Context, digest string) (*StoredReferrer, error)
has been added and allows retrieving referrers + their dependencies by providing a digest.See
biz/referrer_[integration]_test.go
to know more about how the creation and retrieval of the data happens.