Skip to content
quarry View Ticket
Login

View Ticket

ci_run grows without bound

Closed8d5aa739f80c5e47e809afd3bd145034b04dbfc0Created 105.3 days agoUpdated 67.9 days ago
Description2026-08-17 15:10:44
Every CI launch inserts a ci_run row and nothing ever removes one. A repository committing steadily accumulates rows forever, in the OLTP database that 0001 §8 describes as 'small by construction' and litestream-replicated — so this is the one table that breaks that property.

The run itself lives in dagnats, which has its own retention; quarry stores only the mapping from run to check-in. That mapping is what makes a verdict explicable ('which run produced this ci-fail'), so it should not be dropped as eagerly as the engine drops run history.

Fix shape: age out terminal runs beyond some window, keeping at least the newest run per check-in so a verdict badge can still be traced to something. Unfinished runs are never pruned — a row whose status is not terminal is the poller's work list, and deleting it strands a run nobody will ever record the verdict for.

Filed alongside the CI slice (e3268319, f50a282a) rather than fixed inside it.

2026-09-12 15:58:30

Needs dmestas's decision before implementation. The fix itself is clear and I would take it — age out terminal ci_run rows, keep at least the newest per check-in so a verdict badge stays traceable, never prune an unfinished run because that row IS the poller's work list. What needs you is the retention window and the first run: it deletes production rows, and 'how long is a verdict explicable' is a policy answer rather than a technical one. Say a window and I will implement it.

(Recorded as a comment because quarry's own tracker defines no assignee field — its schema carries title, type, status, severity, priority, subsystem and nothing else, while tcl's carries assignee, submitter, closer and closedate. Assigning here needs both halves: the field added to quarry's ticket schema, and #0eafaa19 so quarry can write any field a tracker defines rather than fossil's default list.)

2026-09-12 17:49:28

Closed by cirun-retention landing on trunk (accepted)