Skip to content

Commit 458c52a

Browse files
authored
⬆️ Bump files with dotnet-file sync
⬆️ Bump files with dotnet-file sync
2 parents dcd119c + fc11aab commit 458c52a

15 files changed

Lines changed: 293 additions & 79 deletions

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ indent_size = 2
3030

3131
# Dotnet code style settings:
3232
[*.{cs,vb}]
33+
tab_width = 4
34+
3335
# Sort using and Import directives with System.* appearing first
3436
dotnet_sort_system_directives_first = true
3537
# Avoid "this." and "Me." if not necessary
@@ -57,6 +59,9 @@ dotnet_style_require_accessibility_modifiers = omit_if_default:error
5759
# IDE0040: Add accessibility modifiers
5860
dotnet_diagnostic.IDE0040.severity = error
5961

62+
# IDE1100: Error reading content of source file 'Project.TargetFrameworkMoniker' (i.e. from ThisAssembly)
63+
dotnet_diagnostic.IDE1100.severity = none
64+
6065
[*.cs]
6166
# Top-level files are definitely OK
6267
csharp_using_directive_placement = outside_namespace:silent

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# normalize by default
22
* text=auto encoding=UTF-8
33
*.sh text eol=lf
4+
*.sbn eol=lf
45

56
# These are windows specific files which we may as well ensure are
67
# always crlf on checkout

