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
- In a Rails console, create a new
SupplyChain::Attestation. - Set the required
project,subject_digest,predicate_typeandfile; these can be arbitrary. - Save the model. Verify that
iidis set and a record ininternal_idsis created.
Related to #566616 (closed)
Edited by Aaron Huntsman