Skip to content

Make test-quarantine evidence collection deterministic - #70079

Merged
wtgodbe merged 2 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/fix-quarantine-analysis-reliability
Oct 28, 2026
Merged

wtgodbe merged 2 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/fix-quarantine-analysis-reliability

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Oct 28, 2026

Copy link
Copy Markdown
Member

Summary

Fix the upstream reliability gaps behind test-quarantine runs 169 and 168. Their fail-closed report_incomplete conclusions were correct; this preserves those semantics rather than hiding incomplete analysis.

  • Verify each exact historical Case B tracking issue in authenticated, trusted pre-activation code. Cache the lookup, accept open or closed issues, reject pull requests/mismatches, retry transient errors, and require case_b_issue_verified when validating a re-quarantine patch. The agent no longer needs to repeat existence confirmation through integrity-filtered MCP reads or its failing TLS fallback.
  • Collect all 30 days of main-branch completed builds and paginated test results for pipelines 84 and 87 before activation. Resolve source targets with the existing parser and history helpers; preserve exact theory rows and separate pipeline denominators. Produce compact candidates and collection counts so the agent cannot skip raw Part 2 collection to conserve its turn budget.
  • Require complete, identity-bound Part 2 evidence, including the history receipt's SHA-256, before privileged output processing. Removals must match an exact eligible source target and issue, in addition to the existing first-quarantine and patch checks.

The collector retains the 60-day age, zero-failure/real-pass, 66% build-appearance, re-quarantine, human suppression, sentinel, and source exclusion gates. Class/assembly checks include combined attribute lists, and suppression matching does not merge unrelated classes sharing a method name. Uncertain re-quarantine ownership for the same issue/file remains conservative; truncated diffs block the whole file.

Validation

  • Existing source/history collector fixtures.
  • 17 new collector/issue-verification tests covering pagination, failed collection, empty-but-complete results, per-pipeline denominators, skips/failures/age/appearance, exact theory rows, class/assembly completeness, IIS variants, suppression, re-quarantine PR scope, and receipt-backed removals.
  • Existing pull-request patch validator fixtures, with new missing/incomplete/hash-mismatched Part 2 cases.
  • Existing workflow policy and JavaScript KBE handler fixtures.
  • Baseline-versus-patched checks at the actual patch boundary: the old validator accepts unverified Case B issue reuse and an unquarantine patch without passing evidence; the patched validator rejects both.
  • Regression cases reproduced the review findings before correction and passed afterward.
  • Live, read-only Azure DevOps payload smoke checks for both pipelines.
  • Strict compilation and lockfile regeneration with the existing gh-aw v0.92.0 toolchain. The lockfile was generated, not manually edited.

Two independent reviewers examined the implementation, then approved the corrected findings in follow-up review.

Boundary

No live quarantine outputs or repository variables were changed. A complete scheduled/staged Actions run is not exercised locally; CI and the first post-merge run still need to validate end-to-end operation. Pre-activation now does the Part 2 API work and one additional source-index scan, so its runtime should be monitored.

Verify original Case B tracking issues before activation and collect complete Part 2 pipeline evidence deterministically. Require bound eligibility receipts when validating unquarantine patches.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 21:55
@wtgodbe
wtgodbe requested a review from a team as a code owner October 28, 2026 21:55

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.

🟡 Changes recommended

The collector can miss method-wide and declaring-method suppressions and reject healthy inherited test overrides, producing incorrect unquarantine eligibility decisions.

3 open issues
What changed in this PR

Moves test-quarantine evidence collection into deterministic pre-activation code, reducing agent-dependent API work while preserving fail-closed validation.

Changes:

  • Verifies original Case B tracking issues before allowing re-quarantine.
  • Collects passing-test evidence for pipelines 84 and 87 and computes unquarantine eligibility.
  • Requires identity-bound eligibility receipts for removals and adds regression coverage.
File Description
.github/​workflows/​test-quarantine.md Adds pre-activation collection and receipt-based agent instructions.
.github/​workflows/​test-quarantine.lock.yml Regenerates workflow wiring for the new collector and output.
.github/​workflows/​scripts/​test-quarantine/​validate_pull_request_outputs.py Requires verified Case B issues and bound removal evidence.
.github/​workflows/​scripts/​test-quarantine/​test_workflow_policy.py Updates mandatory Part 2 analysis wording checks.
.github/​workflows/​scripts/​test-quarantine/​test_validate_pull_request_outputs.py Tests missing, incomplete, and mismatched eligibility evidence.
.github/​workflows/​scripts/​test-quarantine/​test_collect_unquarantine_eligibility.py Adds collector, suppression, issue-verification, and validation tests.
.github/​workflows/​scripts/​test-quarantine/​test_collect_case_a_eligibility.py Updates fixtures for issue verification and introduction timestamps.
.github/​workflows/​scripts/​test-quarantine/​README.md Documents collection, receipt requirements, and test commands.
.github/​workflows/​scripts/​test-quarantine/​collect_unquarantine_eligibility.py Collects paginated results and determines eligible removal targets.
.github/​workflows/​scripts/​test-quarantine/​collect_case_a_eligibility.py Adds test-method classification, history timestamps, and cached issue verification.

Review effort: Balanced

Resolve inherited test overrides to effective method identities and exclude abstract assembly runners. Honor method-wide and declaring-method suppressions without conflating distinct theory rows.

Co-authored-by: Copilot <[email protected]>

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.

🔵 Needs a closer look

Unquarantine eligibility can incorrectly exclude healthy tests because unresolved-source checks match unrelated tests by method name and PR suppression checks accept partial method-name matches.

No open issues 🎉

2 previously missed issues

In code that hasn't changed since last review

Medium severity Enforce method-name boundaries in trusted PR suppression

.github/​workflows/​scripts/​test-quarantine/​collect_unquarantine_eligibility.py:240

The substring check bypasses the boundary-aware method patterns below. For an unparameterized Example.CurrentTests.Check, a trusted closed PR naming only Example.CurrentTests.CheckOther suppresses the healthy target as well. Apply identifier boundaries here so suppression of a different method does not remove this target from the eligibility receipt.

Medium severity Limit unresolved source veto to matching test identities

.github/​workflows/​scripts/​test-quarantine/​collect_unquarantine_eligibility.py:308

This veto compares only the leaf method name across both pipelines. A fully passing Example.CurrentTests.Check is excluded as unresolved-test-source when a historical result for an unrelated, now-deleted Example.DeletedTests.Check cannot resolve. Restrict this check to unresolved runtime/source identities that could belong to the target, including supported inherited and IIS aliases, rather than every test sharing its method name.

3 resolved since last review

Review effort: Balanced

@wtgodbe
wtgodbe merged commit 8ab93f8 into dotnet:main Oct 28, 2026
14 checks passed
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 28, 2026 23:34 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 28, 2026 23:34 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 28, 2026 23:35 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 28, 2026 23:36 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 28, 2026 23:37 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool October 28, 2026 23:38 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 2%

No docs needed: the PR is repository automation/CI only (test-quarantine workflow evidence collection).

Documentation surfaces considered

  • Conceptual article: Not required — Changes limited to .github/workflows test-quarantine scripts, tests, and lockfile; no user-facing behavior.
  • Migration guidance: Not required — No upgrade action for app developers; repository automation only.
  • Breaking change: Not required — No API, default, or behavior compatibility impact; signals showed no_signal.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 9434661d Deployed Oct 28, 2026 by wtgodbe via conclusion #117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants