You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
After a poll prunes runs, a branch quiet for 30+ days shows an older run's Success (or a stuck Pending) instead of its newest run's Failure #418
Build.PruneRuns (BuildMonitor/Build.cs:91-125, added in #398 and called from BuildSync.UpdateBuildAsync after every build poll) applies each keep-rule to runs one at a time, not per branch:
"newest run on a branch" applies only to branches whose newest run is within BranchRetention (30 days);
"ongoing" and "the estimator's newest successful runs" keep runs regardless of branch.
So for a branch outside the 30-day window, its newest run can be removed while an older run on the same branch survives through one of the other rules. RenderBuildTable (BuildMonitor.cs:620-625) groups the remaining runs by branch and shows the newest one left. That is now the older run. The status filter (ShouldShowBuildBranch), History and Errors read the same wrong run. ListByWorkflow only returns the newest runs, so the dropped run never comes back, and the result is persisted to the app data file.
The PruneRuns remarks and CLAUDE.md say "A branch none of whose runs is kept disappears from the table". Here the branch stays, showing a run that isn't its latest.
Repro (MSTest, in the style of RunRetentionTests, Now = 2026-06-01)
release/1.0: rel-older at Now−40d (Success), rel-newest at Now−35d (Failure)
60 Failure runs on branches pr-0…pr-59, one hour apart, ending at Now
build.PruneRuns(Now)
rel-older status
removed
newest remaining release/1.0 run
Success
1
before rel-newest:Failure → after rel-older:Success
Pending
1
before rel-newest:Failure → after rel-older:Pending
Why it matters
A failed release branch turns green in the monitor, with no new run, just because other branches were busy. A failure is hidden, which is the one thing a build monitor must not do. In the Pending case, the row shows a progress ring for a build that finished long ago.
Suggested fix
Decide per branch. After building kept from the existing rules, add each kept run's branch-newest run, so a branch either shows its true latest run or disappears:
Priority: High. A failed release branch can turn green, or show a Pending ring that never clears, with no new run. All it takes is busy traffic on other branches. Hiding a failure is the one thing a build monitor must not do. The wrong run is also persisted to the app data file, and ListByWorkflow never brings the dropped run back, so the row doesn't heal itself.
Area / suggested assignment:Build.PruneRuns (BuildMonitor/Build.cs:91-125, introduced by Prune old runs after each build poll so stale branches stop keeping rows [patch] #398) and its tests in RunRetentionTests. The fix is small and local: after building kept, add each kept branch's newest run, as the issue suggests. That makes the "a branch shows its latest run or disappears" contract in the PruneRuns remarks and CLAUDE.md true again.
Recommended next step: apply the per-branch union in PruneRuns. Add the issue's two-variant repro (Success and Pending rel-older) to RunRetentionTests, and confirm the existing retention tests still pass.
Activity
matt-edmondson commentedon Nov 12, 2026
Triage
ListByWorkflownever brings the dropped run back, so the row doesn't heal itself.Build.PruneRuns(BuildMonitor/Build.cs:91-125, introduced by Prune old runs after each build poll so stale branches stop keeping rows [patch] #398) and its tests inRunRetentionTests. The fix is small and local: after buildingkept, add each kept branch's newest run, as the issue suggests. That makes the "a branch shows its latest run or disappears" contract in thePruneRunsremarks and CLAUDE.md true again.PruneRuns.Recommended next step: apply the per-branch union in
PruneRuns. Add the issue's two-variant repro (Success and Pendingrel-older) toRunRetentionTests, and confirm the existing retention tests still pass.Generated by Claude Code