Repository navigation
[copilot] Improve test and NuGet guidance - #13817
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the documentation-only guidance changes.
No open issues 🎉
What changed in this PR
This documentation-only PR builds on #13778 to make “no new tests by default” explicit across dotnet/android’s agent and review guidance, aiming to reduce redundant tests and review churn. It does not change SDK or runtime code.
Changes:
- Limits new tests to one high-value case when requested or needed to protect a real regression, and aligns reviewer and Java.Interop guidance.
- Reinforces keeping unrelated cleanups separate and respecting earlier user decisions.
- Advises omitting
--no-restorein fresh worktrees and scratch projects to avoid missing-assets errors.
| File | Description |
|---|---|
.github/workflows/android-reviewer.md |
Removes missing tests from default priorities and limits test requests. |
.github/skills/tests/SKILL.md |
Adds restore guidance for fresh worktrees and scratch projects. |
.github/skills/code-review/references/testing-rules.md |
Discourages low-value tests and default coverage requests. |
.github/instructions/java-interop.instructions.md |
Defers new-test decisions to the top-level rule while preserving existing tests. |
.github/copilot-instructions.md |
Establishes the no-new-tests default and reinforces scope discipline. |
Review effort: Balanced
Local agent sessions access nuget.org directly even when the repository uses Azure DevOps feeds, triggering blocked-access notifications. Point package lookups and tool installs at the approved feeds and isolate scratch restores from inherited sources. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Distinguish test commands from scratch project creation, which suppresses its initial restore before using the repository NuGet configuration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@dalexsoto review |
|
Reviewed the Markdown-only guidance changes:
|
dalexsoto
left a comment
There was a problem hiding this comment.
Reviewed the seven changed guidance files, related agent/skill instructions, NuGet configuration, and the generated reviewer workflow integration. The workflow loads the updated Markdown at runtime, and the testing and package-source guidance remains consistent with the accepted policy. No blocking issues found. Static review only; no builds or tests were run.
…13886) Context: #13817 A review of about 110 recent local agent sessions in this repo found three recurring wastes that the agent instructions either didn't cover or got wrong. ### Backports One backport to `release/11.0` cost about 30% of the reviewed agent spend. The agent ported main-only renames, refactors, a C# rewrite of native logic, and new tests. The user then had to remove them over several rounds. "Keep it simple" now adds: backports port only the fix, keeping the target branch's design, names, and native code, with no main-only refactors or new tests. ### Parallel builds After a coordinator asked about 70 sessions to rebase onto main, many started full `make prepare && make leeroy` builds at once. One session reported free disk space dropping from 67 GiB to 47 GiB within minutes. Sessions then made up a disk-space "admission" rule and polled for it: about 150 `df` and 110 `ps` checks across about 20 sessions. The `local-build` parallel-sessions guidance now says: * Prefer per-project rebuilds or an existing SDK. * Start a build once and wait on its process or log. * Don't poll `df`/`ps` in sleep loops, and don't broadcast disk or admission rules to other sessions. This section is one line shorter. ### Standalone test command `global.json` selects Microsoft.Testing.Platform, so `dotnet test <project>.csproj` fails: global.json defines test runner to be Microsoft.Testing.Platform. All projects must use that test runner. The following test projects are using VSTest test runner: ... The `tests` skill and its catalog now use `dotnet test --project <project>.csproj`. Net change across the four instruction files: −1 line. Validation: documentation-only, so nothing was built or tested. The `--project` form was confirmed by an agent session after the MTP migration: 142 tests passed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
02cf2aea43b49cdb4c0207dca85795ddd90fe32b↑ Markdown diff passes whitespace checks.
↓ Agent behavior, including the reviewer workflow, remains unverified.
Context: #13778
A review of the last two days of local agent sessions found that agents in more than 12 sessions added tests that the maintainer later asked to delete. The deleted tests were overfitted to the implementation, flaky, or redundant, and each removal cost extra review turns and device-test reruns. Three sources pushed agents to add these tests:
android-reviewerworkflow listed "missing tests" as a review priority above duplication. On one PR it asked for three sets of on-device tests, and the maintainer then trimmed them to one.The guidance from #13778 rated tests by value but did not override these defaults, so agents still added tests by default. The instructions now say:
android-reviewer, and thecode-reviewskill's testing rules) request a test only for an unprotected real regression, and never as a default.Other recurring issues:
testsskill now says to omit--no-restorefrom test commands in new worktrees and scratch projects. That flag caused about 60 NETSDK1004 build failures across 19 sessions.dotnet-public, and explicitly restore scratch projects with that config.Net change: +17/−10 lines. The
android-reviewer.lock.ymlfile loadsandroid-reviewer.mdat runtime, so it does not need to be recompiled.Validation:
git diff --check 54d669a53937974a4b0c433f3ea4f06d03bff0df...HEAD— passed.dotnet nuget list source --configfile "$PWD/NuGet.config"— passed; only the repository's Azure DevOps feeds are listed.dotnet package search binlogtool --exact-match --prerelease --source 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json' --format json— passed;dotnet-publicreturned package versions.