Skip to content

Commit c537ba1

Browse files
committed
⬆️ Bump files with dotnet-file sync
# devlooped/oss
1 parent 43fef7c commit c537ba1

File tree

5 files changed

+112
-9
lines changed

5 files changed

+112
-9
lines changed

.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/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"

.netconfig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@
8181
sha = 0683ee777d7d878d4bf013d7deea352685135a05
8282
[file "src/Directory.Build.props"]
8383
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props
84-
etag = bca64456d4e2cd05375a72b6de376b2c51edf6ad49029aa9a729f4a349a54656
84+
etag = bd05f9f240823c0ac79ddfefe654061550c36f82dd94fa513b82900e92686a5f
8585
weak
8686
sha = 4b84c540df6f37c30fb38df7947d79871c34f036
8787
[file "src/Directory.Build.targets"]
8888
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets
89-
etag = 09ce6b3f9521f8eedc44b77e7b7eaf90bf5df36e1ffb7f78ca27658812180977
89+
etag = 907682e5632a2ba430357e6e042a4ca33cb8c94a3a215d3091aa03f5958a4877
9090
weak
9191
sha = 4b84c540df6f37c30fb38df7947d79871c34f036
9292
[file "src/kzu.snk"]
@@ -130,7 +130,7 @@
130130
[file ".github/workflows/triage.yml"]
131131
url = https://github.com/devlooped/oss/blob/main/.github/workflows/triage.yml
132132
sha = 33000c0c4ab4eb4e0e142fa54515b811a189d55c
133-
etag = 013a47739e348f06891f37c45164478cca149854e6cd5c5158e6f073f852b61a
133+
etag = 152cd3a559c08da14d1da12a5262ba1d2e0ed6bed6d2eabf5bd209b0c35d8a75
134134
weak
135135
[file ".github/workflows/dotnet-file-core.yml"]
136136
url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file-core.yml
@@ -156,3 +156,7 @@
156156
[file "oss.cs"]
157157
url = https://github.com/devlooped/oss/blob/main/oss.cs
158158
skip
159+
[file ".github/copilot-instructions.md"]
160+
url = https://github.com/devlooped/oss/blob/main/.github/copilot-instructions.md
161+
etag = 6ee650d118a57494d3545d54718ccaa5257b09d54504e9c21514fe596edd9678
162+
weak

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
</ItemGroup>
168168

169169
<ItemGroup Label="OSMF" Condition="Exists('$(MSBuildThisFileDirectory)..\osmfeula.txt')">
170-
<None Include="$(MSBuildThisFileDirectory)..\osmfeula.txt" Link="osmfeula.txt" PackagePath="OSMFEULA.txt" />
170+
<Content Include="$(MSBuildThisFileDirectory)..\osmfeula.txt" Link="osmfeula.txt" Pack="true" PackagePath="OSMFEULA.txt" />
171171
</ItemGroup>
172172

173173
<Import Project="Directory.props" Condition="Exists('Directory.props')"/>

src/Directory.Build.targets

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174

175175
<Target Name="UpdatePackageMetadata"
176176
BeforeTargets="PrepareForBuild;GenerateMSBuildEditorConfigFileShouldRun;GetAssemblyVersion;GetPackageMetadata;GenerateNuspec;Pack"
177-
DependsOnTargets="EnsureProjectInformation"
177+
DependsOnTargets="EnsureProjectInformation;UpdatePackageLicense"
178178
Condition="'$(SourceControlInformationFeatureSupported)' == 'true' And
179179
'$(IsPackable)' == 'true'">
180180
<PropertyGroup>
@@ -184,15 +184,16 @@
184184
</PropertyGroup>
185185
</Target>
186186

187-
<Target Name="UpdatePackageLicense" BeforeTargets="GetPackageMetadata;GenerateNuspec;Pack" Condition="'$(IsPackable)' == 'true'">
188-
<!-- If project has a None item with PackagePath=OSMFEULA.txt -->
189-
<PropertyGroup Condition="@(None -> WithMetadataValue('PackagePath', 'OSMFEULA.txt')) != ''">
187+
<Target Name="UpdatePackageLicense">
188+
<!-- If project has a None/Content item with PackagePath=OSMFEULA.txt -->
189+
<PropertyGroup Condition="@(None -> WithMetadataValue('PackagePath', 'OSMFEULA.txt')) != '' or @(Content -> WithMetadataValue('PackagePath', 'OSMFEULA.txt')) != ''">
190190
<PackageLicenseExpression></PackageLicenseExpression>
191191
<PackageLicenseFile>OSMFEULA.txt</PackageLicenseFile>
192192
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
193193
</PropertyGroup>
194194
</Target>
195195

196+
196197
<!-- Import before UsingTask because first to declare tasks wins -->
197198
<Import Project="Directory.targets" Condition="Exists('Directory.targets')"/>
198199
<Import Project="Directory.targets.user" Condition="Exists('Directory.targets.user')" />

0 commit comments

Comments
 (0)