Skip to content

[CI] review-pr: watch for review requests starved of a hosted runner - #7638

Merged
zufayu merged 1 commit into
ROCm:mainfrom
zufayu:fix/review-bot-gate-watch
Nov 9, 2026
Merged

zufayu merged 1 commit into
ROCm:mainfrom
zufayu:fix/review-bot-gate-watch

Conversation

@zufayu

@zufayu zufayu commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

What this changes

The last uncovered silence from the rollout: when GitHub-hosted runners starve, a review request sits at run-level queued with no job started — no gate, no review, no watchdog, no report, no mail. Every guard that could speak lives inside the very run that cannot start, so the in-run watchdog structurally cannot cover it. This adds the one watcher outside the runs it watches:

  • review-bot-gate-watch.yml — a */15 cron on hosted runners that runs gate_watch.py and pages by failing its own job: a failed scheduled run notifies the workflow author. Zero write permissions (actions: read + contents: read), no bot token, and no PR association needed — a run-level queued run's PR is not readable from the run anyway.
  • gate_watch.py — lists status=queued runs of aiter-review-bot.yml (paginated; under a burst the run stuck longest is on the last page) and pages for requests aged 30–45 min.

Why a 30–45 min window

Exactly once per stuck request, with no state to keep: the cron fires every 15 min and a request pages only while its age is inside [30, 45) — one poll wide. A run already paged by an earlier poll is out of the window and stays quiet. A late or skipped poll can miss a window entirely; that is the silence that exists today, and under-paging beats paging about the same stuck request every fifteen minutes.

STUCK_MINUTES/WINDOW_MINUTES are constants, not env: the window must stay one poll wide, and an env override could drift from the cron with no guard seeing it. check_prompts.py asserts the cron interval equals WINDOW_MINUTES, and carries gate_watch.py in the owner-fallback check so its @handle stays in step with _notify.py's env class.

The mechanism

  • gate_watch_test.py — 8 cases + 6 mutants against a fake API and a fixed clock (16 green): quiet when merely queueing, pages once per stuck request not once per poll, quiet about already-paged runs, override owner, fails loudly when the queue cannot be read, finds the stuck request under a 120-run backlog.
  • selftest.sh — new [gate watch] section; the no-git-checkout case now copies the whole review-bot workflow family (its *review-bot.yml glob predated a second workflow being read).
  • review-bot-selftest.yml — watches the new workflow file too, since a guard now asserts across it.

selftest 115 green / 0 red, check_prompts 0 drift, ruff F,E9 clean, actionlint clean on the new workflow.

🤖 Generated with Claude Code

When GitHub-hosted runners starve, a review request sits at run-level
queued with no job started: no gate, no review, no watchdog, no report,
no mail. Every guard that could speak lives inside the very run that
cannot start, so the silence is structural -- the rollout watched runs
sit queued 30+ min with nothing to show for it.

review-bot-gate-watch.yml is the one watcher outside the runs it
watches: a */15 cron poll that fails its own job to page (a failed
scheduled run notifies the workflow author; zero write permissions, no
bot token anywhere in the file). gate_watch.py pages a request only
while its age is inside [30, 45) min -- one poll wide, so exactly once
per stuck request with no state to keep. A late or skipped poll can
miss a window entirely; that is the silence that exists today, and it
beats paging about the same stuck request every fifteen minutes.

The thresholds are constants, not env: the window must stay one poll
wide, and check_prompts.py now asserts the cron interval equals
WINDOW_MINUTES, alongside the owner-fallback row that keeps gate_watch's
handle in step with _notify.py.

gate_watch_test.py drives the shipping script against a fake API and a
fixed clock: 8 cases (quiet when merely queueing, pages once per stuck
request not per poll, quiet about already-paged runs, override owner,
loud when the queue cannot be read, stuck request found under a
120-run backlog) and 6 mutants that each turn a named case red.
selftest 115 green / 0 red, check_prompts 0 drift.

Co-Authored-By: Claude Code <[email protected]>
@zufayu
zufayu requested a review from a team November 9, 2026 03:21
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7638 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@github-actions github-actions Bot changed the title review-pr: watch for review requests starved of a hosted runner [CI] review-pr: watch for review requests starved of a hosted runner Nov 9, 2026
@github-actions github-actions Bot added the CI label Nov 9, 2026
@aiter-bot

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 2c818d88f68e · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What permissions and untrusted-input boundary does this CI change have, and can fork PR code or text reach a privileged execution path?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@zufayu
zufayu merged commit 419d1bc into ROCm:main Nov 9, 2026
ruanjm pushed a commit that referenced this pull request Nov 10, 2026
When GitHub-hosted runners starve, a review request sits at run-level
queued with no job started: no gate, no review, no watchdog, no report,
no mail. Every guard that could speak lives inside the very run that
cannot start, so the silence is structural -- the rollout watched runs
sit queued 30+ min with nothing to show for it.

review-bot-gate-watch.yml is the one watcher outside the runs it
watches: a */15 cron poll that fails its own job to page (a failed
scheduled run notifies the workflow author; zero write permissions, no
bot token anywhere in the file). gate_watch.py pages a request only
while its age is inside [30, 45) min -- one poll wide, so exactly once
per stuck request with no state to keep. A late or skipped poll can
miss a window entirely; that is the silence that exists today, and it
beats paging about the same stuck request every fifteen minutes.

The thresholds are constants, not env: the window must stay one poll
wide, and check_prompts.py now asserts the cron interval equals
WINDOW_MINUTES, alongside the owner-fallback row that keeps gate_watch's
handle in step with _notify.py.

gate_watch_test.py drives the shipping script against a fake API and a
fixed clock: 8 cases (quiet when merely queueing, pages once per stuck
request not per poll, quiet about already-paged runs, override owner,
loud when the queue cannot be read, stuck request found under a
120-run backlog) and 6 mutants that each turn a named case red.
selftest 115 green / 0 red, check_prompts 0 drift.

Co-authored-by: zufayu <[email protected]>
Co-authored-by: Claude Code <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants