Skip to content

Commit 996be52

Browse files
committed
Update to .NET 8 and EF Core 8 RC1
1 parent e4a9260 commit 996be52

File tree

7 files changed

+27
-20
lines changed

7 files changed

+27
-20
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ jobs:
4747
- name: Setup .NET
4848
uses: actions/setup-dotnet@v3
4949
with:
50-
dotnet-version: 7.0.x
50+
dotnet-version: 8.0.x
51+
dotnet-quality: 'preview'
5152
- name: Setup PowerShell (Ubuntu)
5253
if: matrix.os == 'ubuntu-latest'
5354
run: |
@@ -178,7 +179,8 @@ jobs:
178179
- name: Setup .NET
179180
uses: actions/setup-dotnet@v3
180181
with:
181-
dotnet-version: 7.0.x
182+
dotnet-version: 8.0.x
183+
dotnet-quality: 'preview'
182184
- name: Git checkout
183185
uses: actions/checkout@v4
184186
- name: Restore tools
@@ -189,7 +191,7 @@ jobs:
189191
run: |
190192
$inspectCodeOutputPath = Join-Path $env:RUNNER_TEMP 'jetbrains-inspectcode-results.xml'
191193
Write-Output "INSPECT_CODE_OUTPUT_PATH=$inspectCodeOutputPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
192-
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$inspectCodeOutputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:ContinuousIntegrationBuild=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
194+
dotnet jb inspectcode JsonApiDotNetCore.sln --dotnetcoresdk=$(dotnet --version) --build --output="$inspectCodeOutputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:ContinuousIntegrationBuild=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
193195
- name: Verify outcome
194196
shell: pwsh
195197
run: |
@@ -229,7 +231,8 @@ jobs:
229231
- name: Setup .NET
230232
uses: actions/setup-dotnet@v3
231233
with:
232-
dotnet-version: 7.0.x
234+
dotnet-version: 8.0.x
235+
dotnet-quality: 'preview'
233236
- name: Git checkout
234237
uses: actions/checkout@v4
235238
with:
@@ -250,13 +253,13 @@ jobs:
250253
$baseCommitHash = git rev-parse HEAD~1
251254
252255
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
253-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
256+
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 --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
254257
- name: CleanupCode (on branch)
255258
if: github.event_name == 'push' || github.event_name == 'release'
256259
shell: pwsh
257260
run: |
258261
Write-Output "Running code cleanup on all files."
259-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff
262+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff
260263
261264
publish:
262265
timeout-minutes: 60

Directory.Build.props

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@
1515

1616
<PropertyGroup>
1717
<!-- Published dependencies (only update on major version change) -->
18-
<TargetFrameworkName>net7.0</TargetFrameworkName>
18+
<TargetFrameworkName>net8.0</TargetFrameworkName>
1919
<CodeAnalysisFrozenVersion>4.1.0</CodeAnalysisFrozenVersion>
2020
<DemystifierFrozenVersion>0.4.1</DemystifierFrozenVersion>
21-
<EntityFrameworkCoreFrozenVersion>7.0.0</EntityFrameworkCoreFrozenVersion>
21+
<EntityFrameworkCoreFrozenVersion>8.0.0-rc.1.*</EntityFrameworkCoreFrozenVersion>
2222
<HumanizerFrozenVersion>2.14.1</HumanizerFrozenVersion>
2323

2424
<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
25-
<AspNetCoreVersion>7.0.*</AspNetCoreVersion>
25+
<AspNetCoreVersion>8.0.0-rc.1.*</AspNetCoreVersion>
2626
<BenchmarkDotNetVersion>0.13.*</BenchmarkDotNetVersion>
2727
<BogusVersion>34.0.*</BogusVersion>
2828
<CSharpGuidelinesAnalyzerVersion>3.8.*</CSharpGuidelinesAnalyzerVersion>
2929
<CodeAnalysisVersion>4.7.*</CodeAnalysisVersion>
3030
<CoverletVersion>6.0.*</CoverletVersion>
3131
<DateOnlyTimeOnlyVersion>2.1.*</DateOnlyTimeOnlyVersion>
32-
<EntityFrameworkCoreVersion>7.0.*</EntityFrameworkCoreVersion>
32+
<EntityFrameworkCoreVersion>8.0.0-rc.1.*</EntityFrameworkCoreVersion>
3333
<FluentAssertionsVersion>6.12.*</FluentAssertionsVersion>
3434
<GitHubActionsTestLoggerVersion>2.3.*</GitHubActionsTestLoggerVersion>
3535
<InheritDocVersion>1.3.*</InheritDocVersion>
3636
<JetBrainsAnnotationsVersion>2023.2.*</JetBrainsAnnotationsVersion>
37-
<NpgsqlVersion>7.0.*</NpgsqlVersion>
37+
<NpgsqlVersion>8.0.0-rc.1</NpgsqlVersion>
3838
<SourceLinkVersion>1.1.*</SourceLinkVersion>
3939
<SystemTextJsonVersion>$(AspNetCoreVersion)</SystemTextJsonVersion>
4040
<TestSdkVersion>17.7.*</TestSdkVersion>
@@ -53,6 +53,9 @@
5353
<IsPackable>false</IsPackable>
5454
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
5555
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
56-
<JsonApiDotNetCoreVersionPrefix>5.4.1</JsonApiDotNetCoreVersionPrefix>
56+
57+
<!-- workaround for "NU5104: A stable release of a package should not have a prerelease dependency." -->
58+
<JsonApiDotNetCoreVersionPrefix>5.4.1-net80</JsonApiDotNetCoreVersionPrefix>
59+
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
5760
</PropertyGroup>
5861
</Project>

