Skip to content

Commit 60b172e

Browse files
committed
⬆️ Bump files with dotnet-file sync
# devlooped/oss - Enhance documentation instructions for project work devlooped/oss@e616d89 - If the OSMF eula is present, switch to its license file devlooped/oss@4b84c54 - Change file type from None to Content for osmfeula.txt devlooped/oss@fd03672 - Add Pack attribute to OSMFEULA content item devlooped/oss@dd13ed3 - Hide osmfeula.txt from package visibility devlooped/oss@a1f5d11 - Add OpenTelemetry patterns to dependabot config devlooped/oss@387f061 - Refactor GitHub Actions workflows to use unified PR_TOKEN for authentication and add skip PR creation warning devlooped/oss@7c1c6e6 - Consider either None or Content for OSMF license patching devlooped/oss@083a37b - Cap rate limit wait at 5 minutes, abort if longer devlooped/oss@61a602f - Add AzuriteConfig to .gitignore devlooped/oss@12c18e7
1 parent b4170dd commit 60b172e

10 files changed

Lines changed: 166 additions & 23 deletions

File tree

.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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ updates:
3232
Web:
3333
patterns:
3434
- "Microsoft.AspNetCore*"
35+
OpenTelemetry:
36+
patterns:
37+
- "OpenTelemetry*"
3538
Tests:
3639
patterns:
3740
- "Microsoft.NET.Test*"

.github/workflows/dotnet-env.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
jobs:
1111
which-dotnet:
1212
runs-on: ubuntu-latest
13+
env:
14+
PR_TOKEN: ${{ secrets.DEVLOOPED_TOKEN || secrets.GH_TOKEN }}
1315
permissions:
1416
contents: write
1517
pull-requests: write
@@ -20,18 +22,19 @@ jobs:
2022
with:
2123
name: ${{ secrets.BOT_NAME }}
2224
email: ${{ secrets.BOT_EMAIL }}
23-
gh_token: ${{ secrets.GH_TOKEN }}
25+
gh_token: ${{ env.PR_TOKEN }}
2426
github_token: ${{ secrets.GITHUB_TOKEN }}
2527

2628
- name: 🤘 checkout
2729
uses: actions/checkout@v4
2830
with:
29-
token: ${{ env.GH_TOKEN }}
31+
token: ${{ env.PR_TOKEN || github.token }}
3032

3133
- name: 🤌 dotnet
3234
uses: devlooped/actions-which-dotnet@v1
3335

3436
- name: ✍ pull request
37+
if: env.PR_TOKEN != ''
3538
uses: peter-evans/create-pull-request@v7
3639
with:
3740
base: main
@@ -41,4 +44,9 @@ jobs:
4144
title: "⚙ Update dotnet versions"
4245
body: "Update dotnet versions"
4346
commit-message: "Update dotnet versions"
44-
token: ${{ env.GH_TOKEN }}
47+
token: ${{ env.PR_TOKEN }}
48+
49+
- name: ⚠️ skip pull request
50+
if: env.PR_TOKEN == ''
51+
shell: bash
52+
run: echo "::warning::Skipping PR creation because neither DEVLOOPED_TOKEN nor GH_TOKEN is configured. GITHUB_TOKEN cannot create pull requests in this repository."

.github/workflows/includes.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
jobs:
1313
includes:
1414
runs-on: ubuntu-latest
15+
env:
16+
PR_TOKEN: ${{ secrets.DEVLOOPED_TOKEN || secrets.GH_TOKEN }}
1517
permissions:
1618
contents: write
1719
pull-requests: write
@@ -21,13 +23,13 @@ jobs:
2123
with:
2224
name: ${{ secrets.BOT_NAME }}
2325
email: ${{ secrets.BOT_EMAIL }}
24-
gh_token: ${{ secrets.GH_TOKEN }}
26+
gh_token: ${{ env.PR_TOKEN }}
2527
github_token: ${{ secrets.GITHUB_TOKEN }}
2628

2729
- name: 🤘 checkout
2830
uses: actions/checkout@v4
2931
with:
30-
token: ${{ env.GH_TOKEN }}
32+
token: ${{ env.PR_TOKEN || github.token }}
3133

