Skip to content

Move test-quarantine Source B PR selection into a pre-activation step - #67129

Merged
wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/quarantine-source-b-mcp-search
Jun 10, 2026
Merged

wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/quarantine-source-b-mcp-search

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Jun 10, 2026

Copy link
Copy Markdown
Member

Problem

The daily test-quarantine workflow keeps tripping the 25M effective-token rail. The dominant cost is Source B (flaky tests in merged PRs): the firewalled agent verified each candidate PR one-at-a-time via the pull_request_read MCP tool — 77 calls = 77 inference turns in the latest failure, each re-sending the whole conversation. The agent sandbox has no usable GitHub token, and the MCP search_pull_requests tool silently drops external-contributor PRs, so the agent had no safe way to verify PRs itself.

Change

Move the entire Source B build selection (B1–B4) into a deterministic pre-activation step that runs outside the firewall with a real GH_TOKEN:

  1. Enumerate completed ADO PR builds (dnceng-public, definitions 83 & 87, last 7 days), recording each failed/partiallySucceeded build's (buildId, prNumber, sourceSha) (B4).
  2. Batch-verify candidate PRs via GraphQL — base==main (B2), merged==true (B3) — and capture each head SHA.
  3. Keep builds whose commit matches the verified head SHA (B1), and emit the exact list of build IDs (source_b_build_ids).

The agent now only fetches resultsbyBuild for those build IDs — zero GitHub calls, no re-enumeration (so no snapshot skew between the pre-step and the agent). Verification fails loud on auth/rate-limit/any failed GraphQL chunk so the run aborts visibly rather than silently under-reporting.

Frontmatter changed, so .lock.yml is recompiled (gh aw compile).

The daily test-quarantine workflow keeps tripping the 25M effective-token
rail because the firewalled agent verified each candidate PR one-at-a-time
via the pull_request_read MCP tool (77 calls = 77 inference turns in the
latest failure). The agent sandbox has no usable GitHub token, and its MCP
search tool silently drops external-contributor PRs, so it had no safe way
to do this verification itself.

Do the entire Source B build selection (B1-B4) in a deterministic
pre-activation step that runs outside the firewall with a real GH_TOKEN:
enumerate ADO PR builds, batch-verify base==main + merged via GraphQL,
match head SHA, and hand the agent the exact list of build IDs to collect
results from. The agent now makes zero GitHub calls and does not
re-enumerate builds, eliminating both the token sink and any snapshot skew.
Fail-loud on auth/rate-limit/any-failed-chunk so the run aborts visibly
instead of silently under-reporting.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings June 10, 2026 15:06
@wtgodbe
wtgodbe requested a review from a team as a code owner June 10, 2026 15:06
@github-actions github-actions Bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Jun 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces token/inference-turn usage in the daily test-quarantine agentic workflow by moving Source B PR/build selection (B1–B4) out of the firewalled agent sandbox and into a deterministic pre-activation step that can use a real GitHub token. This prevents the previous per-PR GitHub verification loop and avoids snapshot skew by handing the agent an already-filtered list of Azure DevOps build IDs.

Changes:

  • Added a pre-activation step that enumerates failed/partially-succeeded Azure DevOps PR builds (last 7 days), batch-verifies PRs via GitHub GraphQL, matches build commit SHAs to verified PR head SHAs, and emits source_b_build_ids.
  • Updated the Source B instructions to treat source_b_build_ids as authoritative input and to prohibit any GitHub calls / build re-enumeration inside the agent.
  • Recompiled .lock.yml to reflect the updated frontmatter and new pre-activation output wiring.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/test-quarantine.md Adds deterministic pre-activation Source B verification and updates agent instructions to consume injected build IDs only.
.github/workflows/test-quarantine.lock.yml Recompiled workflow lock output to include the new pre-activation step, output propagation, and updated concurrency settings.

@wtgodbe
wtgodbe merged commit fae66ea into dotnet:main Jun 10, 2026
12 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants