You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+39-2Lines changed: 39 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,55 @@
5
5
* Review the `CONTRIBUTING.md` file for instructions to build and test the software.
6
6
* Set the `NBGV_GitEngine` environment variable to `Disabled` before running any `dotnet` or `msbuild` commands.
7
7
8
+
## Environment Setup and Shallow Clone Workaround
9
+
10
+
This repository uses Nerdbank.GitVersioning which depends on git history for version calculation. Since GitHub Copilot Coding Agent operates on shallow clones, you MUST set the following environment variable before running any build commands:
11
+
12
+
```bash
13
+
export NBGV_GitEngine=Disabled
14
+
```
15
+
16
+
**Important**: The environment variable name and value are case-sensitive. This setting:
17
+
- Removes access to git history during builds
18
+
- Allows builds to succeed in shallow clone environments
19
+
- Results in incorrect version stamps (expected in Copilot environment)
20
+
- Still generates the `ThisAssembly` class but with fewer properties
21
+
22
+
## Building and Testing
23
+
24
+
### Initial Setup
25
+
1. Run the initialization script: `./init.ps1` or `pwsh ./init.ps1`
26
+
2. This downloads NuGet.exe, restores packages, and sets up the build environment
27
+
28
+
### Building
29
+
* For a complete build: `./build.ps1` or `pwsh ./build.ps1`
30
+
* Ensure `NBGV_GitEngine=Disabled` is set before building
31
+
* The build process first creates NuGet packages, then builds NPM packages
32
+
33
+
### Testing
34
+
* Run all tests: `dotnet test --filter "TestCategory!=FailsInCloudTest"`
35
+
* The filter excludes unstable tests that are known to fail in cloud environments
36
+
* Tests use the Xunit testing framework
37
+
* All tests should pass when `NBGV_GitEngine=Disabled` is set
38
+
8
39
## Software Design
9
40
10
41
* Design APIs to be highly testable, and all functionality should be tested.
11
42
* Avoid introducing binary breaking changes in public APIs of projects under `src` unless their project files have `IsPackable` set to `false`.
43
+
* Follow existing patterns in the codebase for consistency.
12
44
13
-
## Testing
45
+
## Testing Guidelines
14
46
15
47
* There should generally be one test project (under the `test` directory) per shipping project (under the `src` directory). Test projects are named after the project being tested with a `.Test` suffix.
16
48
* Tests should use the Xunit testing framework.
49
+
* Some tests are known to be unstable. When running tests, you should skip the unstable ones by running `dotnet test --filter "TestCategory!=FailsInCloudTest"`.
50
+
* Write tests that cover both happy path and edge cases.
51
+
* Ensure all new functionality is covered by tests.
17
52
18
-
## Coding style
53
+
## Coding Style
19
54
20
55
* Honor StyleCop rules and fix any reported build warnings *after* getting tests to pass.
21
56
* In C# files, use namespace *statements* instead of namespace *blocks* for all new files.
22
57
* Add API doc comments to all new public and internal members.
58
+
* Follow existing code formatting and naming conventions in the repository.
59
+
* Use meaningful variable and method names that clearly express intent.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ Trigger the pipeline by adding the `auto-release` tag on a run of your main `azu
74
74
75
75
## Tutorial and API documentation
76
76
77
-
API and hand-written docs are found under the `docfx/` directory. and are built by [docfx](https://dotnet.github.io/docfx/).
77
+
API and hand-written docs are found under the `docfx/` directory and are built by [docfx](https://dotnet.github.io/docfx/).
78
78
79
79
You can make changes and host the site locally to preview them by switching to that directory and running the `dotnet docfx --serve` command.
80
80
After making a change, you can rebuild the docs site while the localhost server is running by running `dotnet docfx` again from a separate terminal.
@@ -110,7 +110,7 @@ If Renovate is not creating pull requests when you expect it to, check that the
110
110
### Maintaining your repo based on this template
111
111
112
112
The best way to keep your repo in sync with Library.Template's evolving features and best practices is to periodically merge the template into your repo:
0 commit comments