Skip to content

Commit 6dde349

Browse files
authored
Add instructions and env setup for Copilot (#4869)
Taken from #4866
1 parent 3dad988 commit 6dde349

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/copilot-instructions.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
## Coding Guidelines
12
- Rules apply to our C# code.
23
- Use function-reflective, descriptive names without implementation details.
4+
- Avoid magic strings and numbers; use constants or configuration.
35
- For multi-task methods, use descriptive names and document the process.
46
- Long method names are acceptable.
7+
- Prefer async/await over Task.Result or .Wait()
58
- Async methods must have an "Async" suffix.
9+
- Use cancellation tokens for async operations when appropriate
610
- Avoid using booleans solely to signal success, unless failure is an expected frequent outcome (e.g. TryGet methods).
711
- Do not return null unless explicitly indicated (e.g., TryCreate).
812
- Validate early; if validation fails, throw or return immediately.
@@ -11,4 +15,28 @@
1115
- Use immutable objects (e.g., records, readonly properties) when possible.
1216
- Never throw generic Exceptions.
1317
- Use structural logging consistently.
14-
- Each method should log its own actions.
18+
- Each method should log its own actions.
19+
- Use nullable reference types and annotate appropriately.
20+
- Follow the AAA (Arrange-Act-Assert) pattern for unit tests.
21+
- Prefer ILogger<T> over ILogger for better context in logs.
22+
- Services should be registered with appropriate lifetimes (singleton, scoped, transient).
23+
24+
## Repository Structure
25+
- `docs/` - Documentation
26+
- `eng/` - Engineering scripts, build tools and pipeline templates
27+
- `src/` - Contains the main source code for arcade services
28+
- `test/` - Test projects and test utilities
29+
- `Microsoft.DotNet.Darc/` - Darc CLI tool for interacting with dependency management services
30+
31+
## Key Technologies
32+
- .NET 8
33+
- Azure DevOps APIs
34+
- ASP.NET Core for web APIs
35+
- Entity Framework Core for data access
36+
- Azure Container Apps for hosting
37+
- .NET Aspire for local development
38+
39+
## Development Environment
40+
- You can restore required .NET and dependencies by calling:
41+
- `./eng/common/build.sh -restore` on Linux/macOS
42+
- `.\eng\common\build.ps1 -restore` on Windows

.github/copilot-setup-steps.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Copilot Setup Steps
2+
3+
# These steps will be executed before GitHub Copilot assists with code
4+
# This helps ensure Copilot has access to properly restored dependencies
5+
6+
steps:
7+
- name: Checkout repository
8+
uses: actions/checkout@v3
9+
with:
10+
fetch-depth: 0
11+
12+
- name: Restore dependencies
13+
run: |
14+
./eng/common/build.sh -restore
15+
shell: bash

0 commit comments

Comments
 (0)