Skip to content

Add Internal ID to SupplyChain::Attestation

What does this MR do and why?

Adds AtomicInternalId support to SupplyChain::Attestation. This will allow the download route for the UI (#566601 (closed)) to use a simpler project-scoped ID rather than the attestation digest.

Note: Since work on !204998 (merged) will begin persisting attestations, this MR assumes that some attestation records will exist, even if only for testing. For this reason, a unique index and validation on (project_id, iid) are not created here, but can be done in a followup.

How to test locally

  1. In a Rails console, create a new SupplyChain::Attestation.
  2. Set the required project, subject_digest, predicate_type and file; these can be arbitrary.
  3. Save the model. Verify that iid is set and a record in internal_ids is created.

Related to #566616 (closed)

Edited by Aaron Huntsman

Merge request reports

Loading