Skip to content

Add repository-local code-review-test-trigger-map Copilot review skill - #19942

Draft
Ankit Jain (radical) with Copilot wants to merge 2 commits into
mainfrom
copilot/create-github-copilot-review-skill
Draft

Add repository-local code-review-test-trigger-map Copilot review skill#19942
Ankit Jain (radical) with Copilot wants to merge 2 commits into
mainfrom
copilot/create-github-copilot-review-skill

Conversation

Copilot AI commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Description

Extracts the specialized test-trigger-map review guidance out of broad agent instructions into a focused, on-demand Copilot code review skill, and adds a curated evaluation corpus. PR #19939 motivated this: the two defects found there (an over-broad src/*/api/** skip glob, and a removed ATS route whose replacement test only asserted NotEmpty) are exactly the failure modes this subsystem produces, and they were buried in a paragraph of general review instructions.

New skill

  • .github/skills/code-review-test-trigger-map/SKILL.md — frontmatter description names the activation triggers (eng/github-ci/test-trigger-map.yml, eng/github-ci/ci-skip-entirely-patterns.txt, tools/SelectTests/**, workflow gates / reusable workflows / run_* outputs, loose CI inputs, test project add/remove/rename), so Copilot loads it only on those diffs.
  • The body is a 7-step procedure, not a copy of the handbook: classify each changed input (Layer 1 / Layer 2 / ALL / prefiltered / dedicated workflow / no consumer) → trace the real consumer → verify narrowest-complete additive routing and end-to-end run_* wiring → evaluate glob semantics literally → weigh under- vs over-selection → require exact-invariant regression tests → post only high-confidence, diff-anchored findings naming path, consumer, target, and regression scenario. Authoritative details stay in docs/ci/test-trigger-map.md and docs/ci/test-trigger-selector-design.md.

Guidance moved

  • The detailed "Conditional Test Selection" block in AGENTS.md and its duplicate in .agents/skills/code-review/SKILL.md are replaced by short pointers. No requirement dropped.

Evaluation

  • evals/cases.json — 5 cases with expected findings, expected non-findings, and required evidence per finding: both PR Skip CI entirely for API/ATS baseline-only PRs #19939 defects, a Layer 1-owned true negative (the most likely false positive: demanding a manual rule for an ordinary ProjectGraph input), a workflow/run_* gate case, and an over-selection case.
  • evals/README.md — separates the two halves explicitly: the automated tests are structural only; semantic quality is scored manually via skill attribution plus recall/precision/evidence/duplication over the corpus, with success criteria.
  • tests/Infrastructure.Tests/TestTriggerMap/ReviewSkillTests.cs — 13 tests for skill discoverability, frontmatter, trigger coverage, corpus schema, defect-class coverage, and the map routing below.

CI routing (dogfooding)

eng/github-ci/test-trigger-map.yml routes .github/skills/** to test:Infrastructure.Tests and adds a keep_routed carve-out — without it the prefilter's **.md would drop SKILL.md before both layers and the verifier would never run:

$ dotnet run --project tools/SelectTests -- --changed-files <SKILL.md> --skip-layer1
Unattributed changed files (0)
Selected PR test projects: 1 / 99  ->  Infrastructure.Tests

Validation: Infrastructure.Tests.TestTriggerMap 198/198 green; markdownlint clean.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Copilot AI balanced review requested due to automatic review settings September 4, 2026 18:48

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.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

…ests

Co-authored-by: radical <1472+radical@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 18:59
Copilot AI changed the title [WIP] Create specialized code review skill for Aspire Add repository-local code-review-test-trigger-map Copilot review skill Sep 4, 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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment on lines +164 to +167
var corpus = JsonSerializer.Deserialize<EvalCorpus>(stream, new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
});
Comment on lines +181 to +185
Assert.StartsWith("---\n", text, StringComparison.Ordinal);
var end = text.IndexOf("\n---", 3, StringComparison.Ordinal);
Assert.True(end > 0, "SKILL.md has no closing frontmatter delimiter.");

var yaml = text[4..end];
Comment on lines +95 to +97

Assert.Contains("test:Infrastructure.Tests", targets);
Assert.Contains(".github/skills/**", map.Prefilter!.KeepRouted);
Copilot stopped reviewing on behalf of Ankit Jain (radical) due to an error September 4, 2026 19:21
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19942

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19942"

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Tests selector

1 / 99 PR test projects · 0 PR jobs · 0 advisory-only targets, from 5 changed files.

Selected PR test projects (1 / 99)

Infrastructure.Tests

Selected PR jobs (0)

none

Advisory workflow impact (0)

none


How these were chosen — grouped by what changed

📄 .github/skills/code-review-test-trigger-map/SKILL.md (changed)
1 directly: Infrastructure.Tests

📄 .github/skills/code-review-test-trigger-map/evals/README.md (changed)
1 directly: Infrastructure.Tests

📄 .github/skills/code-review-test-trigger-map/evals/cases.json (changed)
1 directly: Infrastructure.Tests

📄 eng/github-ci/test-trigger-map.yml (changed)
1 directly: Infrastructure.Tests

🧪 tests/Infrastructure.Tests/TestTriggerMap/ReviewSkillTests.cs (changed test)
1 directly: Infrastructure.Tests

Job reasons

none


Selection computed for commit 12322b0.

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