3234
- name: +Mᐁ includes
3335
uses: devlooped/actions-includes@v1
@@ -50,6 +52,7 @@ jobs:
5052
((get-content -raw $file) -replace '\$product\$',$product).trim() | set-content $file
5153
5254
- name: ✍ pull request
55+
if: env.PR_TOKEN != ''
5356
uses: peter-evans/create-pull-request@v8
5457
with:
5558
add-paths: |
@@ -64,4 +67,9 @@ jobs:
6467
commit-message: +Mᐁ includes
6568
title: +Mᐁ includes
6669
body: +Mᐁ includes
67-
token: ${{ env.GH_TOKEN }}
70+
token: ${{ env.PR_TOKEN }}
71+
72+
- name: ⚠️ skip pull request
73+
if: env.PR_TOKEN == ''
74+
shell: bash
75+
run: echo "::warning::Skipping PR creation because neither DEVLOOPED_TOKEN nor GH_TOKEN is configured. GITHUB_TOKEN cannot create pull requests in this repository."

.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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ local.settings.json
2626
*.binlog
2727
*.zip
2828
__azurite*.*
29+
AzuriteConfig
2930
__*__
3031

3132
.nuget

.netconfig

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
weak
3131
[file ".github/dependabot.yml"]
3232
url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml
33-
sha = e733294084fb3e75d517a2e961e87df8faae7dc6
34-
etag = 3bf8d9214a15c049ca5cfe80d212a8cbe4753b8a638a9804ef73d34c7def9618
33+
sha = 387f0616b2c56adc4f33f2858da818f7e0d92ef3
34+
etag = a1aaba1440e5ee2a7b7f93fc0fb004d4e1d4d9780350c753f7c429e37241345a
3535
weak
3636
[file ".github/release.yml"]
3737
url = https://github.com/devlooped/oss/blob/main/.github/release.yml
@@ -55,8 +55,8 @@
5555
weak
5656
[file ".github/workflows/dotnet-env.yml"]
5757
url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-env.yml
58-
sha = 77e83f238196d2723640abef0c7b6f43994f9747
59-
etag = fcb9759a96966df40dcd24906fd328ddec05953b7e747a6bb8d0d1e4c3865274
58+
sha = 7c1c6e615b5785e0ac9db33cb17343d6c1de16ff
59+
etag = 68c1e28f475ff9d05f985bf53a51fce6e64b24a8b75bd8e47119ff57309281f1
6060
weak
6161
[file ".github/workflows/dotnet-file.yml"]
6262
url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file.yml
@@ -65,8 +65,8 @@
6565
weak
6666
[file ".github/workflows/includes.yml"]
6767
url = https://github.com/devlooped/oss/blob/main/.github/workflows/includes.yml
68-
sha = 06628725a6303bb8c4cf3076a384fc982a91bc0b
69-
etag = 478f91d4126230e57cc601382da1ba23f9daa054645b4af89800d8dd862e64fd
68+
sha = 7c1c6e615b5785e0ac9db33cb17343d6c1de16ff
69+
etag = 5e6a10be141ee629201bfad01eae09b5c36a67f541ec7ab411ae400b5d73de1d
7070
weak
7171
[file ".github/workflows/publish.yml"]
7272
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
@@ -75,13 +75,13 @@
7575
weak
7676
[file ".github/workflows/triage.yml"]
7777
url = https://github.com/devlooped/oss/blob/main/.github/workflows/triage.yml
78-
sha = 33000c0c4ab4eb4e0e142fa54515b811a189d55c
79-
etag = 013a47739e348f06891f37c45164478cca149854e6cd5c5158e6f073f852b61a
78+
sha = 61a602fc61eedbdae235f01e93657a6219ac2427
79+
etag = 152cd3a559c08da14d1da12a5262ba1d2e0ed6bed6d2eabf5bd209b0c35d8a75
8080
weak
8181
[file ".gitignore"]
8282
url = https://github.com/devlooped/oss/blob/main/.gitignore
83-
sha = a225b7a9f609f26bcc24e0d84f663387be251a7d
84-
etag = 20a8b49d57024abbd85aac5b0020c30e5eb68e0384b2761e93727c8780c4a991
83+
sha = 12c18e78c4bbab118b798d04344e5a5253216841
84+
etag = 69c38c664debe4cbb8b68a87bacb1c93d0ac9757635c31a42292317f05484728
8585
weak
8686
[file "Directory.Build.rsp"]
8787
url = https://github.com/devlooped/oss/blob/main/Directory.Build.rsp
@@ -105,16 +105,27 @@
105105
weak
106106
[file "src/Directory.Build.props"]
107107
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props
108-
sha = 0ff8b7b79a82112678326d1dc5543ed890311366
109-
etag = 3ebde0a8630d526b80f15801179116e17a857ff880a4442e7db7b075efa4fd63
108+
sha = a1f5d11d1821959a141567ed24f9ea43205edd13
109+
etag = b2b90c6d617db9712cc8be2031b767d3ba951015717984f52b4872cc39f93e72
110110
weak
111111
[file "src/Directory.Build.targets"]
112112
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets
113-
sha = 4339749ef4b8f66def75931df09ef99c149f8421
114-
etag = 8b4492765755c030c4c351e058a92f53ab493cab440c1c0ef431f6635c4dae0e
113+
sha = 083a37bd9307ec820bac6ee3c7384083151d36d8
114+
etag = 907682e5632a2ba430357e6e042a4ca33cb8c94a3a215d3091aa03f5958a4877
115115
weak
116116
[file "src/nuget.config"]
117117
url = https://github.com/devlooped/oss/blob/main/src/nuget.config
118118
sha = 032439dbf180fca0539a5bd3a019f18ab3484b76
119119
etag = da7c0104131bd474b52fc9bc9f9bda6470e24ae38d4fb9f5c4f719bc01370ab5
120120
weak
121+
[file "readme.tmp.md"]
122+
url = https://github.com/devlooped/oss/blob/main/readme.tmp.md
123+
skip
124+
[file "oss.cs"]
125+
url = https://github.com/devlooped/oss/blob/main/oss.cs
126+
skip
127+
[file ".github/copilot-instructions.md"]
128+
url = https://github.com/devlooped/oss/blob/main/.github/copilot-instructions.md
129+
sha = e616d89d9537c4b8ccf1c20dd277ab82104167c4
130+
etag = 6ee650d118a57494d3545d54718ccaa5257b09d54504e9c21514fe596edd9678
131+
weak

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ The package currently supports the main scenarios expected for a v1 release, inc
195195
[![domischell](https://avatars.githubusercontent.com/u/66068846?u=0a5c5e2e7d90f15ea657bc660f175605935c5bea&v=4&s=39 "domischell")](https://github.com/DominicSchell)
196196
[![Adrian Alonso](https://avatars.githubusercontent.com/u/2027083?u=129cf516d99f5cb2fd0f4a0787a069f3446b7522&v=4&s=39 "Adrian Alonso")](https://github.com/adalon)
197197
[![torutek](https://avatars.githubusercontent.com/u/33917059?v=4&s=39 "torutek")](https://github.com/torutek)
198-
[![mccaffers](https://avatars.githubusercontent.com/u/16667079?u=110034edf51097a5ee82cb6a94ae5483568e3469&v=4&s=39 "mccaffers")](https://github.com/mccaffers)
198+
[![Ryan McCaffery](https://avatars.githubusercontent.com/u/16667079?u=c0daa64bb5c1b572130e05ae2b6f609ecc912d4d&v=4&s=39 "Ryan McCaffery")](https://github.com/mccaffers)
199199
[![Seika Logiciel](https://avatars.githubusercontent.com/u/2564602?v=4&s=39 "Seika Logiciel")](https://github.com/SeikaLogiciel)
200200
[![Andrew Grant](https://avatars.githubusercontent.com/devlooped-user?s=39 "Andrew Grant")](https://github.com/wizardness)
201201
[![eska-gmbh](https://avatars.githubusercontent.com/devlooped-team?s=39 "eska-gmbh")](https://github.com/eska-gmbh)

src/Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@
166166
<Using Include="System.ArgumentNullException" Static="true" />
167167
</ItemGroup>
168168

169+
<ItemGroup Label="OSMF" Condition="Exists('$(MSBuildThisFileDirectory)..\osmfeula.txt')">
170+
<Content Include="$(MSBuildThisFileDirectory)..\osmfeula.txt" Link="osmfeula.txt" Pack="true" PackagePath="OSMFEULA.txt" Visible="false" />
171+
</ItemGroup>
172+
169173
<Import Project="Directory.props" Condition="Exists('Directory.props')"/>
170174
<Import Project="Directory.props.user" Condition="Exists('Directory.props.user')" />
171175

src/Directory.Build.targets

Lines changed: 11 additions & 1 deletion
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,6 +184,16 @@
184184
</PropertyGroup>
185185
</Target>
186186

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')) != ''">
190+
<PackageLicenseExpression></PackageLicenseExpression>
191+
<PackageLicenseFile>OSMFEULA.txt</PackageLicenseFile>
192+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
193+
</PropertyGroup>
194+
</Target>
195+
196+
187197
<!-- Import before UsingTask because first to declare tasks wins -->
188198
<Import Project="Directory.targets" Condition="Exists('Directory.targets')"/>
189199
<Import Project="Directory.targets.user" Condition="Exists('Directory.targets.user')" />

0 commit comments

Comments
 (0)