Skip to content

Commit 19d3946

Browse files
authored
Merge pull request kurrent-io#4031 from EventStore/pvanbuijtene/net7-upgrade
Upgrade to .NET 7 (DB-460)
2 parents d308572 + 8f149ab commit 19d3946

File tree

48 files changed

+115
-95
lines changed

Some content is hidden

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

48 files changed

+115
-95
lines changed

Diff for: .github/workflows/build-container-focal.yml renamed to .github/workflows/build-container-jammy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Focal Container
1+
name: Build Jammy Container
22

33
on:
44
pull_request:
@@ -21,5 +21,5 @@ jobs:
2121
build-container:
2222
uses: ./.github/workflows/build-container-reusable.yml
2323
with:
24-
container-runtime: focal
24+
container-runtime: jammy
2525

Diff for: .github/workflows/build-container-reusable.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 0
21-
- name: Install net6.0
21+
- name: Install net7.0
2222
uses: actions/setup-dotnet@v3
2323
with:
24-
dotnet-version: 6.0.x
24+
dotnet-version: 7.0.x
2525
- name: Setup QEMU
2626
uses: docker/setup-qemu-action@v2
2727
- name: Set up Docker Buildx
@@ -44,7 +44,7 @@ jobs:
4444
key: "${{ inputs.container-runtime }}"
4545
map: |
4646
{
47-
"focal": {
47+
"jammy": {
4848
"runtime": "linux-x64"
4949
},
5050
"bullseye-slim": {
@@ -102,7 +102,7 @@ jobs:
102102
docker tag eventstore ghcr.io/eventstore/eventstore:${{ env.VERSION }}
103103
docker push ghcr.io/eventstore/eventstore:${{ env.VERSION }}
104104
- name: Push GitHub Container Registry (CI)
105-
if: always() && github.event_name == 'push' && inputs.container-runtime == 'focal' && github.ref == 'refs/heads/master'
105+
if: always() && github.event_name == 'push' && inputs.container-runtime == 'jammy' && github.ref == 'refs/heads/master'
106106
shell: bash
107107
run: |
108108
docker tag eventstore ghcr.io/eventstore/eventstore:ci

Diff for: .github/workflows/build-reusable.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
uses: actions/setup-dotnet@v3
2929
with:
3030
dotnet-version: 3.1.x
31-
- name: Install net6.0
31+
- name: Install net7.0
3232
uses: actions/setup-dotnet@v3
3333
with:
34-
dotnet-version: 6.0.x
34+
dotnet-version: 7.0.x
3535
- name: Clear Nuget Cache
3636
shell: powershell
3737
if: inputs.os == 'windows-2019'

Diff for: .github/workflows/common.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@v3
27-
- name: Install net6.0
27+
- name: Install net7.0
2828
uses: actions/setup-dotnet@v3
2929
with:
30-
dotnet-version: 6.0.x
30+
dotnet-version: 7.0.x
3131
- name: Scan for Vulnerabilities
3232
run: |
3333
cd src

Diff for: Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# "build" image
2-
ARG CONTAINER_RUNTIME=focal
3-
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
2+
ARG CONTAINER_RUNTIME=jammy
3+
FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy AS build
44
ARG RUNTIME=linux-x64
55

66
WORKDIR /build/ci
@@ -31,7 +31,7 @@ RUN find /build/src -maxdepth 1 -type d -name "*.Tests" -print0 | xargs -I{} -0
3131
'dotnet publish --runtime=${RUNTIME} --no-self-contained --configuration Release --output /build/published-tests/`basename $1` $1' - '{}'
3232

3333
# "test" image
34-
FROM mcr.microsoft.com/dotnet/sdk:6.0-${CONTAINER_RUNTIME} as test
34+
FROM mcr.microsoft.com/dotnet/sdk:7.0-${CONTAINER_RUNTIME} as test
3535
WORKDIR /build
3636
COPY --from=build ./build/published-tests ./published-tests
3737
COPY --from=build ./build/ci ./ci
@@ -53,10 +53,10 @@ FROM build as publish
5353
ARG RUNTIME=linux-x64
5454

5555
RUN dotnet publish --configuration=Release --runtime=${RUNTIME} --self-contained \
56-
--framework=net6.0 --output /publish EventStore.ClusterNode
56+
--framework=net7.0 --output /publish EventStore.ClusterNode
5757

5858
# "runtime" image
59-
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-${CONTAINER_RUNTIME} AS runtime
59+
FROM mcr.microsoft.com/dotnet/runtime-deps:7.0-${CONTAINER_RUNTIME} AS runtime
6060
ARG RUNTIME=linux-x64
6161
ARG UID=1000
6262
ARG GID=1000

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ The build scripts: `build.sh` and `build.ps1` are also available for Linux and W
116116
To start a single node, you can then run:
117117

118118
```
119-
dotnet ./src/EventStore.ClusterNode/bin/x64/Release/net6.0/EventStore.ClusterNode.dll --dev --db ./tmp/data --index ./tmp/index --log ./tmp/log
119+
dotnet ./src/EventStore.ClusterNode/bin/x64/Release/net7.0/EventStore.ClusterNode.dll --dev --db ./tmp/data --index ./tmp/index --log ./tmp/log
120120
```
121121

122122
### Running the tests
@@ -160,9 +160,9 @@ Currently, we support the following configurations:
160160
- `CONTAINER_RUNTIME=bullseye-slim`
161161
- `RUNTIME=linux-x64`
162162

163-
2. Focal:
163+
2. Jammy:
164164

165-
- `CONTAINER_RUNTIME=focal`
165+
- `CONTAINER_RUNTIME=Jammy`
166166
- `RUNTIME=linux-x64`
167167

168168
3. Alpine:
@@ -194,4 +194,4 @@ docker run --rm myeventstore --insecure --what-if
194194

195195
![Build](https://github.com/EventStore/EventStore/actions/workflows/build-container-bullseye-slim.yml/badge.svg)
196196

197-
![Build](https://github.com/EventStore/EventStore/actions/workflows/build-container-focal.yml/badge.svg)
197+
![Build](https://github.com/EventStore/EventStore/actions/workflows/build-container-jammy.yml/badge.svg)

Diff for: build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COPYRIGHT="Copyright 2021 Event Store Ltd. All rights reserved."
1010

1111
CONFIGURATION="Release"
1212
BUILD_UI="no"
13-
NET_FRAMEWORK="net6.0"
13+
NET_FRAMEWORK="net7.0"
1414

1515
function usage() {
1616
cat <<EOF

Diff for: src/EventStore.BufferManagement.Tests/EventStore.BufferManagement.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<DebugSymbols>true</DebugSymbols>
77
<Platforms>x64;ARM64</Platforms>

Diff for: src/EventStore.BufferManagement/EventStore.BufferManagement.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<Platforms>x64;ARM64</Platforms>
77
</PropertyGroup>

Diff for: src/EventStore.ClusterNode.Web/EventStore.ClusterNode.Web.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<Platforms>x64;ARM64</Platforms>
77
</PropertyGroup>

Diff for: src/EventStore.ClusterNode/EventStore.ClusterNode.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<OutputType>Exe</OutputType>
77
<ApplicationIcon>app2.ico</ApplicationIcon>

Diff for: src/EventStore.Common.Tests/Configuration/ConfigurationRootExtensionsTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class ConfigurationRootExtensionsTest {
1010

1111
[Fact]
1212
public void successful_comma_separated_value() {
13-
var config = new Dictionary<string, string> {
13+
var config = new Dictionary<string, string?> {
1414
{ GOSSIP_SEED, "nodeb.eventstore.test:2113,nodec.eventstore.test:3113" }
1515
};
1616
IConfigurationRoot configuration = MemoryConfigurationBuilderExtensions
@@ -24,7 +24,7 @@ public void successful_comma_separated_value() {
2424

2525
[Fact]
2626
public void invalid_delimiter() {
27-
var config = new Dictionary<string, string> {
27+
var config = new Dictionary<string, string?> {
2828
{ GOSSIP_SEED, "nodeb.eventstore.test:2113;nodec.eventstore.test:3113" }
2929
};
3030
IConfigurationRoot configuration = MemoryConfigurationBuilderExtensions
@@ -38,7 +38,7 @@ public void invalid_delimiter() {
3838

3939
[Fact]
4040
public void mixed_invalid_delimiter() {
41-
var config = new Dictionary<string, string> {
41+
var config = new Dictionary<string, string?> {
4242
{ GOSSIP_SEED, "nodea.eventstore.test:2113,nodeb.eventstore.test:2113;nodec.eventstore.test:3113" }
4343
};
4444

Diff for: src/EventStore.Common.Tests/EventStore.Common.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33

44
<PropertyGroup>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net7.0</TargetFramework>
66
<Platforms>x64;ARM64</Platforms>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>

Diff for: src/EventStore.Common.Utils/EventStore.Common.Utils.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<Platforms>x64;ARM64</Platforms>
66
</PropertyGroup>
77
<ItemGroup>

Diff for: src/EventStore.Common/Configuration/ConfigurationBuilderExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static IConfigurationBuilder AddEventStore(this IConfigurationBuilder con
1919
var root = builder.Build(); // need to build twice as on disk config is configurable
2020

2121
var yamlSource = new YamlSource {
22-
Path = root.GetValue<string>(configFileKey),
22+
Path = root.GetString(configFileKey),
2323
Optional = !root.IsUserSpecified(configFileKey),
2424
ReloadOnChange = true
2525
};

Diff for: src/EventStore.Common/Configuration/ConfigurationRootExtensions.cs

+4
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,9 @@ public static string GetEnvironmentOption(PropertyInfo property, int optionColum
7878

7979
return builder.ToString().PadRight(optionColumnWidth, ' ') + description;
8080
}
81+
82+
public static string GetString(this IConfigurationRoot configurationRoot, string key) {
83+
return configurationRoot.GetValue<string>(key) ?? string.Empty;
84+
}
8185
}
8286
}

Diff for: src/EventStore.Common/EventStore.Common.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<Platforms>x64;ARM64</Platforms>
77
</PropertyGroup>

Diff for: src/EventStore.Core.Tests/ClientAPI/connect.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ namespace EventStore.Core.Tests.ClientAPI {
1313
[TestFixture(typeof(LogFormat.V3), typeof(uint), TcpType.Normal)]
1414
[TestFixture(typeof(LogFormat.V2), typeof(string), TcpType.Ssl)]
1515
[TestFixture(typeof(LogFormat.V3), typeof(uint), TcpType.Ssl)]
16-
public class connect<TLogFormat, TStreamId> : SpecificationWithDirectoryPerTestFixture {
16+
public class Connect<TLogFormat, TStreamId> : SpecificationWithDirectoryPerTestFixture {
1717
private readonly TcpType _tcpType;
1818

19-
public connect(TcpType tcpType) {
19+
public Connect(TcpType tcpType) {
2020
_tcpType = tcpType;
2121
}
2222

Diff for: src/EventStore.Core.Tests/ClientAPI/transaction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace EventStore.Core.Tests.ClientAPI {
1414
[Category("ClientAPI"), Category("LongRunning")]
1515
[TestFixture(typeof(LogFormat.V2), typeof(string))]
1616
[TestFixture(typeof(LogFormat.V3), typeof(uint), Ignore = "Explicit transactions are not supported yet by Log V3")]
17-
public class transaction<TLogFormat, TStreamId> : SpecificationWithDirectoryPerTestFixture {
17+
public class Transaction<TLogFormat, TStreamId> : SpecificationWithDirectoryPerTestFixture {
1818
private MiniNode<TLogFormat, TStreamId> _node;
1919

2020
[OneTimeSetUp]

Diff for: src/EventStore.Core.Tests/EventStore.Core.Tests.csproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<Platforms>x64;ARM64</Platforms>
@@ -27,7 +27,6 @@
2727

2828
</ItemGroup>
2929
<ItemGroup>
30-
<ProjectReference Include="..\EventStore.ClusterNode\EventStore.ClusterNode.csproj" />
3130
<ProjectReference Include="..\EventStore.Common\EventStore.Common.csproj" />
3231
<ProjectReference Include="..\EventStore.Core\EventStore.Core.csproj" />
3332
<ProjectReference Include="..\EventStore.PluginHosting\EventStore.PluginHosting.csproj" />
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
</PropertyGroup>
66

77
</Project>

Diff for: src/EventStore.Core.Tests/Http/Streams/filtered.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using EventStore.Transport.Http;
1010

1111
namespace EventStore.Core.Tests.Http.Streams {
12-
public class filtered {
12+
public class Filtered {
1313
public abstract class SpecificationWithLongFeed<TLogFormat, TStreamId> : with_admin_user<TLogFormat, TStreamId> {
1414
protected int NumberOfEvents;
1515

Diff for: src/EventStore.Core.Tests/Services/Transport/Http/Authentication/rfc_2898_password_hash_algorithm.cs

+18
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,23 @@ public void generates_different_hashes() {
5555
Assert.That(_hash1 != _hash2);
5656
}
5757
}
58+
59+
[TestFixture]
60+
public class when_upgrading_the_hashes {
61+
private Rfc2898PasswordHashAlgorithm _algorithm;
62+
private readonly string _password = "Pa55w0rd!";
63+
private readonly string _hash = "HKoq6xw3Oird4KqU4RyoY9aFFRc=";
64+
private readonly string _salt = "+6eoSEkays/BOpzGMLE6Uw==";
65+
66+
[SetUp]
67+
public void SetUp() {
68+
_algorithm = new Rfc2898PasswordHashAlgorithm();
69+
}
70+
71+
[Test]
72+
public void old_hashes_should_successfully_verify() {
73+
Assert.True(_algorithm.Verify(_password, _hash, _salt));
74+
}
75+
}
5876
}
5977
}

Diff for: src/EventStore.Core.Tests/options.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace EventStore.Core.Tests {
1818
[TestFixture]
19-
public class options {
19+
public class Options {
2020
[TestCaseSource(typeof(ParseCaseData), nameof(ParseCaseData.TestCases))]
2121
public object are_parsed_correctly_when_well_formed(string option, string[] args) {
2222
var sut = new TestOptions(args);

Diff for: src/EventStore.Core.XUnit.Tests/EventStore.Core.XUnit.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<Platforms>x64;ARM64</Platforms>

Diff for: src/EventStore.Core.XUnit.Tests/Metrics/ProcessMetricsTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void can_collect_proc_up_time() {
103103
[Fact]
104104
public void can_collect_proc_cpu() {
105105
Assert.Collection(
106-
_intListener.RetrieveMeasurements("eventstore-proc-cpu"),
106+
_doubleListener.RetrieveMeasurements("eventstore-proc-cpu"),
107107
m => {
108108
Assert.True(m.Value >= 0);
109109
Assert.Empty(m.Tags);
@@ -228,7 +228,7 @@ public void can_collect_gc_generation_size() {
228228
Assert.Collection(
229229
_longListener.RetrieveMeasurements("eventstore-gc-generation-size-bytes"),
230230
m => {
231-
Assert.True(m.Value > 0);
231+
Assert.True(m.Value >= 0);
232232
Assert.Collection(
233233
m.Tags,
234234
tag => {

Diff for: src/EventStore.Core.XUnit.Tests/PluginLoaderTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private static async Task BuildFakePlugin(DirectoryInfo outputFolder) {
8888
using var process = new Process {
8989
StartInfo = new ProcessStartInfo {
9090
FileName = "dotnet",
91-
Arguments = $"publish --configuration {BuildConfiguration} --framework=net6.0 --output {outputFolder.FullName}",
91+
Arguments = $"publish --configuration {BuildConfiguration} --framework=net7.0 --output {outputFolder.FullName}",
9292
WorkingDirectory = PluginSourceDirectory,
9393
UseShellExecute = false,
9494
RedirectStandardError = true,

Diff for: src/EventStore.Core/ClusterVNodeOptions.Framework.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static ClusterVNodeOptions() {
5151
from option in section.GetProperties()
5252
let deprecationWarning = option.GetCustomAttribute<DeprecatedAttribute>()?.Message
5353
where deprecationWarning is not null
54-
let value = ConfigurationRoot.GetValue<string?>(option.Name)
54+
let value = ConfigurationRoot?.GetValue<string?>(option.Name)
5555
where defaultValues.TryGetValue(option.Name, out var defaultValue)
5656
&& !string.Equals(value, defaultValue?.ToString(), StringComparison.OrdinalIgnoreCase)
5757
select deprecationWarning;

0 commit comments

Comments
 (0)