Skip to content

Poll a build at its running or recent-failure rate whichever branch the run is on [patch] - #396

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/issue-392-priority-every-branch
Nov 4, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/issue-392-priority-every-branch

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #392

What was wrong

BuildSync.Priority read Build.IsOngoing and Build.LastStatus, which only describe the most recently started run across every branch. When a long run on main was still going and a later PR run had already finished, the build dropped to Low. That meant it was polled every 120 s instead of 30 s, or skipped entirely under 15% budget. If main then failed, the build never reached the Medium recent-failure tier.

Change

  • Build.HasOngoingRun: true when any run on any branch is pending or running.
  • Build.HasRecentBranchFailure(since): true when the newest run on some branch failed and was updated after since. A failure that a later run on the same branch has superseded doesn't count.
  • BuildSync.Priority uses both. Build.IsOngoing and LastStatus keep their meaning for display and ETA.

Tests

New BuildPriorityTests cover the two-branch scenario from the issue (running main + finished feature → High; main then fails → Medium), a failure superseded on its own branch (Low), and a failure older than an hour (Low). Without the fix, the first two fail. The full suite passes: 166/166.


Generated by Claude Code

…he run is on [patch]

BuildSync.Priority read Build.IsOngoing and Build.LastStatus, which describe
only the most recently started run across every branch. A long run on main
that was still going after a later PR run had finished dropped the build to
Low (or skipped it under 15% budget), and main then failing never reached the
Medium recent-failure tier.

Priority now treats the build as running when any run is ongoing, and as a
recent failure when the newest run on any branch failed within the hour.

Fixes #392

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW5KENnPmXEat6KQ92F
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 1c9e442 into main Nov 4, 2026
16 checks passed
@matt-edmondson
matt-edmondson deleted the claude/issue-392-priority-every-branch branch November 4, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants