Skip to content

Commit f8d646c

Browse files
authored
Merge branch 'master' into request-meta-tests-boilerplate
2 parents 6238c91 + 8c59d1b commit f8d646c

File tree

2,091 files changed

+281286
-820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,091 files changed

+281286
-820
lines changed

.config/dotnet-tools.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2024.3.6",
6+
"version": "2025.1.4",
77
"commands": [
88
"jb"
99
],
@@ -17,7 +17,7 @@
1717
"rollForward": false
1818
},
1919
"dotnet-reportgenerator-globaltool": {
20-
"version": "5.4.4",
20+
"version": "5.4.7",
2121
"commands": [
2222
"reportgenerator"
2323
],
@@ -29,6 +29,13 @@
2929
"docfx"
3030
],
3131
"rollForward": false
32+
},
33+
"microsoft.openapi.kiota": {
34+
"version": "1.27.0",
35+
"commands": [
36+
"kiota"
37+
],
38+
"rollForward": false
3239
}
3340
}
34-
}
41+
}

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# When running OpenAPI tests, these committed files are downloaded and written to disk (so we'll know when something changes).
2+
# On Windows, these text files are auto-converted to crlf on git fetch, while the written downloaded files use lf line endings.
3+
# Therefore, running the tests on Windows creates local changes. Staging them auto-converts back to crlf, which undoes the changes.
4+
# To avoid this annoyance, the next line opts out of the auto-conversion and forces line endings to lf.
5+
**/GeneratedSwagger/**/*.json text eol=lf

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Bugs are tracked as [GitHub issues](https://github.com/json-api-dotnet/JsonApiDo
2222
Explain the problem and include additional details to help maintainers reproduce the problem:
2323

2424
- **Use a clear and descriptive title** for the issue to identify the problem.
25-
- **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, don't just say what you did, but explain how you did it.
25+
- **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, don't just say what you did, but explain how you did it.
2626
- **Provide specific examples to demonstrate the steps.** Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://docs.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks).
2727
- **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. Explain which behavior you expected to see instead and why.
2828
- **If you're reporting a crash**, include the full exception stack trace.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: ''
88
---
99

1010
<!--
11-
Remember that no-one is getting paid to answer your question. You're basically asking other people to give up their time to help you out of the goodness of their heart – it's up to you to do all you can to make that as simple as possible, so read http://tinyurl.com/stack-checklist first.
11+
Remember that no-one is getting paid to answer your question. You're basically asking other people to give up their time to help you out of the goodness of their heart – it's up to you to do all you can to make that as simple as possible, so read https://tinyurl.com/stack-checklist first.
1212
-->
1313

1414
#### SUMMARY

.github/workflows/build.yml

Lines changed: 32 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
name: Build
1010

1111
on:
12-
push:
13-
branches: [ 'master', 'release/**' ]
12+
workflow_dispatch:
1413
pull_request:
14+
push:
1515
branches: [ 'master', 'release/**' ]
1616
release:
1717
types: [published]
@@ -45,7 +45,6 @@ jobs:
4545
- name: Setup .NET
4646
uses: actions/setup-dotnet@v4
4747
with:
48-
# Block buggy release from February 11, 2025
4948
dotnet-version: |
5049
8.0.*
5150
9.0.*
@@ -58,29 +57,27 @@ jobs:
5857
- name: Git checkout
5958
uses: actions/checkout@v4
6059
- name: Restore tools
61-
run: |
62-
dotnet tool restore
60+
run: dotnet tool restore
6361
- name: Restore packages
64-
run: |
65-
dotnet restore
62+
run: dotnet restore
6663
- name: Calculate version suffix
6764
shell: pwsh
6865
run: |
6966
if ($env:GITHUB_REF_TYPE -eq 'tag') {
7067
# Get the version prefix/suffix from the git tag. For example: 'v1.0.0-preview1-final' => '1.0.0' and 'preview1-final'
71-
$segments = $env:GITHUB_REF_NAME -split "-"
68+
$segments = $env:GITHUB_REF_NAME -split '-'
7269
$versionPrefix = $segments[0].TrimStart('v')
7370
$versionSuffix = $segments.Length -eq 1 ? '' : $segments[1..$($segments.Length - 1)] -join '-'
7471
7572
[xml]$xml = Get-Content Directory.Build.props
76-
$configuredVersionPrefix = $xml.Project.PropertyGroup.JsonApiDotNetCoreVersionPrefix | Select-Object -First 1
73+
$configuredVersionPrefix = $xml.Project.PropertyGroup.VersionPrefix | Select-Object -First 1
7774
7875
if ($configuredVersionPrefix -ne $versionPrefix) {
7976
Write-Error "Version prefix from git release tag '$versionPrefix' does not match version prefix '$configuredVersionPrefix' stored in Directory.Build.props."
8077
# To recover from this:
8178
# - Delete the GitHub release
8279
# - Run: git push --delete origin the-invalid-tag-name
83-
# - Adjust JsonApiDotNetCoreVersionPrefix in Directory.Build.props, commit and push
80+
# - Adjust VersionPrefix in Directory.Build.props, commit and push
8481
# - Recreate the GitHub release
8582
}
8683
}
@@ -94,9 +91,7 @@ jobs:
9491
Write-Output "Using version suffix: $versionSuffix"
9592
Write-Output "PACKAGE_VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
9693
- name: Build
97-
shell: pwsh
98-
run: |
99-
dotnet build --no-restore --configuration Release /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
94+
run: dotnet build --no-restore --configuration Release /p:VersionSuffix=${{ env.PACKAGE_VERSION_SUFFIX }}
10095
- name: Test
10196
env:
10297
# Override log levels, to reduce logging output when running tests in ci-build.
@@ -105,30 +100,27 @@ jobs:
105100
Logging__LogLevel__Microsoft.Extensions.Hosting.Internal.Host: 'None'
106101
Logging__LogLevel__Microsoft.EntityFrameworkCore.Database.Command: 'None'
107102
Logging__LogLevel__JsonApiDotNetCore: 'None'
108-
run: |
109-
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true"
103+
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true"
110104
- name: Upload coverage to codecov.io
111-
if: matrix.os == 'ubuntu-latest'
105+
if: ${{ matrix.os == 'ubuntu-latest' }}
112106
env:
113107
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
114108
uses: codecov/codecov-action@v5
115109
with:
116110
fail_ci_if_error: true
117111
verbose: true
118112
- name: Generate packages
119-
shell: pwsh
120-
run: |
121-
dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
113+
run: dotnet pack --no-build --configuration Release --output ${{ github.workspace }}/artifacts/packages /p:VersionSuffix=${{ env.PACKAGE_VERSION_SUFFIX }}
122114
- name: Upload packages to artifacts
123-
if: matrix.os == 'ubuntu-latest'
115+
if: ${{ matrix.os == 'ubuntu-latest' }}
124116
uses: actions/upload-artifact@v4
125117
with:
126118
name: packages
127119
path: artifacts/packages
128120
- name: Generate documentation
129121
shell: pwsh
130122
env:
131-
# This contains the git tag name on release; in that case we build the docs without publishing them.
123+
# This contains the git tag name on release; in that case, we build the docs without publishing them.
132124
DOCFX_SOURCE_BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
133125
run: |
134126
cd docs
@@ -143,7 +135,7 @@ jobs:
143135
New-Item -Force _site/styles -ItemType Directory | Out-Null
144136
Copy-Item -Recurse home/assets/* _site/styles/
145137
- name: Upload documentation to artifacts
146-
if: matrix.os == 'ubuntu-latest'
138+
if: ${{ matrix.os == 'ubuntu-latest' }}
147139
uses: actions/upload-artifact@v4
148140
with:
149141
name: documentation
@@ -164,15 +156,13 @@ jobs:
164156
- name: Setup .NET
165157
uses: actions/setup-dotnet@v4
166158
with:
167-
# Block buggy release from February 11, 2025
168159
dotnet-version: |
169160
8.0.*
170161
9.0.*
171162
- name: Git checkout
172163
uses: actions/checkout@v4
173164
- name: Restore tools
174-
run: |
175-
dotnet tool restore
165+
run: dotnet tool restore
176166
- name: InspectCode
177167
shell: pwsh
178168
run: |
@@ -201,7 +191,7 @@ jobs:
201191
}
202192
203193
if ($failed) {
204-
Write-Error "One or more projects failed code inspection."
194+
Write-Error 'One or more projects failed code inspection.'
205195
}
206196
}
207197
@@ -220,7 +210,6 @@ jobs:
220210
- name: Setup .NET
221211
uses: actions/setup-dotnet@v4
222212
with:
223-
# Block buggy release from February 11, 2025
224213
dotnet-version: |
225214
8.0.*
226215
9.0.*
@@ -229,13 +218,11 @@ jobs:
229218
with:
230219
fetch-depth: 2
231220
- name: Restore tools
232-
run: |
233-
dotnet tool restore
221+
run: dotnet tool restore
234222
- name: Restore packages
235-
run: |
236-
dotnet restore
223+
run: dotnet restore
237224
- name: CleanupCode (on PR diff)
238-
if: github.event_name == 'pull_request'
225+
if: ${{ github.event_name == 'pull_request' }}
239226
shell: pwsh
240227
run: |
241228
# Not using the environment variables for SHAs, because they may be outdated. This may happen on force-push after the build is queued, but before it starts.
@@ -246,10 +233,10 @@ jobs:
246233
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
247234
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
248235
- name: CleanupCode (on branch)
249-
if: github.event_name == 'push' || github.event_name == 'release'
236+
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
250237
shell: pwsh
251238
run: |
252-
Write-Output "Running code cleanup on all files."
239+
Write-Output 'Running code cleanup on all files.'
253240
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN --fail-on-diff --print-diff
254241
255242
publish:
@@ -266,25 +253,23 @@ jobs:
266253
- name: Download artifacts
267254
uses: actions/download-artifact@v4
268255
- name: Publish to GitHub Packages
269-
if: github.event_name == 'push' || github.event_name == 'release'
270-
env:
271-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
272-
shell: pwsh
256+
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
273257
run: |
274-
dotnet nuget add source --username 'json-api-dotnet' --password "$env:GITHUB_TOKEN" --store-password-in-clear-text --name 'github' 'https://nuget.pkg.github.com/json-api-dotnet/index.json'
275-
dotnet nuget push "$env:GITHUB_WORKSPACE/packages/*.nupkg" --api-key "$env:GITHUB_TOKEN" --source 'github'
258+
dotnet nuget add source --username 'json-api-dotnet' --password '${{ secrets.GITHUB_TOKEN }}' --store-password-in-clear-text --name 'github' 'https://nuget.pkg.github.com/json-api-dotnet/index.json'
259+
dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.GITHUB_TOKEN }}' --source 'github'
260+
- name: Publish to feedz.io
261+
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
262+
run: |
263+
dotnet nuget add source --name 'feedz-io' 'https://f.feedz.io/json-api-dotnet/jsonapidotnetcore/nuget/index.json'
264+
dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.FEEDZ_IO_API_KEY }}' --source 'feedz-io'
276265
- name: Publish documentation
277-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
266+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
278267
uses: peaceiris/actions-gh-pages@v4
279268
with:
280269
github_token: ${{ secrets.GITHUB_TOKEN }}
281270
publish_branch: gh-pages
282271
publish_dir: ./documentation
283272
commit_message: 'Auto-generated documentation from'
284273
- name: Publish to NuGet
285-
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
286-
env:
287-
NUGET_ORG_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }}
288-
shell: pwsh
289-
run: |
290-
dotnet nuget push "$env:GITHUB_WORKSPACE/packages/*.nupkg" --api-key "$env:NUGET_ORG_API_KEY" --source 'nuget.org'
274+
if: ${{ github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') }}
275+
run: dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.NUGET_ORG_API_KEY }}' --source 'nuget.org' --skip-duplicate

.github/workflows/codeql.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: "CodeQL"
22

33
on:
4-
push:
5-
branches: [ 'master', 'release/**' ]
4+
workflow_dispatch:
65
pull_request:
7-
# The branches below must be a subset of the branches above
6+
push:
87
branches: [ 'master', 'release/**' ]
98
schedule:
109
- cron: '0 0 * * 5'
@@ -26,16 +25,18 @@ jobs:
2625
- name: Setup .NET
2726
uses: actions/setup-dotnet@v4
2827
with:
29-
# Block buggy release from February 11, 2025
3028
dotnet-version: |
31-
8.0.309
32-
9.0.103
29+
8.0.*
30+
9.0.*
3331
- name: Git checkout
3432
uses: actions/checkout@v4
3533
- name: Initialize CodeQL
3634
uses: github/codeql-action/init@v3
3735
with:
3836
languages: ${{ matrix.language }}
37+
- name: Restore .NET tools
38+
run: |
39+
dotnet tool restore
3940
- name: Autobuild
4041
uses: github/codeql-action/autobuild@v3
4142
- name: Perform CodeQL Analysis

.github/workflows/qodana.yml

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
# https://www.jetbrains.com/help/qodana/cloud-forward-reports.html#cloud-forward-reports-github-actions
2-
31
name: Qodana
42
on:
53
workflow_dispatch:
64
pull_request:
75
push:
8-
branches:
9-
- master
10-
- 'release/*'
6+
branches: [ 'master', 'release/**' ]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
DOTNET_NOLOGO: true
14+
DOTNET_CLI_TELEMETRY_OPTOUT: true
1115

1216
jobs:
1317
qodana:
@@ -17,17 +21,32 @@ jobs:
1721
pull-requests: write
1822
checks: write
1923
steps:
20-
- uses: actions/checkout@v4
24+
- name: Setup .NET
25+
uses: actions/setup-dotnet@v4
26+
with:
27+
dotnet-version: |
28+
8.0.*
29+
9.0.*
30+
- name: Git checkout
31+
uses: actions/checkout@v4
2132
with:
2233
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
2334
fetch-depth: 0 # a full history is required for pull request analysis
24-
- name: 'Qodana Scan'
25-
uses: JetBrains/qodana-action@v2024.1
35+
- name: Restore tools
36+
run: dotnet tool restore
37+
- name: Restore packages
38+
run: dotnet restore
39+
- name: Build
40+
run: dotnet build --no-restore --configuration Release
41+
- name: Qodana scan
42+
uses: JetBrains/qodana-action@v2025.1
43+
with:
44+
args: --ide,QDNET,--profile-name,qodana.recommended,--configuration,Release,--apply-fixes
45+
push-fixes: pull-request
46+
upload-result: true
2647
env:
2748
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
28-
- name: Upload results to artifacts on failure
29-
if: failure()
30-
uses: actions/upload-artifact@v4
49+
- name: Upload SARIF report
50+
uses: github/codeql-action/upload-sarif@v3
3151
with:
32-
name: qodana_results
33-
path: ${{ runner.temp }}/qodana/results
52+
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json

0 commit comments

Comments
 (0)