cleanupcode.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ if ($revision) {
2828

2929
if ($baseCommitHash -eq $headCommitHash) {
3030
Write-Output "Running code cleanup on staged/unstaged files."
31-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified
31+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified --jb --dotnetcoresdk=$(dotnet --version)
3232
VerifySuccessExitCode
3333
}
3434
else {
3535
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash, including staged/unstaged files."
36-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
36+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash --jb --dotnetcoresdk=$(dotnet --version)
3737
VerifySuccessExitCode
3838
}
3939
}
4040
else {
4141
Write-Output "Running code cleanup on all files."
42-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN
42+
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --jb --dotnetcoresdk=$(dotnet --version)
4343
VerifySuccessExitCode
4444
}

inspectcode.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if ($LastExitCode -ne 0) {
1010

1111
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
1212
$resultPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.html')
13-
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
13+
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal --dotnetcoresdk=$(dotnet --version)
1414

1515
if ($LastExitCode -ne 0) {
1616
throw "Code inspection failed with exit code $LastExitCode"

src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<NoWarn>$(NoWarn);NU5128</NoWarn>
88
<LangVersion>latest</LangVersion>
99
<IsRoslynComponent>true</IsRoslynComponent>
10+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
1011
</PropertyGroup>
1112

1213
<PropertyGroup>

src/JsonApiDotNetCore/Serialization/Response/FingerprintGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace JsonApiDotNetCore.Serialization.Response;
66
/// <inheritdoc cref="IFingerprintGenerator" />
77
internal sealed class FingerprintGenerator : IFingerprintGenerator
88
{
9-
private static readonly byte[] Separator = Encoding.UTF8.GetBytes("|");
9+
private static readonly byte[] Separator = "|"u8.ToArray();
1010
private static readonly uint[] LookupTable = Enumerable.Range(0, 256).Select(ToLookupEntry).ToArray();
1111

1212
private static uint ToLookupEntry(int index)

test/JsonApiDotNetCoreTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public async Task ApiController_attribute_transforms_NotFound_action_result_with
3333

3434
ErrorObject error = responseDocument.Errors[0];
3535
error.Links.ShouldNotBeNull();
36-
error.Links.About.Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.4");
36+
error.Links.About.Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.5");
3737
}
3838

3939
[Fact]
@@ -66,15 +66,15 @@ public async Task ProblemDetails_from_invalid_ModelState_is_translated_into_erro
6666
ErrorObject error1 = responseDocument.Errors[0];
6767
error1.StatusCode.Should().Be(HttpStatusCode.BadRequest);
6868
error1.Links.ShouldNotBeNull();
69-
error1.Links.About.Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.1");
69+
error1.Links.About.Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.1");
7070
error1.Title.Should().Be("One or more validation errors occurred.");
7171
error1.Detail.Should().Be("The Name field is required.");
7272
error1.Source.Should().BeNull();
7373

7474
ErrorObject error2 = responseDocument.Errors[1];
7575
error2.StatusCode.Should().Be(HttpStatusCode.BadRequest);
7676
error2.Links.ShouldNotBeNull();
77-
error2.Links.About.Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.1");
77+
error2.Links.About.Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.1");
7878
error2.Title.Should().Be("One or more validation errors occurred.");
7979
error2.Detail.Should().Be("The field YearOfBirth must be between 1900 and 2050.");
8080
error2.Source.Should().BeNull();

0 commit comments

Comments
 (0)