Improve Copilot validation guidance for multi-target and shared-artifact builds
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- developer-experience, documentation
Research direction
Start in .github/copilot-instructions.md under the ## Running tests section and review the existing area build guidance. Update the instructions to cover declared target frameworks, serialized validation for shared artifacts, targeted-first escalation, and reporting unvalidated boundaries. Done means the repository-specific guidance is clear without changing build scripts, CI, or target frameworks.
Written by the indexing model from the issue text.
Description
Summary
Improve .github/copilot-instructions.md with repository-specific validation guidance for multi-target projects, shared build artifacts, and targeted-versus-area validation.
Motivation and goals
A retrospective across recent dotnet/aspnetcore agent sessions found three recurring sources of avoidable validation friction:
- A change was validated only on a modern target framework before CI found
net472compatibility failures (Enum.IsDefined<TEnum>andOperatingSystem.IsWindows/IsLinux) in #69584. Another recent Identity task encountered separate .NET Framework-specific SourceLink/MSBuild behavior. - Concurrent builds/tests that shared the repository
artifactstree produced transient file-lock andCS2012failures. Serial execution, including/m:1when necessary, passed immediately. - Broad area build scripts failed on unrelated prerequisites such as absent googletest sources, Blazor JavaScript/template packages, or other generated assets, while targeted project builds faithfully covered the changed managed surface.
The goal is to help Copilot agents choose validation that is complete across declared target frameworks, deterministic around shared outputs, and proportional to the changed surface.
In scope
- Require inspection of
TargetFrameworksand compilation of every declared target that is buildable in the current environment before opening or undrafting a pull request. - Prevent concurrent
dotnet build/dotnet testinvocations when project graphs share the repository artifacts tree, with serial/m:1recovery guidance for shared-output locks. - Direct agents to begin with the smallest faithful project validation and escalate to area scripts when broader integration coverage is relevant.
- Require explicit reporting of target frameworks or broader validation boundaries that could not be exercised.
Out of scope
- Changing repository build scripts, target frameworks, CI configuration, or artifact layout.
- Treating every broad-build failure as unrelated; agents must still determine whether the missing prerequisite is required by the changed behavior.
- Adding a repository-wide rule for manually mapping long test lists to annotations. That caused a mistake in #69584, but the retrospective did not find recurrence in other recent sessions, so it is not yet supported as a durable repository instruction.
- Changing the existing requirement to activate the repository .NET environment before running
dotnetcommands.
Risks / unknowns
- “Every declared target” must remain qualified by what can be built in the current environment; otherwise agents may spend time attempting unsupported platform-specific targets.
- Targeted validation must not become an excuse to skip required area-level or end-to-end coverage. The proposed wording explicitly requires escalation when broader integration coverage is relevant.
- Some invocations may be safe in parallel when outputs are isolated. The guidance should prohibit only project graphs sharing the repository artifacts tree and allow verified isolated/no-build invocations.
- The current instruction that says to use each area’s
build.shmay appear to conflict with targeted-first validation. The wording should clarify validation order rather than remove area-script expectations.
Examples
Proposed additions under ## Running tests in .github/copilot-instructions.md:
* Start validation with the smallest project build/test that faithfully covers the changed surface, then escalate to the area build script when its broader integration coverage is required. If an area script fails only because an unrelated native submodule, generated asset, or package prerequisite is absent, record that boundary and continue with targeted project validation; do not repeatedly rerun or provision unrelated prerequisites unless the changed behavior depends on them.
* When a changed project declares multiple target frameworks, inspect its `TargetFrameworks` and compile every declared target that can be built in the current environment before opening or undrafting a pull request. A successful build or test run for only the newest target does not establish compatibility with `net4xx` or other declared targets; explicitly report any target that could not be validated.
* Do not run `dotnet build` or `dotnet test` concurrently for project graphs that share the repository artifacts tree. Run them sequentially, or use a verified isolated/no-build invocation; when a shared-output file lock occurs, retry the smallest targeted command serially (use `/m:1` for MSBuild when needed) before treating it as a product failure.
A typical agent workflow after this change would be:
- Inspect the changed project’s declared target frameworks.
- Build/test the smallest projects that faithfully cover the change, serializing invocations that share outputs.
- Compile every locally buildable declared target.
- Escalate to the area script when integration coverage is required.
- Report unsupported targets or unrelated prerequisite boundaries explicitly.
- Dominant language
- C#
- Stars
- 38.5k
- Forks
- 12.5k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 243
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/aspnetcore
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
dotnet/aspnetcore#69604 ·
Maintainers usually reply within 1 day
-
design-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/aspnetcore#69592 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dotnet/aspnetcore#69591 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/aspnetcore#69590 ·
Maintainers usually reply within 1 day
-
design-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dotnet/aspnetcore#69589 ·
Maintainers usually reply within 1 day
All issues in dotnet/aspnetcore
Similar issues
-
copilot documentation
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
[Rust][Flaky Test] multiple_deadlines_fire_in_order asserts a wall-clock gap instead of firing orderOpenCI/CD ⚒️ Flaky-tests 🐦
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
valkey-io/valkey-glide#7255 ·
Maintainers usually reply within 3 days
-
bug good first issue
Difficulty 1/5 Under an hour Newbie friendliness 92/100
unoplatform/Uno.Core#99 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
aws/aws-dotnet-ai#75 ·