fix(ci): tell stale branches to pull latest staging on vacuous type-check runs

This commit is contained in:
mateo-berri 2026-08-06 13:08:30 -07:00
parent f6587faef5
commit 5741b26e0b
2 changed files with 13 additions and 1 deletions

View file

@ -627,7 +627,9 @@ def cmd_check(head: Mapping[str, int], base_ref: str) -> None:
print(
f"FAIL: basedpyright produced no errors, but {BUDGET_PATH.name} allows "
f"up to ~{expected}. The type checker almost certainly crashed or emitted "
f"nothing; refusing to certify a vacuous run."
f"nothing; refusing to certify a vacuous run. This usually means this "
f"branch is missing type checker fixes from its base branch: pull the "
f"latest {DEFAULT_BASE.removeprefix('origin/')} and merge or rebase onto it."
)
raise SystemExit(1)
if not over_ceiling(head, budget):

View file

@ -200,6 +200,16 @@ def test_genuine_zero_and_empty_budget_are_not_vacuous():
)
def test_vacuous_run_failure_tells_the_user_to_pull_latest_staging(capsys):
import pytest
with pytest.raises(SystemExit):
gate.cmd_check({}, gate.DEFAULT_BASE)
out = capsys.readouterr().out
assert "refusing to certify a vacuous run" in out
assert "pull the latest litellm_internal_staging and merge or rebase onto it" in out
def test_update_ratchets_a_limit_down_by_what_the_branch_fixed():
# A rule that dropped from 40 (branch point) to 30 (current) fixed 10, so its
# limit of 100 falls to 90 -- the granted headroom (60) is preserved, not the