Skip to content

Finalize records before exporting #3149

@crazy-max

Description

@crazy-max

follow-up docker/actions-toolkit#652 (comment)

We should make sure records are finalized before exporting them similar to history trace:

// build is complete but no trace yet. try to finalize the trace
time.Sleep(1 * time.Second) // give some extra time for last parts of trace to be written
c, err := rec.node.Driver.Client(ctx)
if err != nil {
return "", nil, err
}
_, err = c.ControlClient().UpdateBuildHistory(ctx, &controlapi.UpdateBuildHistoryRequest{
Ref: rec.Ref,
Finalize: true,
})
if err != nil {
return "", nil, err
}

@tonistiigi I wonder if we should have a Finalize attribute in

type queryOptions struct {
CompletedOnly bool
Filters []string
}

To share logic for both export and trace in queryRecords?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions