Repository navigation
[test-quarantine] Fix guardrails that let the workflow re-attempt rejected actions - #67620
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the daily test-quarantine agentic workflow to deterministically prevent re-attempting maintainer-rejected quarantine/unquarantine actions by injecting authoritative GitHub REST API data into the prompt, and updating guardrails to consume it.
Changes:
- Add pre-activation REST API fetches for (1) issue numbers labeled
re-quarantineand (2) recently closed-but-unmergedtest-quarantinePRs with trusted-author comments. - Update the unquarantine guardrail to treat
re-quarantineissue labels as an authoritative permanent block (in addition to merged PR diff parsing). - Bump
gh-awtooling and recompile the generated*.lock.ymlworkflow plus action pins.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| .github/workflows/test-quarantine.md | Adds deterministic pre-activation fetch steps and updates prompt guardrails to use injected issue/PR context. |
| .github/workflows/test-quarantine.lock.yml | Recompiled workflow lockfile reflecting new steps, new gh-aw versions, and regenerated runtime wiring. |
| .github/aw/actions-lock.json | Updates pinned gh-aw action versions used by the workflow compilation. |
77fd04a to
347dc8f
Compare
|
Addressed the review feedback (commit amended):
Recompiled; |
347dc8f to
1f529ef
Compare
|
Addressed — both new pre-activation steps now build the |
| data = json.loads(resp.read()) | ||
| results.extend(data.get("items", [])) |
| data = json.loads(resp.read()) | ||
| results.extend(data.get("items", [])) |
| "labels": { | ||
| "required": true, | ||
| "type": "array", | ||
| "itemType": "string", | ||
| "itemSanitize": true, | ||
| "itemMaxLength": 128 | ||
| "type": "array" | ||
| }, |
| if not github_output: | ||
| print("ERROR: GITHUB_OUTPUT is not set, cannot pass data to agent", file=sys.stderr) | ||
| sys.exit(1) | ||
| js = json.dumps(data) |
…ected actions Two recent misbehaviors (run 28656097334): PR dotnet#67577 tried to unquarantine SetsTlsHandshakeFeatureForHttps despite issue dotnet#49306 carrying the re-quarantine label, and PR dotnet#67576 re-quarantined WebSocketsWorks despite maintainer "do not quarantine" comments on the already-rejected dotnet#67443/dotnet#67415. Root causes: - The unquarantine re-quarantine check only parsed merged-PR diffs and left the match/exclude decision to the model; it never consulted the re-quarantine issue label the maintainer set. - The closed-PR comment check relied on MCP search_pull_requests, whose DIFC filter silently drops the workflow's own app/github-actions-authored PRs, so the maintainer comments were never seen. Fixes (deterministic pre-activation steps + injected data): - Fetch re-quarantine issue numbers; block unquarantine of any test whose tracking issue is labeled re-quarantine (authoritative, exact match). - Fetch closed-but-unmerged [test-quarantine] PRs + comments with a full token, bypassing the DIFC filter; the closed-PR check now uses this instead of MCP. Recompiled lockfile with gh-aw CLI v0.81.6 (setup action v0.80.9 -> v0.81.6). Co-authored-by: Copilot <[email protected]>
1f529ef to
c82b6b0
Compare
|
Addressed the code comments (commit amended):
Recompiled: 0 errors / 0 warnings. |
Problem
The daily Test Quarantine agent recently re-attempted two actions that maintainers had already rejected (run 28656097334):
TlsHandshakeFeatureTests.SetsTlsHandshakeFeatureForHttpseven though its tracking issue Quarantine SetsTlsHandshakeFeatureForHttps #49306 carries there-quarantinelabel (must never be auto-unquarantined).TestServerTests.WebSocketsWorksdespite maintainer "do not quarantine" comments on the already-rejected [test-quarantine] Re-Quarantine TestServerTests.WebSocketsWorks #67443 and [test-quarantine] Re-Quarantine TestServerTests.WebSocketsWorks #67415.Root causes
re-quarantineissue label the maintainer set.search_pull_requests, whose DIFC integrity filter silently drops PRs authored by the workflow's own bot (app/github-actions) — so the maintainer comments on [test-quarantine] Re-Quarantine TestServerTests.WebSocketsWorks #67443/[test-quarantine] Re-Quarantine TestServerTests.WebSocketsWorks #67415 were never seen.Fix
Two new deterministic pre-activation steps (Python over the GitHub REST API, full token, bypassing MCP filtering) inject JSON into the agent prompt, and two body guardrails now consume it:
requarantine_issue_numbers— every issue labeledre-quarantine. The unquarantine guardrail gains an authoritative check (a): if a candidate's[QuarantinedTest]issue number is in this set, it is permanently skipped (fail-closed if the data is missing). The old diff-parse check remains as check (b).closed_quarantine_prs— closed-but-unmerged[test-quarantine]PRs from the last 30 days, each withtitle,body, and trusted-author comments. The closed-PR guardrail now uses this instead of MCP search, so bot-authored PRs and their maintainer comments are always visible.Review feedback applied: inject the PR
body(grouped PRs don't list every test in the title), filter comments to trustedauthor_associationin the fetch step (shrinks payload + keeps untrusted text out of the prompt), treat injected text as untrusted/non-instruction, and make the fallback path python3/urllib + explicitly fail-closed.Also bumped the gh-aw CLI to v0.81.6 and recompiled the lockfile (
gh-aw-actions/setupv0.80.9 → v0.81.6).Validation
requarantine_issue_numbers→[49306](catches [test-quarantine] Unquarantine TlsHandshakeFeatureTests.SetsTlsHandshakeFeatureForHttps (issue #49306) #67577);closed_quarantine_prssurfaces [test-quarantine] Re-Quarantine TestServerTests.WebSocketsWorks #67443 (wtgodbe/MEMBER) and [test-quarantine] Re-Quarantine TestServerTests.WebSocketsWorks #67415 (BrennanConroy/MEMBER) with their "do not quarantine" comments (catches [test-quarantine] Re-quarantine TestServerTests.WebSocketsWorks (#65914) #67576).closed_quarantine_prsblob is ~10 KB (well under the 131072-byte per-output limit); no chunking needed.gh aw compile→ 0 errors / 0 warnings.Only the
test-quarantineworkflow files change.