.github/copilot-instructions.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# .NET Repository
2+
3+
**Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.**
4+
5+
## Working Effectively
6+
7+
### Essential Build Commands
8+
- **Restore dependencies**: `dotnet restore`
9+
10+
- **Build the entire solution**: `dotnet build`
11+
12+
- **Run tests**: `dnx --yes retest`
13+
- Runs all unit tests across the solution
14+
- If tests fail due to Azure Storage, run the following commands and retry: `npm install azurite` and `npx azurite &`
15+
16+
### Build Validation and CI Requirements
17+
- **Always run before committing**:
18+
* `dnx --yes retest`
19+
* `dotnet format whitespace -v:diag --exclude ~/.nuget`
20+
* `dotnet format style -v:diag --exclude ~/.nuget`
21+
22+
### Project Structure and Navigation
23+
24+
| Directory | Description |
25+
|-----------|-------------|
26+
| `src/` | Contains the repo source code. |
27+
| `bin/` | Contains built packages (if any) |
28+
29+
### Code Style and Formatting
30+
31+
#### EditorConfig Rules
32+
The repository uses `.editorconfig` at the repo root for consistent code style.
33+
34+
- **Indentation**: 4 spaces for C# files, 2 spaces for XML/YAML/JSON
35+
- **Line endings**: LF (Unix-style)
36+
- **Sort using directives**: System.* namespaces first (`dotnet_sort_system_directives_first = true`)
37+
- **Type references**: Prefer language keywords over framework type names (`int` vs `Int32`)
38+
- **Modern C# features**: Use object/collection initializers, coalesce expressions when possible, use var when the type is apparent from the right-hand side of the assignment
39+
- **Visibility modifiers**: only explicitly specify visibility when different from the default (e.g. `public` for classes, no `internal` for classes or `private` for fields, etc.)
40+
41+
#### Formatting Validation
42+
- CI enforces formatting with `dotnet format whitespace` and `dotnet format style`
43+
- Run locally: `dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget`
44+
- Fix formatting: `dotnet format` (without `--verify-no-changes`)
45+
46+
### Testing Practices
47+
48+
#### Test Framework
49+
- **xUnit** for all unit and integration tests
50+
- **Moq** for mocking dependencies
51+
- Located in `src/*.Tests/`
52+
53+
#### Test Attributes
54+
Custom xUnit attributes are sometimes used for conditional test execution:
55+
- `[SecretsFact("XAI_API_KEY")]` - Skips test if required secrets are missing from user secrets or environment variables
56+
- `[LocalFact("SECRET")]` - Runs only locally (skips in CI), requires specified secrets
57+
- `[CIFact]` - Runs only in CI environment
58+
59+
### Dependency Management
60+
61+
#### Adding Dependencies
62+
- Add to appropriate `.csproj` file
63+
- Run `dotnet restore` to update dependencies
64+
- Ensure version consistency across projects where applicable
65+
66+
#### CI/CD Pipeline
67+
- **Build workflow**: `.github/workflows/build.yml` - runs on PR and push to main/rel/feature branches
68+
- **Publish workflow**: Publishes to Sleet feed when `SLEET_CONNECTION` secret is available
69+
- **OS matrix**: Configured in `.github/workflows/os-matrix.json` (defaults to ubuntu-latest)
70+
71+
### Special Files and Tools
72+
73+
#### dnx Command
74+
- **Purpose**: built-in tool for running arbitrary dotnet tools that are published on nuget.org. `--yes` auto-confirms install before run.
75+
- **Example**: `dnx --yes retest` - runs tests with automatic retry on transient failures (retest being a tool package published at https://www.nuget.org/packages/retest)
76+
- **In CI**: `dnx --yes retest -- --no-build` (skips build, runs tests only)
77+
78+
#### Directory.Build.rsp
79+
- MSBuild response file with default build arguments
80+
- `-nr:false` - disables node reuse
81+
- `-m:1` - single-threaded build (for stability)
82+
- `-v:m` - minimal verbosity
83+
84+
#### Code Quality
85+
- All PRs must pass format validation
86+
- Tests must pass on all target frameworks
87+
- Follow existing patterns and conventions in the codebase
88+
89+
## Documenting Work
90+
91+
Project implemention details, design and key decisions should be documented in a top-level AGENTS.md file at the repo root.
92+
Keep this file updated whenever you make change significant changes for future reference.
93+
94+
User-facing features and APIs should be documented to highlight (not extensively, as an overview) key project features and capabilities, in the readme.md file at the repo root.

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ updates:
2424
Extensions:
2525
patterns:
2626
- "Microsoft.Extensions*"
27+
exclude-patterns:
28+
- "Microsoft.Extensions.AI*"
29+
ExtensionsAI:
30+
patterns:
31+
- "Microsoft.Extensions.AI*"
2732
Web:
2833
patterns:
2934
- "Microsoft.AspNetCore*"

.github/workflows/build.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- Release
1313
- Debug
1414
push:
15-
branches: [ main, dev, 'dev/*', 'feature/*', 'rel/*' ]
15+
branches: [ main, 'feature/*', 'rel/*' ]
1616
paths-ignore:
1717
- changelog.md
1818
- readme.md
@@ -66,15 +66,14 @@ jobs:
6666
fetch-depth: 0
6767

6868
- name: ⚙ dotnet
69-
uses: ./.github/actions/dotnet
69+
uses: devlooped/actions-dotnet-env@v1
7070

7171
- name: 🙏 build
7272
run: dotnet build -m:1 -bl:build.binlog
7373

7474
- name: 🧪 test
75-
run: |
76-
dotnet tool update -g dotnet-retest
77-
dotnet retest -- --no-build
75+
shell: pwsh
76+
run: dnx --yes retest -- --no-build
7877

7978
- name: 🐛 logs
8079
uses: actions/upload-artifact@v4
@@ -101,12 +100,7 @@ jobs:
101100
fetch-depth: 0
102101

103102
- name: ⚙ dotnet
104-
uses: actions/setup-dotnet@v4
105-
with:
106-
dotnet-version: |
107-
6.x
108-
8.x
109-
9.x
103+
uses: devlooped/actions-dotnet-env@v1
110104

111105
- name: ✓ ensure format
112106
run: |

.github/workflows/dotnet-env.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: dotnet-env
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**/*.*proj'
9+
10+
jobs:
11+
which-dotnet:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
steps:
18+
- name: 🤖 defaults
19+
uses: devlooped/actions-bot@v1
20+
with:
21+
name: ${{ secrets.BOT_NAME }}
22+
email: ${{ secrets.BOT_EMAIL }}
23+
gh_token: ${{ secrets.GH_TOKEN }}
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: 🤘 checkout
27+
uses: actions/checkout@v4
28+
with:
29+
token: ${{ env.GH_TOKEN }}
30+
31+
- name: 🤌 dotnet
32+
uses: devlooped/actions-which-dotnet@v1
33+
34+
- name: ✍ pull request
35+
uses: peter-evans/create-pull-request@v7
36+
with:
37+
base: main
38+
branch: which-dotnet
39+
delete-branch: true
40+
labels: dependencies
41+
title: "⚙ Update dotnet versions"
42+
body: "Update dotnet versions"
43+
commit-message: "Update dotnet versions"
44+
token: ${{ env.GH_TOKEN }}

.github/workflows/includes.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ on:
55
branches:
66
- 'main'
77
paths:
8-
- '**.md'
8+
- '**.md'
99
- '!changelog.md'
10+
- 'osmfeula.txt'
1011

1112
jobs:
1213
includes:
@@ -31,14 +32,33 @@ jobs:
3132
- name: +Mᐁ includes
3233
uses: devlooped/actions-includes@v1
3334

35+
- name: 📝 OSMF EULA
36+
shell: pwsh
37+
run: |
38+
$file = "osmfeula.txt"
39+
$props = "src/Directory.Build.props"
40+
if (-not (test-path $file) -or -not (test-path $props)) {
41+
exit 0
42+
}
43+
44+
$product = dotnet msbuild $props -getproperty:Product
45+
if (-not $product) {
46+
write-error 'To use OSMF EULA, ensure the $(Product) property is set in Directory.props'
47+
exit 1
48+
}
49+
50+
((get-content -raw $file) -replace '\$product\$',$product).trim() | set-content $file
51+
3452
- name: ✍ pull request
35-
uses: peter-evans/create-pull-request@v6
53+
uses: peter-evans/create-pull-request@v8
3654
with:
37-
add-paths: '**.md'
55+
add-paths: |
56+
**.md
57+
*.txt
3858
base: main
3959
branch: markdown-includes
4060
delete-branch: true
41-
labels: docs
61+
labels: dependencies
4262
author: ${{ env.BOT_AUTHOR }}
4363
committer: ${{ env.BOT_AUTHOR }}
4464
commit-message: +Mᐁ includes

.github/workflows/publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ jobs:
2828
fetch-depth: 0
2929

3030
- name: ⚙ dotnet
31-
uses: ./.github/actions/dotnet
31+
uses: devlooped/actions-dotnet-env@v1
3232

3333
- name: 🙏 build
3434
run: dotnet build -m:1 -bl:build.binlog
3535

3636
- name: 🧪 test
37-
run: |
38-
dotnet tool update -g dotnet-retest
39-
dotnet retest -- --no-build
37+
shell: pwsh
38+
run: dnx --yes retest -- --no-build
4039

4140
- name: 🐛 logs
4241
uses: actions/upload-artifact@v4

.github/workflows/triage.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ jobs:
4949
# if we don't have at least 100 requests left, wait until reset
5050
if ($rate.remaining -lt 100) {
5151
$wait = ($rate.reset - (Get-Date (Get-Date).ToUniversalTime() -UFormat %s))
52-
echo "Rate limit remaining is $($rate.remaining), waiting for $($wait / 1000) seconds to reset"
52+
if ($wait -gt 300) {
53+
echo "Rate limit remaining is $($rate.remaining), reset in $wait seconds (more than 5'). Aborting."
54+
exit 1
55+
}
56+
echo "Rate limit remaining is $($rate.remaining), waiting $wait seconds to reset"
5357
sleep $wait
5458
$rate = gh api rate_limit | convertfrom-json | select -expandproperty rate
5559
echo "Rate limit has reset to $($rate.remaining) requests"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ BenchmarkDotNet.Artifacts
1111
.genaiscript
1212
.idea
1313
local.settings.json
14+
.env
15+
*.local
1416

1517
*.suo
1618
*.sdf

0 commit comments

Comments
 (0)