Skip to content

CI watch warns on a job over budget on main, and skips the count of a branch older than the limits - #3009

Merged
davidmckayv merged 1 commit into
mainfrom
ci/watch-old-branches-and-green-main
Dec 5, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
ci/watch-old-branches-and-green-main

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

What this changes

Two CI watch fixes, ported from openbot-backend #1249 and #1250. The code here is the same.

  1. A job over budget on main or in the merge queue no longer turns CI watch red.
    • The problem: a red CI watch marks main's commit not green. Staging's pick of green main (the backend's scripts/staging-green.ts, which reads this repository too) then skipped every commit until the job was fast again, though every real check had passed. That blocked Staging on 5 December.
    • The fix: the job keeps its ci-budget issue and gets a CI over budget warning on the run, and CI watch stays green. A PR over budget still fails: the static budget test and the job count both still fail it.
  2. A PR whose branch predates the budget's limits is no longer counted.

Where it runs

scripts/ci-watch.ts and a comment in .github/workflows/ci-watch.yml. GitHub Actions only; no app, server or API change.

Changelog

none

Proof

  • scripts/ci-watch-requests.test.ts runs CI watch as CI runs it, against the gh api stand-in and real runs of this repository:
    • A merge-queue run with three jobs over budget now prints the CI over budget warning and exits 0. Before the fix it exited 1.
    • A real PR run, read with a branch whose budget file is this repository's from before CI fails when it grows slower or starts more jobs than its written budget #2988, now exits 0 with the note. Before the fix it crashed with exactly that TypeError.
    • Both failed before the fix and pass after it.
  • bun test on ci-watch-requests, ci-watch, ci-budget, ci-budgets and workflow-concurrency: 96 pass.
  • biome format and lint clean; tsc clean; actionlint and zizmor clean on ci-watch.yml.

… branch older than the limits

Two fixes from openbot-backend #1249 and #1250, the same code here.

A job over budget in the merge queue or on main failed CI watch, which marks
main's commit not green; Staging's pick of green main (the backend's
scripts/staging-green.ts, which reads this repository too) then skipped every
commit until the job was fast again, though every real check passed. It now
keeps its ci-budget issue and prints a `CI over budget` warning, and CI watch
stays green. A pull request still fails the budget test and the job count.

On a pull request's run CI watch reads that branch's own
.github/ci-budgets.json. A branch cut before the file had `limits` (#2988)
crashed it ("undefined is not an object (evaluating 'file.limits[key]')"). Its
job count is now skipped, with a note.
@davidmckayv
davidmckayv added this pull request to the merge queue Dec 5, 2026
Merged via the queue into main with commit c19439f Dec 5, 2026
30 checks passed
@davidmckayv
davidmckayv deleted the ci/watch-old-branches-and-green-main branch December 5, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant