Skip to content

Commit 5822cdc

Browse files
authored
Update Steeltoe for .NET 10 (#1615)
* Update to latest Sonar version * Fix IDE0340: Use unbound generic type * Fix IDE0031: Null check can be simplified, add suppression to workaround Sonar bug * Update to new R# major version * Install .NET 10 in workflows, update setup-dotnet version * Resharper: use field keyword * Add net10.0 to target frameworks in test projects * Run tests against .NET 10 in workflows * Adapt for breaking change in JsonStreamConfigurationProvider * Suppress new warning in tests: CA1873 Avoid potentially expensive logging * Suppress obsolete warnings for WebHostBuilder/WebHost * Adapt test for new ForwardedHeadersOptions.KnownIPNetworks property * Adapt test for cleaned logging * Adapt for changed SQL Server connection string (EF Core 10 adds the app name) * Add workaround for missing stable/unstable packages for EF Core 10 * Remove the need for some suppressions * Sync up with ConfigurationSchemaGenerator changes in Aspire v13 * Remove redundant Sonar suppression * Package updates * Multi-target Steeltoe against net8.0/net10.0 * Address new issues after multi-targeting * Increase cibuild timeouts
1 parent 936ac0c commit 5822cdc

File tree

105 files changed

+323
-200
lines changed

Some content is hidden

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

105 files changed

+323
-200
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
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.0",
6+
"version": "2025.3.0",
77
"commands": [
88
"jb"
99
],

.github/workflows/Steeltoe.All.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ env:
2727
jobs:
2828
analyze:
2929
name: Build and Test
30-
timeout-minutes: 30
30+
timeout-minutes: 60
3131
strategy:
3232
fail-fast: false
3333
matrix:
@@ -59,11 +59,12 @@ jobs:
5959

6060
steps:
6161
- name: Setup .NET
62-
uses: actions/setup-dotnet@v4
62+
uses: actions/setup-dotnet@v5
6363
with:
6464
dotnet-version: |
6565
8.0.*
6666
9.0.*
67+
10.0.*
6768
6869
- name: Turn off dev certificate (macOS only)
6970
if: ${{ matrix.os == 'macos-latest' }}
@@ -94,18 +95,24 @@ jobs:
9495
echo SKIP_FILTER_NO_MEMORY_DUMPS="${{ matrix.skipFilter && format('{0}&Category!=MemoryDumps', matrix.skipFilter) || 'Category!=MemoryDumps' }}" >> $GITHUB_ENV
9596
echo SKIP_FILTER_WITH_MEMORY_DUMPS="${{ matrix.skipFilter && format('{0}&Category=MemoryDumps', matrix.skipFilter) || 'Category=MemoryDumps' }}" >> $GITHUB_ENV
9697
97-
- name: Test (net8.0)
98-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
98+
- name: Test (net10.0)
99+
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
99100

100-
- name: Test (net8.0) (memory dumps)
101-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
101+
- name: Test (net10.0) (memory dumps)
102+
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
102103

103104
- name: Test (net9.0)
104105
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
105106

106107
- name: Test (net9.0) (memory dumps)
107108
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
108109

110+
- name: Test (net8.0)
111+
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
112+
113+
- name: Test (net8.0) (memory dumps)
114+
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
115+
109116
- name: Upload crash/hang dumps (on failure)
110117
if: ${{ failure() }}
111118
uses: actions/upload-artifact@v4

.github/workflows/component-shared-workflow.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ jobs:
5656

5757
steps:
5858
- name: Setup .NET
59-
uses: actions/setup-dotnet@v4
59+
uses: actions/setup-dotnet@v5
6060
with:
6161
dotnet-version: |
6262
8.0.*
6363
9.0.*
64+
10.0.*
6465
6566
- name: Turn off dev certificate (macOS only)
6667
if: ${{ inputs.OS == 'macos' }}
@@ -85,12 +86,12 @@ jobs:
8586
- name: Build solution
8687
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
8788

88-
- name: Test (net8.0)
89-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 ${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }} ${{ env.COMMON_TEST_ARGS }}
89+
- name: Test (net10.0)
90+
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 ${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }} ${{ env.COMMON_TEST_ARGS }}
9091

