Skip to content

Commit 15f06d3

Browse files
authored
.NET 8 added as a target to all projects and tests and NJsonSchema 11 support (#2314)
* .NET 8 added as a target to all projects and tests except examples that are built with the oldest supported version. Semaphore is using latest version for integration tests and both version for unit tests. * Targets netstandard2.0 on libraries for greater compatibility: - .net 2.0+ - .NET Framework 4.6.1+ - Mono 5.4+ - Xamarin, Unity Newer projects such as Rules and Encryption are excluded * NJonSchema conditional upgrade for .NET 8.0 * Run unit tests with both .NET 6 and 8 * macOS runs only .NET 8 unit tests * Changelog entry
1 parent 89fb58c commit 15f06d3

File tree

38 files changed

+579
-457
lines changed

38 files changed

+579
-457
lines changed

.semaphore/semaphore.yml

+37-34
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: v1.0
22
name: 'confluent-kafka-dotnet build pipeline'
33
agent:
44
machine:
5-
type: s1-prod-ubuntu20-04-amd64-1
5+
type: s1-prod-ubuntu22-04-amd64-1
66
global_job_config:
77
prologue:
88
commands:
@@ -19,10 +19,15 @@ blocks:
1919
task:
2020
agent:
2121
machine:
22-
type: s1-prod-ubuntu20-04-amd64-2
22+
type: s1-prod-ubuntu22-04-amd64-2
2323
jobs:
2424
- name: 'Build and test'
2525
commands:
26+
# TODO: install .NET 8.0 SDK in this agent image
27+
- sudo apt remove dotnet-sdk* dotnet-host* dotnet* aspnetcore* netstandard* -y
28+
# TODO: remove incorrect focal repos from this agent
29+
- sudo rm /etc/apt/sources.list.d/*microsoft*
30+
- sudo apt update && sudo apt install -y dotnet-sdk-6.0 dotnet-sdk-8.0
2631
- dotnet restore
2732
- make build
2833
- make test
@@ -36,9 +41,11 @@ blocks:
3641
- name: 'Build and test'
3742
commands:
3843
- ulimit -n 1024
39-
- dotnet restore
40-
- make build
41-
- make test
44+
# TODO: install .NET 8.0 SDK in this agent image
45+
- sudo chown -R "$(whoami)" "$(brew --caskroom)"
46+
- brew install --appdir=~/Applications dotnet-sdk
47+
- dotnet restore -p:TargetFramework=net8.0
48+
- make test-latest
4249
- name: 'Windows x64'
4350
dependencies: [ ]
4451
task:
@@ -49,12 +56,12 @@ blocks:
4956
- name: 'Build and test'
5057
commands:
5158
- wget https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1
52-
- powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Version 6.0.403 -InstallDir C:\dotnet
59+
- powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Channel 8.0 -Quality GA -InstallDir C:\dotnet
5360
- $Env:Path += ";C:\dotnet"
5461
- dotnet restore
55-
- dotnet test -c ${CONFIGURATION} --no-build test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj
56-
- dotnet test -c ${CONFIGURATION} --no-build test/Confluent.SchemaRegistry.UnitTests/Confluent.SchemaRegistry.UnitTests.csproj
57-
- dotnet test -c ${CONFIGURATION} --no-build test/Confluent.SchemaRegistry.Serdes.UnitTests/Confluent.SchemaRegistry.Serdes.UnitTests.csproj
62+
- dotnet test -f net8.0 -c ${CONFIGURATION} --no-build test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj
63+
- dotnet test -f net8.0 -c ${CONFIGURATION} --no-build test/Confluent.SchemaRegistry.UnitTests/Confluent.SchemaRegistry.UnitTests.csproj
64+
- dotnet test -f net8.0 -c ${CONFIGURATION} --no-build test/Confluent.SchemaRegistry.Serdes.UnitTests/Confluent.SchemaRegistry.Serdes.UnitTests.csproj
5865
- name: 'Windows Artifacts on untagged commits'
5966
run:
6067
when: "tag !~ '.*'"
@@ -68,7 +75,8 @@ blocks:
6875
- name: 'Build and push artifacts'
6976
commands:
7077
- wget https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1
71-
- powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Version 6.0.403 -InstallDir C:\dotnet
78+
- powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Channel 6.0 -Quality GA -InstallDir C:\dotnet
79+
- powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Channel 8.0 -Quality GA -InstallDir C:\dotnet
7280
- $Env:Path += ";C:\dotnet"
7381
- dotnet restore
7482
- dotnet build Confluent.Kafka.sln -c ${Env:CONFIGURATION}
@@ -97,7 +105,8 @@ blocks:
97105
- name: 'Build and push artifacts'
98106
commands:
99107
- wget https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1
100-
- powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Version 6.0.403 -InstallDir C:\dotnet
108+
- powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Channel 6.0 -Quality GA -InstallDir C:\dotnet
109+
- powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Channel 8.0 -Quality GA -InstallDir C:\dotnet
101110
- $Env:Path += ";C:\dotnet"
102111
- dotnet restore
103112
- dotnet build Confluent.Kafka.sln -c ${Env:CONFIGURATION}
@@ -113,49 +122,43 @@ blocks:
113122
- dotnet pack src/Confluent.SchemaRegistry.Serdes.Protobuf/Confluent.SchemaRegistry.Serdes.Protobuf.csproj -c ${Env:CONFIGURATION} --output artifacts
114123
- dotnet pack src/Confluent.SchemaRegistry.Serdes.Json/Confluent.SchemaRegistry.Serdes.Json.csproj -c ${Env:CONFIGURATION} --output artifacts
115124
- artifact push workflow artifacts
116-
- name: 'Integration tests'
125+
- name: 'Integration tests and documentation'
117126
dependencies: [ ]
118127
task:
119128
agent:
120129
machine:
121-
type: s1-prod-ubuntu20-04-amd64-2
130+
type: s1-prod-ubuntu22-04-amd64-2
122131
prologue:
123132
commands:
124133
- '[[ -z $DOCKERHUB_APIKEY ]] || docker login --username $DOCKERHUB_USER --password $DOCKERHUB_APIKEY'
134+
# TODO: install .NET 8.0 SDK in this agent image
135+
- sudo apt remove dotnet-sdk* dotnet-host* dotnet* aspnetcore* netstandard* -y
136+
# TODO: remove incorrect focal repos from this agent
137+
- sudo rm /etc/apt/sources.list.d/*microsoft*
138+
- sudo apt update && sudo apt install -y dotnet-sdk-8.0
125139
jobs:
126140
- name: 'Build documentation'
127141
commands:
128-
- dotnet tool update -g docfx
129-
- docfx doc/docfx.json
142+
- dotnet tool update --tool-path $PWD docfx
143+
- ./docfx doc/docfx.json
130144
- name: 'Build and test with "classic" protocol'
131145
commands:
132146
- cd test/docker && docker-compose up -d && sleep 30 && cd ../..
133147
- export SEMAPHORE_SKIP_FLAKY_TESTS='true'
134-
- dotnet restore
135-
- cd test/Confluent.Kafka.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
148+
- dotnet restore -p:TargetFramework=net8.0
149+
- cd test/Confluent.Kafka.IntegrationTests && dotnet test -f net8.0 -l "console;verbosity=normal" && cd ../..
136150
- name: 'Build and test with "consumer" protocol'
137151
commands:
138152
- cd test/docker && docker-compose -f docker-compose-kraft.yaml up -d && cd ../..
139153
- sleep 300
140154
- export SEMAPHORE_SKIP_FLAKY_TESTS='true'
141155
- export TEST_CONSUMER_GROUP_PROTOCOL=consumer
142-
- dotnet restore
143-
- cd test/Confluent.Kafka.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
144-
145-
- name: 'Schema registry and serdes integration tests'
146-
dependencies: [ ]
147-
task:
148-
agent:
149-
machine:
150-
type: s1-prod-ubuntu20-04-amd64-2
151-
prologue:
152-
commands:
153-
- '[[ -z $DOCKERHUB_APIKEY ]] || docker login --username $DOCKERHUB_USER --password $DOCKERHUB_APIKEY'
154-
jobs:
155-
- name: 'Build and test'
156+
- dotnet restore -p:TargetFramework=net8.0
157+
- cd test/Confluent.Kafka.IntegrationTests && dotnet test -f net8.0 -l "console;verbosity=normal" && cd ../..
158+
- name: 'Schema registry and serdes integration tests'
156159
commands:
157160
- cd test/docker && docker-compose up -d && cd ../..
158161
- export SEMAPHORE_SKIP_FLAKY_TESTS='true'
159-
- dotnet restore
160-
- cd test/Confluent.SchemaRegistry.Serdes.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
161-
# - cd test/Confluent.SchemaRegistry.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
162+
- dotnet restore -p:TargetFramework=net8.0
163+
- cd test/Confluent.SchemaRegistry.Serdes.IntegrationTests && dotnet test -f net8.0 -l "console;verbosity=normal" && cd ../..
164+
- cd test/Confluent.SchemaRegistry.IntegrationTests && dotnet test -f net8.0 -l "console;verbosity=normal" && cd ../..

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* References librdkafka.redist 2.6.0. Refer to the [librdkafka v2.6.0 release notes](https://github.com/confluentinc/librdkafka/releases/tag/v2.6.0) for more information.
66
* [KIP-848 EA](https://cwiki.apache.org/confluence/display/KAFKA/KIP-848%3A+The+Next+Generation+of+the+Consumer+Rebalance+Protocol): Admin API for listing consumer groups now has an optional filter to return only groups of given types (#2323).
77
* [KIP-460](https://cwiki.apache.org/confluence/display/KAFKA/KIP-460%3A+Admin+Leader+Election+RPC) Admin Leader Election RPC (#2320)
8+
* .NET 8 support with NJsonSchema 11 (#2314)
89

910

1011
# 2.5.3

Makefile

+10-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ EXAMPLE_DIRS=$(shell find ./examples -name '*.csproj' -exec dirname {} \;)
1010
TEST_DIRS=$(shell find ./test -name '*.csproj' \;)
1111
UNIT_TEST_DIRS=$(shell find . -type d -regex '.*UnitTests$$' -exec basename {} \;)
1212

13-
DEFAULT_FRAMEWORK?=net6.0
13+
# We want to run tests by default with latest version of .NET
14+
DEFAULT_TEST_FRAMEWORK?=net8.0
1415

1516
all:
1617
@echo "Usage: make <dotnet-command>"
@@ -19,10 +20,15 @@ all:
1920
.PHONY: test
2021

2122
build:
22-
for d in $(EXAMPLE_DIRS) ; do dotnet $@ -f $(DEFAULT_FRAMEWORK) $$d; done ; \
23-
for d in $(TEST_DIRS) ; do dotnet $@ -f $(DEFAULT_FRAMEWORK) $$d; done ;
23+
for d in $(EXAMPLE_DIRS) ; do dotnet $@ $$d; done ; \
24+
for d in $(TEST_DIRS) ; do dotnet $@ $$d; done ;
2425

2526
test:
2627
@(for d in $(UNIT_TEST_DIRS) ; do \
27-
dotnet test -f $(DEFAULT_FRAMEWORK) test/$$d/$$d.csproj ; \
28+
dotnet test test/$$d/$$d.csproj ; \
29+
done)
30+
31+
test-latest:
32+
@(for d in $(UNIT_TEST_DIRS) ; do \
33+
dotnet test -f $(DEFAULT_TEST_FRAMEWORK) test/$$d/$$d.csproj ; \
2834
done)

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ client. Thanks Andreas!
3434

3535
confluent-kafka-dotnet is distributed via NuGet. We provide the following packages:
3636

37-
- [Confluent.Kafka](https://www.nuget.org/packages/Confluent.Kafka/) *[net462, netstandard1.3, netstandard2.0]* - The core client library.
38-
- [Confluent.SchemaRegistry.Serdes.Avro](https://www.nuget.org/packages/Confluent.SchemaRegistry.Serdes.Avro/) *[netstandard2.0]* - Provides a serializer and deserializer for working with Avro serialized data with Confluent Schema Registry integration.
39-
- [Confluent.SchemaRegistry.Serdes.Protobuf](https://www.nuget.org/packages/Confluent.SchemaRegistry.Serdes.Protobuf/) *[netstandard2.0]* - Provides a serializer and deserializer for working with Protobuf serialized data with Confluent Schema Registry integration.
40-
- [Confluent.SchemaRegistry.Serdes.Json](https://www.nuget.org/packages/Confluent.SchemaRegistry.Serdes.Json/) *[netstandard2.0]* - Provides a serializer and deserializer for working with Json serialized data with Confluent Schema Registry integration.
41-
- [Confluent.SchemaRegistry](https://www.nuget.org/packages/Confluent.SchemaRegistry/) *[netstandard2.0]* - Confluent Schema Registry client (a dependency of the Confluent.SchemaRegistry.Serdes packages).
42-
- [Confluent.SchemaRegistry.Encryption](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption/) *[netcoreapp3.1, net6.0]* - Confluent Schema Registry client-side field-level encryption client (a dependency of the other Confluent.SchemaRegistry.Encryption.* packages).
43-
- [Confluent.SchemaRegistry.Encryption.Aws](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption.Aws/) *[netcoreapp3.1, net6.0]* - Confluent Schema Registry client-side field-level encryption client for AWS KMS.
44-
- [Confluent.SchemaRegistry.Encryption.Azure](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption.Azure/) *[netcoreapp3.1, net6.0]* - Confluent Schema Registry client-side field-level encryption client for Azure Key Vault.
45-
- [Confluent.SchemaRegistry.Encryption.Gcp](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption.Gcp/) *[netcoreapp3.1, net6.0]* - Confluent Schema Registry client-side field-level encryption client for Google Cloud KMS.
46-
- [Confluent.SchemaRegistry.Encryption.HcVault](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption.HcVault/) *[netcoreapp3.1, net6.0]* - Confluent Schema Registry client-side field-level encryption client for Hashicorp Vault.
47-
- [Confluent.SchemaRegistry.Rules](https://www.nuget.org/packages/Confluent.SchemaRegistry.Rules/) *[net6.0]* - Confluent Schema Registry client-side support for data quality rules (via the Common Expression Language) and schema migration rules (via JSONata).
37+
- [Confluent.Kafka](https://www.nuget.org/packages/Confluent.Kafka/) *[netstandard2.0, net6.0, net8.0]* - The core client library.
38+
- [Confluent.SchemaRegistry.Serdes.Avro](https://www.nuget.org/packages/Confluent.SchemaRegistry.Serdes.Avro/) *[netstandard2.0, net6.0, net8.0]* - Provides a serializer and deserializer for working with Avro serialized data with Confluent Schema Registry integration.
39+
- [Confluent.SchemaRegistry.Serdes.Protobuf](https://www.nuget.org/packages/Confluent.SchemaRegistry.Serdes.Protobuf/) *[netstandard2.0, net6.0, net8.0]* - Provides a serializer and deserializer for working with Protobuf serialized data with Confluent Schema Registry integration.
40+
- [Confluent.SchemaRegistry.Serdes.Json](https://www.nuget.org/packages/Confluent.SchemaRegistry.Serdes.Json/) *[netstandard2.0, net6.0, net8.0]* - Provides a serializer and deserializer for working with Json serialized data with Confluent Schema Registry integration.
41+
- [Confluent.SchemaRegistry](https://www.nuget.org/packages/Confluent.SchemaRegistry/) *[netstandard2.0, net6.0, net8.0]* - Confluent Schema Registry client (a dependency of the Confluent.SchemaRegistry.Serdes packages).
42+
- [Confluent.SchemaRegistry.Encryption](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption/) *[net6.0, net8.0]* - Confluent Schema Registry client-side field-level encryption client (a dependency of the other Confluent.SchemaRegistry.Encryption.* packages).
43+
- [Confluent.SchemaRegistry.Encryption.Aws](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption.Aws/) *[net6.0, net8.0]* - Confluent Schema Registry client-side field-level encryption client for AWS KMS.
44+
- [Confluent.SchemaRegistry.Encryption.Azure](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption.Azure/) *[net6.0, net8.0]* - Confluent Schema Registry client-side field-level encryption client for Azure Key Vault.
45+
- [Confluent.SchemaRegistry.Encryption.Gcp](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption.Gcp/) *[net6.0, net8.0]* - Confluent Schema Registry client-side field-level encryption client for Google Cloud KMS.
46+
- [Confluent.SchemaRegistry.Encryption.HcVault](https://www.nuget.org/packages/Confluent.SchemaRegistry.Encryption.HcVault/) *[net6.0, net8.0]* - Confluent Schema Registry client-side field-level encryption client for Hashicorp Vault.
47+
- [Confluent.SchemaRegistry.Rules](https://www.nuget.org/packages/Confluent.SchemaRegistry.Rules/) *[net6.0, net8.0]* - Confluent Schema Registry client-side support for data quality rules (via the Common Expression Language) and schema migration rules (via JSONata).
4848

4949
To install Confluent.Kafka from within Visual Studio, search for Confluent.Kafka in the NuGet Package Manager UI, or run the following command in the Package Manager Console:
5050

examples/Web/Web.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Confluent.Kafka" Version="2.6.0" />
8+
<!-- nuget package reference: <PackageReference Include="Confluent.Kafka" Version="2.6.0" /> -->
9+
<ProjectReference Include="../../src/Confluent.Kafka/Confluent.Kafka.csproj" />
910
</ItemGroup>
1011

1112
</Project>

src/ConfigGen/ConfigGen.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
66
<LangVersion>7.1</LangVersion>
77
</PropertyGroup>
88

0 commit comments

Comments
 (0)