-
Notifications
You must be signed in to change notification settings - Fork 41
fix: Store DSSE envelope when bundle is not available #1907
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -181,9 +181,17 @@ func (r *WorkflowRunRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID | |
|
|
||
| // SaveAttestation Saves the attestation for a workflow run in the database | ||
| func (r *WorkflowRunRepo) SaveAttestation(ctx context.Context, id uuid.UUID, att *dsse.Envelope, digest string) error { | ||
| run, err := r.data.DB.WorkflowRun.UpdateOneID(id). | ||
| SetAttestationDigest(digest). | ||
| Save(ctx) | ||
| q := r.data.DB.WorkflowRun.UpdateOneID(id). | ||
| SetAttestationDigest(digest) | ||
|
|
||
| // the envelope will come empty in normal attestations, since bundles are stored separately | ||
| // But old CLIs might still send the envelope instead of the bundle. In those cases, we store it | ||
| // as before. But this is a DEPRECATED behaviour that will be removed eventually. | ||
| if att != nil { | ||
| // Set attestation when using old CLI versions | ||
| q.SetAttestation(att) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but I thought that we wanted to store always bundle. Didn't we end up doing some sort of automatic wrapping on a bundle?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could. But even if we do it, old attestations must still be supported |
||
| } | ||
| run, err := q.Save(ctx) | ||
| if err != nil && !ent.IsNotFound(err) { | ||
| return err | ||
| } else if run == nil { | ||
|
|
||
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.
ok, so make it even more obvious that this is a deprecated behavior