Skip to content

MT reviewer: flag missing tests for substantive migrations - #14086

Merged
jankratochvilcz merged 1 commit into
dotnet:mainfrom
jankratochvilcz:jan/mt-reviewer-test-coverage-check
Jun 17, 2026
Merged

MT reviewer: flag missing tests for substantive migrations#14086
jankratochvilcz merged 1 commit into
dotnet:mainfrom
jankratochvilcz:jan/mt-reviewer-test-coverage-check

Conversation

@jankratochvilcz

Copy link
Copy Markdown
Contributor

Problem

The MT migration reviewer (Step 4) only validated tests that were present in the PR. It never flagged the absence of tests when the migration is substantive — i.e., when TaskEnvironment actively flows through CWD-sensitive call chains (e.g., Path.GetFullPath(env.GetAbsolutePath(...))).

This meant the reviewer could approve a substantive migration with zero test coverage for the MT-specific behavior, missing regressions like accidentally reverting to TaskEnvironment.Fallback.

Fix

Step 4 now:

  1. Classifies the migration as attribute-only (no CWD-sensitive leaves) vs substantive (TaskEnvironment flows through path-resolving code).
  2. Requires a Pattern A (decoy-CWD) or Pattern B (cross-instance ProjectDirectory divergence) test for substantive migrations, raising MAJOR if absent.
  3. Still does not demand tests for attribute-only migrations with a clean audit.

Also clarifies the "Does NOT Do" section to explicitly state the converse condition.

Step 4 previously only validated tests that were present in the PR.
It never flagged the complete absence of tests when the migration is
substantive (TaskEnvironment actively flows through CWD-sensitive paths).

This led to reviews approving substantive migrations without any test
that would catch a regression (e.g., reverting to TaskEnvironment.Fallback).

Now Step 4 first classifies the migration as attribute-only vs substantive,
and raises MAJOR when a substantive migration has no decoy-CWD or
cross-instance-divergence test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 17, 2026 13:27

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

Updates the MT migration reviewer agent guidance to explicitly distinguish “attribute-only” vs “substantive” migrations and to require MT-specific tests only when the migration meaningfully flows TaskEnvironment through CWD-sensitive code paths.

Changes:

  • Refines Step 4 to classify migrations as attribute-only vs substantive based on whether TaskEnvironment is actually used in hazard-relevant call chains.
  • Requires a Pattern A/Pattern B regression test for substantive migrations (flags MAJOR if absent), while keeping attribute-only migrations test-optional when the audit is clean.
  • Clarifies the “Does NOT Do” section to reflect the new substantive-vs-attribute-only test expectation.

Comment thread plugins/mt-migration/agents/mt-migration-reviewer.agent.md
@jankratochvilcz
jankratochvilcz enabled auto-merge (squash) June 17, 2026 13:32
@jankratochvilcz
jankratochvilcz merged commit 1a1ec46 into dotnet:main Jun 17, 2026
20 of 21 checks passed
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.

3 participants