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:
2026-10-31 22:11:14 +00:00
parent 62b56e66d0
commit 31e89e872b
20 changed files with 1421 additions and 12 deletions
+8
View File
@@ -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)
}