diff --git a/.github/workflows/continuous.integration.yml b/.github/workflows/continuous.integration.yml
index 114c0b6..72b0718 100644
--- a/.github/workflows/continuous.integration.yml
+++ b/.github/workflows/continuous.integration.yml
@@ -1,28 +1,34 @@
----
name: Continuous Integration Check
on:
pull_request:
branches: [ main ]
- types: [ opened, synchronize, reopened, ready_for_review ]
+ workflow_dispatch:
-jobs:
+permissions: read-all
+
+env:
+ GH_PKG_USER: ${{ secrets.GH_PKG_USER }}
+ GH_PKG_TOKEN: ${{ secrets.GH_PKG_TOKEN }}
+jobs:
ci:
+ name: Continuous Integration Check
runs-on: ubuntu-latest
+
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
- - name: Setup .NET Core 7.0.x
- uses: actions/setup-dotnet@v3
+ - name: Setup .NET SDK
+ uses: actions/setup-dotnet@v4
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml
index 2069b07..3e8a189 100644
--- a/.github/workflows/linter.yml
+++ b/.github/workflows/linter.yml
@@ -1,27 +1,27 @@
----
name: Lint Code Base
on:
pull_request:
- branches: [ main ]
- types: [ opened, synchronize, reopened, ready_for_review ]
+ branches: [main]
-jobs:
- lint:
+permissions:
+ contents: read
+ statuses: write
+jobs:
+ build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Lint Code Base
- uses: github/super-linter@v5
+ uses: super-linter/super-linter@v6
env:
VALIDATE_ALL_CODEBASE: false
- VALIDATE_EDITORCONFIG: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/nuget.publish.yml b/.github/workflows/nuget.publish.yml
index e40d0ac..42ebc52 100644
--- a/.github/workflows/nuget.publish.yml
+++ b/.github/workflows/nuget.publish.yml
@@ -1,4 +1,3 @@
----
name: Publish NuGet package
on:
@@ -7,6 +6,10 @@ on:
push:
branches: [ main ]
+permissions:
+ contents: read
+ pull-requests: read
+
jobs:
publish:
@@ -16,14 +19,14 @@ jobs:
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
- - name: Setup .NET Core 7.0.x
+ - name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
diff --git a/src/Confluent.Kafka.Extensions.Diagnostics/Confluent.Kafka.Extensions.Diagnostics.csproj b/src/Confluent.Kafka.Extensions.Diagnostics/Confluent.Kafka.Extensions.Diagnostics.csproj
index b833bf3..674d8db 100644
--- a/src/Confluent.Kafka.Extensions.Diagnostics/Confluent.Kafka.Extensions.Diagnostics.csproj
+++ b/src/Confluent.Kafka.Extensions.Diagnostics/Confluent.Kafka.Extensions.Diagnostics.csproj
@@ -3,7 +3,7 @@
enable
enable
- net6.0
+ net6.0;net8.0
true
true
@@ -26,12 +26,12 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Confluent.Kafka.Extensions.Diagnostics/ProducerBuilderExtensions.cs b/src/Confluent.Kafka.Extensions.Diagnostics/ProducerBuilderExtensions.cs
index e86f4a6..5b7140b 100644
--- a/src/Confluent.Kafka.Extensions.Diagnostics/ProducerBuilderExtensions.cs
+++ b/src/Confluent.Kafka.Extensions.Diagnostics/ProducerBuilderExtensions.cs
@@ -11,7 +11,7 @@ public static class ProducerBuilderExtensions
public static IProducer BuildWithInstrumentation(
this ProducerBuilder producerBuilder)
{
- if (producerBuilder == null) throw new ArgumentNullException(nameof(producerBuilder));
+ ArgumentNullException.ThrowIfNull(producerBuilder);
return new InstrumentedProducer(producerBuilder.Build());
}
diff --git a/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/Confluent.Kafka.Extensions.Diagnostics.Tests.csproj b/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/Confluent.Kafka.Extensions.Diagnostics.Tests.csproj
index 1687f91..1ec24f8 100644
--- a/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/Confluent.Kafka.Extensions.Diagnostics.Tests.csproj
+++ b/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/Confluent.Kafka.Extensions.Diagnostics.Tests.csproj
@@ -9,18 +9,17 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/__snapshots__/KafkaDiagnosticsTests.DependentProduce.snap b/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/__snapshots__/KafkaDiagnosticsTests.DependentProduce.snap
index 502162a..a1791c3 100644
--- a/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/__snapshots__/KafkaDiagnosticsTests.DependentProduce.snap
+++ b/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/__snapshots__/KafkaDiagnosticsTests.DependentProduce.snap
@@ -1,10 +1,9 @@
{
"Status": "Ok",
"StatusDescription": null,
- "HasRemoteParent": false,
"Kind": "Producer",
- "OperationName": "produce_topic publish",
- "DisplayName": "produce_topic publish",
+ "OperationName": "dependent_produce_topic publish",
+ "DisplayName": "dependent_produce_topic publish",
"Source": {
"Name": "Confluent.Kafka.Extensions.Diagnostics",
"Version": ""
@@ -26,7 +25,7 @@
},
{
"Key": "messaging.destination.name",
- "Value": "produce_topic"
+ "Value": "dependent_produce_topic"
},
{
"Key": "messaging.kafka.destination.partition",
@@ -54,6 +53,5 @@
"IsAllDataRequested": false,
"ActivityTraceFlags": "None",
"ParentSpanId": {},
- "IsStopped": true,
"IdFormat": "W3C"
}
diff --git a/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/__snapshots__/KafkaDiagnosticsTests.DependentProduceAsync.snap b/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/__snapshots__/KafkaDiagnosticsTests.DependentProduceAsync.snap
index e1a35ba..fd24eb6 100644
--- a/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/__snapshots__/KafkaDiagnosticsTests.DependentProduceAsync.snap
+++ b/tests/Confluent.Kafka.Extensions.Diagnostics.Tests/__snapshots__/KafkaDiagnosticsTests.DependentProduceAsync.snap
@@ -1,10 +1,9 @@
{
"Status": "Ok",
"StatusDescription": null,
- "HasRemoteParent": false,
"Kind": "Producer",
- "OperationName": "produce_async_topic publish",
- "DisplayName": "produce_async_topic publish",
+ "OperationName": "dependent_produce_async_topic publish",
+ "DisplayName": "dependent_produce_async_topic publish",
"Source": {
"Name": "Confluent.Kafka.Extensions.Diagnostics",
"Version": ""
@@ -26,7 +25,7 @@
},
{
"Key": "messaging.destination.name",
- "Value": "produce_async_topic"
+ "Value": "dependent_produce_async_topic"
},
{
"Key": "messaging.kafka.destination.partition",
@@ -34,7 +33,7 @@
},
{
"Key": "messaging.kafka.message.offset",
- "Value": "1"
+ "Value": "0"
}
],
"Events": [],
@@ -54,6 +53,5 @@
"IsAllDataRequested": false,
"ActivityTraceFlags": "None",
"ParentSpanId": {},
- "IsStopped": true,
"IdFormat": "W3C"
}