Skip to content

Commit de0042a

Browse files
authored
Update to JsonApiDotNetCore v5.10.0, add support for .NET 10 (#143)
1 parent 035f35e commit de0042a

File tree

19 files changed

+94
-79
lines changed

19 files changed

+94
-79
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2025.2.4",
6+
"version": "2025.3.0.2",
77
"commands": [
88
"jb"
99
],
@@ -17,7 +17,7 @@
1717
"rollForward": false
1818
},
1919
"dotnet-reportgenerator-globaltool": {
20-
"version": "5.4.17",
20+
"version": "5.5.0",
2121
"commands": [
2222
"reportgenerator"
2323
],

.github/workflows/build.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ concurrency:
2323
env:
2424
DOTNET_NOLOGO: true
2525
DOTNET_CLI_TELEMETRY_OPTOUT: true
26+
SOLUTION_FILE: JsonApiDotNetCore.MongoDb.sln
2627

2728
jobs:
2829
build-and-test:
@@ -43,13 +44,16 @@ jobs:
4344
dotnet-version: |
4445
8.0.*
4546
9.0.*
47+
10.0.*
4648
- name: Show installed versions
4749
shell: pwsh
4850
run: |
4951
Write-Host "$(pwsh --version) is installed at $PSHOME"
5052
Write-Host "Active .NET SDK: $(dotnet --version)"
5153
- name: Git checkout
52-
uses: actions/checkout@v5
54+
uses: actions/checkout@v6
55+
with:
56+
persist-credentials: false
5357
- name: Restore tools
5458
run: dotnet tool restore
5559
- name: Restore packages
@@ -87,7 +91,7 @@ jobs:
8791
- name: Build
8892
run: dotnet build --no-restore --configuration Release /p:VersionSuffix=${{ env.PACKAGE_VERSION_SUFFIX }}
8993
- name: Test
90-
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true"
94+
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;annotations-title=@test (@framework);annotations-message=@error\n@trace;summary-include-passed=false"
9195
- name: Upload coverage to codecov.io
9296
if: ${{ matrix.os == 'ubuntu-latest' }}
9397
env:
@@ -100,7 +104,7 @@ jobs:
100104
run: dotnet pack --no-build --configuration Release --output ${{ github.workspace }}/artifacts/packages /p:VersionSuffix=${{ env.PACKAGE_VERSION_SUFFIX }}
101105
- name: Upload packages to artifacts
102106
if: ${{ matrix.os == 'ubuntu-latest' }}
103-
uses: actions/upload-artifact@v4
107+
uses: actions/upload-artifact@v5
104108
with:
105109
name: packages
106110
path: artifacts/packages
@@ -123,16 +127,20 @@ jobs:
123127
dotnet-version: |
124128
8.0.*
125129
9.0.*
130+
10.0.*
126131
- name: Git checkout
127-
uses: actions/checkout@v5
132+
uses: actions/checkout@v6
133+
with:
134+
persist-credentials: false
128135
- name: Restore tools
129136
run: dotnet tool restore
130137
- name: InspectCode
131138
shell: pwsh
132139
run: |
133140
$inspectCodeOutputPath = Join-Path $env:RUNNER_TEMP 'jetbrains-inspectcode-results.xml'
134141
Write-Output "INSPECT_CODE_OUTPUT_PATH=$inspectCodeOutputPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
135-
dotnet jb inspectcode JsonApiDotNetCore.MongoDb.sln --build --dotnetcoresdk=$(dotnet --version) --output="$inspectCodeOutputPath" --format="xml" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:ContinuousIntegrationBuild=false --properties:RunAnalyzers=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
142+
dotnet jb inspectcode --version
143+
dotnet jb inspectcode $env:SOLUTION_FILE --build --dotnetcoresdk=$(dotnet --version) --output="$inspectCodeOutputPath" --format="xml" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:ContinuousIntegrationBuild=false --properties:RunAnalyzers=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
136144
- name: Verify outcome
137145
shell: pwsh
138146
run: |
@@ -177,9 +185,11 @@ jobs:
177185
dotnet-version: |
178186
8.0.*
179187
9.0.*
188+
10.0.*
180189
- name: Git checkout
181-
uses: actions/checkout@v5
190+
uses: actions/checkout@v6
182191
with:
192+
persist-credentials: false
183193
fetch-depth: 2
184194
- name: Restore tools
185195
run: dotnet tool restore
@@ -195,13 +205,15 @@ jobs:
195205
$baseCommitHash = git rev-parse HEAD~1
196206
197207
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
198-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.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
208+
dotnet jb cleanupcode --version
209+
dotnet regitlint -s $env:SOLUTION_FILE --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
199210
- name: CleanupCode (on branch)
200211
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
201212
shell: pwsh
202213
run: |
203214
Write-Output 'Running code cleanup on all files.'
204-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.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
215+
dotnet jb cleanupcode --version
216+
dotnet regitlint -s $env:SOLUTION_FILE --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
205217
206218
publish:
207219
timeout-minutes: 60
@@ -220,12 +232,12 @@ jobs:
220232
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
221233
run: |
222234
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'
223-
dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.GITHUB_TOKEN }}' --source 'github'
235+
dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.GITHUB_TOKEN }}' --source 'github' --skip-duplicate
224236
- name: Publish to feedz.io
225237
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
226238
run: |
227239
dotnet nuget add source --name 'feedz-io' 'https://f.feedz.io/json-api-dotnet/jsonapidotnetcore/nuget/index.json'
228-
dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.FEEDZ_IO_API_KEY }}' --source 'feedz-io'
240+
dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.FEEDZ_IO_API_KEY }}' --source 'feedz-io' --skip-duplicate
229241
- name: Publish to NuGet
230242
if: ${{ github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') }}
231243
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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ jobs:
2828
dotnet-version: |
2929
8.0.*
3030
9.0.*
31+
10.0.*
3132
- name: Git checkout
32-
uses: actions/checkout@v5
33+
uses: actions/checkout@v6
34+
with:
35+
persist-credentials: false
3336
- name: Initialize CodeQL
3437
uses: github/codeql-action/init@v4
3538
with:

.github/workflows/deps-review.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: 'Checkout Repository'
12-
uses: actions/checkout@v5
12+
uses: actions/checkout@v6
13+
with:
14+
persist-credentials: false
1315
- name: 'Dependency Review'
1416
uses: actions/dependency-review-action@v4

Build.ps1

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
function VerifySuccessExitCode {
2-
if ($LastExitCode -ne 0) {
3-
throw "Command failed with exit code $LastExitCode."
4-
}
5-
}
1+
#Requires -Version 7.4
2+
$ErrorActionPreference = "Stop"
3+
$PSNativeCommandUseErrorActionPreference = $true
64

75
Write-Host "$(pwsh --version)"
86
Write-Host ".NET SDK $(dotnet --version)"
@@ -11,16 +9,7 @@ Remove-Item -Recurse -Force artifacts -ErrorAction SilentlyContinue
119
Remove-Item -Recurse -Force * -Include coverage.cobertura.xml
1210

1311
dotnet tool restore
14-
VerifySuccessExitCode
15-
1612
dotnet build --configuration Release
17-
VerifySuccessExitCode
18-
1913
dotnet test --no-build --configuration Release --verbosity quiet --collect:"XPlat Code Coverage"
20-
VerifySuccessExitCode
21-
2214
dotnet reportgenerator -reports:**\coverage.cobertura.xml -targetdir:artifacts\coverage -filefilters:-*.g.cs
23-
VerifySuccessExitCode
24-
2515
dotnet pack --no-build --configuration Release --output artifacts/packages
26-
VerifySuccessExitCode

Directory.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
<AnalysisMode>Recommended</AnalysisMode>
1010
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
1111
<RunSettingsFilePath>$(MSBuildThisFileDirectory)tests.runsettings</RunSettingsFilePath>
12-
<VersionPrefix>5.9.0</VersionPrefix>
12+
<VersionPrefix>5.10.0</VersionPrefix>
1313
<VersionSuffix>pre</VersionSuffix>
14-
<NuGetAuditMode>direct</NuGetAuditMode>
1514
</PropertyGroup>
1615

1716
<PropertyGroup>

JsonApiDotNetCore.MongoDb.sln.DotSettings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@
6969
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantOverload_002ELocal/@EntryIndexedValue">WARNING</s:String>
7070
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantQueryOrderByAscendingKeyword/@EntryIndexedValue">SUGGESTION</s:String>
7171
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantToStringCallForValueType/@EntryIndexedValue">SUGGESTION</s:String>
72+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantTypeArgumentsInsideNameof/@EntryIndexedValue">WARNING</s:String>
7273
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RemoveConstructorInvocation/@EntryIndexedValue">SUGGESTION</s:String>
7374
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceSequenceEqualWithConstantPattern/@EntryIndexedValue">WARNING</s:String>
75+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithFieldKeyword/@EntryIndexedValue">WARNING</s:String>
7476
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithPrimaryConstructorParameter/@EntryIndexedValue">DO_NOT_SHOW</s:String>
7577
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SimplifyStringInterpolation/@EntryIndexedValue">WARNING</s:String>
7678
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SpecifyStringComparison/@EntryIndexedValue">WARNING</s:String>
@@ -79,6 +81,7 @@
7981
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestDiscardDeclarationVarStyle/@EntryIndexedValue">WARNING</s:String>
8082
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TailRecursiveCall/@EntryIndexedValue">SUGGESTION</s:String>
8183
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=TryCastAlwaysSucceeds/@EntryIndexedValue">WARNING</s:String>
84+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnknownMetadata/@EntryIndexedValue">DO_NOT_SHOW</s:String>
8285
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnnecessaryWhitespace/@EntryIndexedValue">HINT</s:String>
8386
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseArrayEmptyMethod/@EntryIndexedValue">WARNING</s:String>
8487
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseCollectionCountProperty/@EntryIndexedValue">WARNING</s:String>

cleanupcode.ps1

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Requires -Version 7.0
1+
#Requires -Version 7.4
22

33
# This script reformats (part of) the codebase to make it compliant with our coding guidelines.
44

@@ -7,38 +7,31 @@ param(
77
[string] $revision
88
)
99

10-
function VerifySuccessExitCode {
11-
if ($LastExitCode -ne 0) {
12-
throw "Command failed with exit code $LastExitCode."
13-
}
14-
}
10+
$ErrorActionPreference = "Stop"
11+
$PSNativeCommandUseErrorActionPreference = $true
1512

1613
dotnet tool restore
17-
VerifySuccessExitCode
18-
1914
dotnet restore
20-
VerifySuccessExitCode
15+
16+
$solutionFile = 'JsonApiDotNetCore.MongoDb.sln'
2117

2218
if ($revision) {
2319
$headCommitHash = git rev-parse HEAD
24-
VerifySuccessExitCode
25-
2620
$baseCommitHash = git rev-parse $revision
27-
VerifySuccessExitCode
2821

2922
if ($baseCommitHash -eq $headCommitHash) {
3023
Write-Output "Running code cleanup on staged/unstaged files."
31-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.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 staged,modified
32-
VerifySuccessExitCode
24+
dotnet jb cleanupcode --version
25+
dotnet regitlint -s $solutionFile --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 staged,modified
3326
}
3427
else {
3528
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash, including staged/unstaged files."
36-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.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 staged,modified,commits -a $headCommitHash -b $baseCommitHash
37-
VerifySuccessExitCode
29+
dotnet jb cleanupcode --version
30+
dotnet regitlint -s $solutionFile --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 staged,modified,commits -a $headCommitHash -b $baseCommitHash
3831
}
3932
}
4033
else {
4134
Write-Output "Running code cleanup on all files."
42-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.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
43-
VerifySuccessExitCode
35+
dotnet jb cleanupcode --version
36+
dotnet regitlint -s $solutionFile --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
4437
}

inspectcode.ps1

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
#Requires -Version 7.0
1+
#Requires -Version 7.4
2+
$ErrorActionPreference = "Stop"
3+
$PSNativeCommandUseErrorActionPreference = $true
24

35
# This script runs code inspection and opens the results in a web browser.
46

57
dotnet tool restore
68

7-
if ($LastExitCode -ne 0) {
8-
throw "Tool restore failed with exit code $LastExitCode"
9-
}
10-
9+
$solutionFile = 'JsonApiDotNetCore.MongoDb.sln'
1110
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
1211
$resultPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.html')
13-
dotnet jb inspectcode JsonApiDotNetCore.MongoDb.sln --dotnetcoresdk=$(dotnet --version) --build --output="$outputPath" --format="xml" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:RunAnalyzers=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
1412

15-
if ($LastExitCode -ne 0) {
16-
throw "Code inspection failed with exit code $LastExitCode"
17-
}
13+
dotnet jb inspectcode --version
14+
dotnet jb inspectcode $solutionFile --dotnetcoresdk=$(dotnet --version) --build --output="$outputPath" --format="xml" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:RunAnalyzers=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
1815

1916
[xml]$xml = Get-Content "$outputPath"
2017
if ($xml.report.Issues -and $xml.report.Issues.Project) {

package-versions.props

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
<Project>
22
<PropertyGroup>
33
<!-- Published dependencies (only update on major version change) -->
4-
<JsonApiDotNetCoreFrozenVersion>5.9.0</JsonApiDotNetCoreFrozenVersion>
4+
<JsonApiDotNetCoreFrozenVersion>5.10.0</JsonApiDotNetCoreFrozenVersion>
55
<MongoDBDriverFrozenVersion>3.3.0</MongoDBDriverFrozenVersion>
66

77
<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
88
<BogusVersion>35.6.*</BogusVersion>
99
<CoverletVersion>6.0.*</CoverletVersion>
1010
<EphemeralMongoVersion>3.2.*</EphemeralMongoVersion>
1111
<FluentAssertionsVersion>7.2.*</FluentAssertionsVersion>
12-
<GitHubActionsTestLoggerVersion>2.4.*</GitHubActionsTestLoggerVersion>
12+
<GitHubActionsTestLoggerVersion>3.0.*</GitHubActionsTestLoggerVersion>
1313
<InheritDocVersion>2.0.*</InheritDocVersion>
1414
<MongoDBDriverVersion>3.5.*</MongoDBDriverVersion>
1515
<TestSdkVersion>18.0.*</TestSdkVersion>
1616
<XunitVersion>2.9.*</XunitVersion>
1717
<XunitVisualStudioVersion>3.1.*</XunitVisualStudioVersion>
1818
</PropertyGroup>
1919

20+
<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0'">
21+
<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
22+
<AspNetCoreVersion>10.0.*</AspNetCoreVersion>
23+
</PropertyGroup>
24+
2025
<PropertyGroup Condition="'$(TargetFramework)' == 'net9.0'">
2126
<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
2227
<AspNetCoreVersion>9.0.*</AspNetCoreVersion>

0 commit comments

Comments
 (0)