91-
- name: Test (net8.0) (memory dumps)
92+
- name: Test (net10.0) (memory dumps)
9293
if: ${{ inputs.component == 'Management' }}
93-
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 ${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }} ${{ env.COMMON_TEST_ARGS }}
94+
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 ${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }} ${{ env.COMMON_TEST_ARGS }}
9495

9596
- name: Test (net9.0)
9697
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 ${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }} ${{ env.COMMON_TEST_ARGS }}
@@ -99,6 +100,14 @@ jobs:
99100
if: ${{ inputs.component == 'Management' }}
100101
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 ${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }} ${{ env.COMMON_TEST_ARGS }}
101102

103+
- name: Test (net8.0)
104+
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 ${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }} ${{ env.COMMON_TEST_ARGS }}
105+
106+
- name: Test (net8.0) (memory dumps)
107+
if: ${{ inputs.component == 'Management' }}
108+
run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 ${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }} ${{ env.COMMON_TEST_ARGS }}
109+
110+
102111
- name: Upload crash/hang dumps (on failure)
103112
if: ${{ failure() }}
104113
uses: actions/upload-artifact@v4

.github/workflows/package.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ jobs:
3232

3333
steps:
3434
- name: Setup .NET
35-
uses: actions/setup-dotnet@v4
35+
uses: actions/setup-dotnet@v5
3636
with:
3737
dotnet-version: |
3838
8.0.*
3939
9.0.*
40+
10.0.*
4041
4142
- name: Git checkout
4243
uses: actions/checkout@v4
@@ -146,7 +147,7 @@ jobs:
146147
path: packages
147148

148149
- name: Setup .NET
149-
uses: actions/setup-dotnet@v4
150+
uses: actions/setup-dotnet@v5
150151
with:
151152
dotnet-version: 8.0.*
152153

@@ -206,9 +207,9 @@ jobs:
206207
path: packages
207208

208209
- name: Setup .NET
209-
uses: actions/setup-dotnet@v4
210+
uses: actions/setup-dotnet@v5
210211
with:
211-
dotnet-version: 8.0.x
212+
dotnet-version: 8.0.*
212213
source-url: ${{ vars.AZURE_ARTIFACTS_FEED_URL }}
213214
env:
214215
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -237,9 +238,9 @@ jobs:
237238

238239
steps:
239240
- name: Setup .NET
240-
uses: actions/setup-dotnet@v4
241+
uses: actions/setup-dotnet@v5
241242
with:
242-
dotnet-version: 8.0.x
243+
dotnet-version: 8.0.*
243244

244245
- name: Download signed packages
245246
uses: actions/download-artifact@v4

.github/workflows/scan-vulnerable-dependencies.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ jobs:
2828

2929
steps:
3030
- name: Setup .NET
31-
uses: actions/setup-dotnet@v4
31+
uses: actions/setup-dotnet@v5
3232
with:
3333
dotnet-version: |
3434
8.0.*
3535
9.0.*
36+
10.0.*
3637
3738
- name: Git checkout
3839
uses: actions/checkout@v4

.github/workflows/sonarcube.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ env:
2828
jobs:
2929
analyze:
3030
name: Analyze
31-
timeout-minutes: 30
31+
timeout-minutes: 60
3232
runs-on: ubuntu-latest
3333

3434
services:
@@ -48,11 +48,12 @@ jobs:
4848

4949
steps:
5050
- name: Setup .NET
51-
uses: actions/setup-dotnet@v4
51+
uses: actions/setup-dotnet@v5
5252
with:
5353
dotnet-version: |
5454
8.0.*
5555
9.0.*
56+
10.0.*
5657
5758
- name: Install Sonar .NET Scanner
5859
run: dotnet tool install --global dotnet-sonarscanner
@@ -78,17 +79,23 @@ jobs:
7879
- name: Build solution
7980
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
8081

