Skip to content

Finalize records before exporting #3149

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

Open
crazy-max opened this issue Apr 23, 2025 · 0 comments · May be fixed by #3152
Open

Finalize records before exporting #3149

crazy-max opened this issue Apr 23, 2025 · 0 comments · May be fixed by #3152

Comments

@crazy-max
Copy link
Member

crazy-max commented Apr 23, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant