Skip to content

Commit 19d53e1

Browse files
nkolev92Copilot
andcommitted
Document restore parity guidance
Add reusable instructions for restore bugfixes so future work starts with repro coverage and cross-client parity checks. Co-authored-by: Copilot <[email protected]>
1 parent cf044d8 commit 19d53e1

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717

1818
- All files in the repository are nullable by default (project-level nullable enable). No need to add `#nullable enable` directives to individual files.
1919

20+
## Restore Bugfix Guidance
21+
22+
- For restore bugs involving settings, source resolution, or command-line properties, add repro tests before making the implementation change.
23+
- Preserve restore parity across the main entry points: `nuget.exe`, `dotnet restore`, and `msbuild /t:restore`. If a bug is user-visible in one, check whether the shared restore pipeline affects the others too.
24+
- When testing explicit source inputs (`-Source`, `--source`, `/p:RestoreSources`), cover both direct paths/URLs and named package sources defined in `NuGet.Config`. A source value may be a configured source name, not just a filesystem path.
25+
- Prefer a layered test strategy for restore changes: add fast unit coverage around the shared helper or factory logic first, then add at least one integration/functional regression for the relevant client entry points.
26+
2027
## Nullable Migration Rules
2128

2229
- **Shipped.txt format must be precise** — e.g. `string![]!` not `string![]`, `byte[]?` not `byte?[]`. Always match the format of existing base class entries in the same file.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: restore-entrypoint-parity
3+
description: >
4+
Guides restore bugfixes that can affect more than one NuGet client entry point.
5+
Use when investigating restore settings, source resolution, or command-line property
6+
behavior that may need parity across nuget.exe, dotnet restore, and msbuild restore.
7+
---
8+
9+
# Restore Entrypoint Parity
10+
11+
Use this guidance for NuGet restore issues where the same customer-facing behavior may flow through multiple entry points.
12+
13+
## When to use
14+
15+
Trigger this workflow when the issue mentions any of the following:
16+
17+
- `nuget restore`, `dotnet restore`, or `msbuild /t:restore`
18+
- `-Source`, `--source`, or `/p:RestoreSources`
19+
- `NuGet.Config` source precedence or named sources
20+
- restore settings or property precedence problems
21+
22+
## Workflow
23+
24+
1. Start with failing repro tests before implementation.
25+
2. Check whether the behavior is shared across:
26+
- `nuget.exe`
27+
- `dotnet restore`
28+
- `msbuild restore`
29+
3. Add unit tests around the shared source/settings resolution helpers when possible.
30+
4. Add end-to-end or integration coverage for the user-facing entry points that expose the bug.
31+
32+
## Generic lessons
33+
34+
- Restore bugs that look client-specific are often caused by shared restore infrastructure.
35+
- Explicit source values can represent either a path/URL or a source name from `NuGet.Config`.
36+
- Source resolution should prefer enabled configured source names before treating the input as a relative path.
37+
- Keep existing relative-path behavior covered while fixing named-source scenarios.
38+
39+
## Coverage checklist
40+
41+
- A unit or component test proves the core resolution logic.
42+
- At least one client-facing regression test proves the scenario from the user perspective.
43+
- If the behavior is meant to be consistent across tools, add parity coverage for `nuget.exe`, `dotnet restore`, and `msbuild restore`.

0 commit comments

Comments
 (0)