81-
- name: Test (net8.0)
82-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net8.0 ${{ env.SONAR_TEST_ARGS }}
82+
- name: Test (net10.0)
83+
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net10.0 ${{ env.SONAR_TEST_ARGS }}
8384

84-
- name: Test (net8.0) (memory dumps)
85-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net8.0 ${{ env.SONAR_TEST_ARGS }}
85+
- name: Test (net10.0) (memory dumps)
86+
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net10.0 ${{ env.SONAR_TEST_ARGS }}
8687

8788
- name: Test (net9.0)
88-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net9.0 ${{ env.SONAR_TEST_ARGS }}
89+
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net9.0 ${{ env.SONAR_TEST_ARGS }}
8990

9091
- name: Test (net9.0) (memory dumps)
91-
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net9.0 ${{ env.SONAR_TEST_ARGS }}
92+
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net9.0 ${{ env.SONAR_TEST_ARGS }}
93+
94+
- name: Test (net8.0)
95+
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net8.0 ${{ env.SONAR_TEST_ARGS }}
96+
97+
- name: Test (net8.0) (memory dumps)
98+
run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net8.0 ${{ env.SONAR_TEST_ARGS }}
9299

93100
- name: End Sonar .NET scanner
94101
if: ${{ !cancelled() && steps.sonar_begin.outcome == 'success' }}

.github/workflows/verify-code-style.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ jobs:
2727

2828
steps:
2929
- name: Setup .NET
30-
uses: actions/setup-dotnet@v4
30+
uses: actions/setup-dotnet@v5
3131
with:
3232
dotnet-version: |
3333
8.0.*
3434
9.0.*
35+
10.0.*
3536
3637
- name: Git checkout
3738
uses: actions/checkout@v4

nuget.config

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@
33
<packageSources>
44
<clear />
55
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6-
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
76
</packageSources>
87
<packageSourceMapping>
98
<packageSource key="nuget.org">
109
<package pattern="*" />
1110
</packageSource>
12-
<packageSource key="dotnet-libraries">
13-
<!-- Required for .NET Aspire Configuration Schema Generator, which needs System.CommandLine. -->
14-
<package pattern="System.CommandLine" />
15-
</packageSource>
1611
</packageSourceMapping>
1712
</configuration>

shared-package.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
3434
</PropertyGroup>
3535

36+
<PropertyGroup>
37+
<!--
38+
Temporary workaround for CA1873: Evaluation of this argument may be expensive and unnecessary if logging is disabled.
39+
Should be revisited as part of https://github.com/SteeltoeOSS/Steeltoe/issues/969.
40+
-->
41+
<NoWarn>$(NoWarn);CA1873</NoWarn>
42+
</PropertyGroup>
43+
3644
<PropertyGroup Condition="'$(CI)' != ''">
3745
<!--
3846
While deterministic builds are enabled by default in .NET SDK projects, there is an extra property, ContinuousIntegrationBuild,

shared.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
<NoWarn>$(NoWarn);IDE0051;IDE0052</NoWarn>
2121
</PropertyGroup>
2222

23+
<PropertyGroup Condition="'$(TargetFramework)' != 'net8.0' And '$(TargetFramework)' != 'net9.0'">
24+
<!--
25+
Suppress new obsolete warnings for WebHostBuilder and WebHost on .NET 10 and higher.
26+
-->
27+
<NoWarn>$(NoWarn);ASPDEPR004;ASPDEPR008</NoWarn>
28+
</PropertyGroup>
29+
2330
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
2431
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)\Steeltoe.Debug.ruleset</CodeAnalysisRuleSet>
2532
</PropertyGroup>

0 commit comments

Comments
 (0)