[XPU CI] Guardian bot: auto-disable PR on 2-run XPU regression (draft) - #35549
Draft
arathi-hlab wants to merge 1 commit into
Draft
arathi-hlab wants to merge 1 commit into
arathi-hlab wants to merge 1 commit into
Conversation
Adds `.github/workflows/xpu-ci-guardian.yml`. When `PR Test (XPU)` on main fails twice in a row, the bot files a draft PR that inserts `disabled="..."` on the `register_xpu_ci(...)` marker for each failing test file and pings @arathi-hlab. A companion job auto-closes any open guardian PR once main goes green again. Design (per doc in-file): * Watch: schedule every 30 min + manual workflow_dispatch (with a dry-run toggle for testing). * Detect: two-consecutive-fail rule to filter single flakes; also filters known infra-flake patterns (UR_RESULT_ERROR_OUT_OF_RESOURCES, server-start timeout, XPU OOM) that `enable_retry` already handles. * Diagnose: extracts `test/registered/**/*.py` paths from --log-failed. * Unblock: injects `disabled=` into `register_xpu_ci(...)`. Never touches kernel code, test bodies, or run_suite.py. Skips files that are already disabled and files that don't call `register_xpu_ci`. * Dedup: at most one open guardian PR at a time (xpu-ci-guardian label). * PR body: lists failing files with the last 5 commits on each so the reviewer can identify the likely culprit at a glance. * Sweep: separate job that closes any open guardian PR when the next main run on `PR Test (XPU)` is green. Requires two secrets on the fork actions: * GITHUB_TOKEN — provided by default; used for read-only detection. * BOT_PR_TOKEN — fine-grained PAT with `contents:write` on arathi-hlab/sglang and `pull-requests:write` on sgl-project/sglang. This is a draft so the design can be reviewed before enabling. To enable: merge, add the two secrets, and toggle the workflow on in Actions settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Draft — putting this up so it can be reviewed / iterated on tomorrow.
Adds a GitHub Actions workflow (
.github/workflows/xpu-ci-guardian.yml) that watchesPR Test (XPU)onmain. When the last two consecutive runs onmainfail, it opens a draft PR that insertsdisabled="..."on theregister_xpu_ci(...)marker for each failing test file and pings the XPU CI owner. A separate job auto-closes any open guardian PR oncemaingoes green again.Design
workflow_dispatchwith adry_runtoggle.mainboth failed, so single flakes handled byenable_retryinrun_suite.pydon't trigger it. Also filters known infra-flake log patterns (UR_RESULT_ERROR_OUT_OF_RESOURCES,Server failed to start,XPU out of memory).test/registered/**/*.pypaths from the failing job's--log-failed.disabled="auto-disabled by xpu-ci-guardian: run <id>"into the file'sregister_xpu_ci(...). Never touches kernel code, test bodies,run_suite.py, or per-method@unittest.skipIf. Skips files that are already disabled and files that don't callregister_xpu_ci.xpu-ci-guardianlabel.Required secrets on the fork's Actions
GITHUB_TOKEN(default; read-only for detection).BOT_PR_TOKEN— fine-grained PAT withcontents:writeonarathi-hlab/sglangandpull-requests:writeonsgl-project/sglang.Enablement checklist (before turning it on)
BOT_PR_TOKENsecret on the fork.dry_run=trueand inspect the workflow's outputs.dry_run=falseagainst a known-failing history to confirm the PR body/format looks right.xpu-ci-guardianlabel to the label set onsgl-project/sglang.Explicitly out of scope for this bot
Test plan
dry_run=true— thedetectjob should classify the current XPU state and setactcorrectly without opening any PR.dry_run=falseon a synthetic branch where I forcibly log two failing runs, and confirm the PR opens with the right title / labels / reviewer.sweep-when-greenmanually after a subsequent green run — it should close the previously-opened guardian PR.xpu-ci-guardianlabel).Not included yet (defer to follow-up)
slackapi/slack-github-actionwhen a channel + token are chosen.🤖 Draft raised now so it can be reviewed tomorrow morning; happy to iterate on scope / triggers / notification medium.
CI States
Latest PR Test (Base): ✅ Run #32281257858
Latest PR Test (Extra): ❌ Run #32281257526