Add run size_bytes and delete_runs to free disk space
Every run summary carries size_bytes (artifact tree, server-created Pi session directories and an estimate of the run's database rows), cached in pipeline_runs.size_bytes, invalidated by triggers, measured when a run finishes and backfilled in the background. delete_runs removes terminal runs with every scoped row and server-owned file, refuses active ones with a reason, and pushes runs_removed to subscribers. pipelines runs rm is the CLI form; retention apply now shares the complete row deletion.
This commit is contained in:
@@ -127,6 +127,10 @@ esac
|
||||
t.Fatal("retry reused run/session state", retry, err)
|
||||
}
|
||||
unchanged, err := store.GetRun(ctx, original.ID)
|
||||
if err == nil {
|
||||
// size_bytes is a cache the background sizer fills in, not history.
|
||||
unchanged.SizeBytes = original.SizeBytes
|
||||
}
|
||||
if err != nil || !reflect.DeepEqual(original, unchanged) {
|
||||
t.Fatal("retry modified old run", err)
|
||||
}
|
||||
@@ -234,6 +238,10 @@ func TestRetryReplaysInitialInputAndPinnedVersionThroughCLI(t *testing.T) {
|
||||
t.Fatal("retry lost idempotency", again, err)
|
||||
}
|
||||
unchanged, err := store.GetRun(ctx, original.ID)
|
||||
if err == nil {
|
||||
// size_bytes is a cache the background sizer fills in, not history.
|
||||
unchanged.SizeBytes = original.SizeBytes
|
||||
}
|
||||
if err != nil || !reflect.DeepEqual(original, unchanged) {
|
||||
t.Fatal("retry modified failed history", unchanged, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user