Skip to content

Test Quality Review on PR (on open / sync) #2066

Test Quality Review on PR (on open / sync)

Test Quality Review on PR (on open / sync) #2066

Agentic Workflow file for this run

---
name: "Test Quality Review on PR (on open / sync)"
description: >-
Automatically reviews changed tests and parallelization configuration when a
non-draft PR is opened, reopened, marked ready-for-review, or pushed to.
Grades new and modified test methods, audits cross-test parallel-safety, and
publishes one consolidated COMMENT review with apply-ready inline suggestions
when findings exist. Clean automatic runs are silent.
# Triggers:
# - pull_request `opened` / `reopened` / `ready_for_review` — initial
# review on the PR's first appearance as a non-draft.
# - pull_request `synchronize` — re-review when new commits are pushed so the
# result stays current. Combined with `paths` and
# `concurrency.cancel-in-progress` so superseded runs are cancelled.
#
# The repository-root Directory.Build files are included because
# test/Directory.Build.props imports them. A change there can enable or widen
# parallel execution for every test assembly without touching a test method.
#
# The companion `/review-tests` slash command lives in `test-reviewer.agent.md`.
# They must remain separate workflows because mixing `slash_command` with
# other triggers makes gh-aw's activation gate always require a command
# position match, silently skipping the agent on every `pull_request`
# invocation.
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- "test/**"
- "Directory.Build.props"
- "Directory.Build.targets"
- "Directory.Packages.props"
# Skip draft PRs and OneLocBuild localization check-in PRs (authored by
# dotnet-bot) — only run for human-authored PRs in a reviewable state.
if: >
github.event.pull_request.draft == false
&& !(
github.event.pull_request.user.login == 'dotnet-bot'
&& startsWith(github.event.pull_request.title, 'Localized file check-in')
)
permissions:
contents: read
pull-requests: read
copilot-requests: write
imports:
- shared/test-reviewer-shared.md
# The combined review includes a bounded parallel-safety specialist task in
# addition to per-test grading, so retain the same per-run headroom as the broad
# expert review while keeping this workflow scoped to test/configuration changes.
max-ai-credits: 2000
# This replaces two automatic workflows that each carried a 20K daily allowance.
# Preserve their aggregate admission capacity so consolidation does not halve
# throughput on busy PR days (see issues #9086 and #9053).
max-daily-ai-credits: 40K
safe-outputs:
report-failure-as-issue: false
messages:
footer: "> 🤖 **Automated content by GitHub Copilot.** Generated by the [{workflow_name}]({agentic_workflow_url}) workflow.{ai_credits_suffix} · [◷]({history_link})"
noop:
report-as-issue: false
concurrency:
group: test-quality-review-${{ github.event.pull_request.number }}
cancel-in-progress: true
timeout-minutes: 40
---
<!-- Body provided by shared/test-reviewer-shared.md -->