From 0116279e9f748bbc495f112bae07461bf2babda3 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:15:46 +0100 Subject: [PATCH 01/16] Improved build and perftest scripts * Do not use loops since we only have one project for main sink, one for tests and one for perftests. * Use try-finally blocks to pop back to caller's initial dir on errors. * Fail the build if there were nuget restore errors (e.g. due to known vulns). * build also sample projects on PR (skip them in release.yml and perftests.yml). --- .github/workflows/perftests.yml | 2 +- .github/workflows/release.yml | 2 +- Build.ps1 | 160 +++++++++++++++++++++++--------- RunPerfTests.ps1 | 41 +++++--- 4 files changed, 146 insertions(+), 59 deletions(-) diff --git a/.github/workflows/perftests.yml b/.github/workflows/perftests.yml index d8bc1d45..94776e46 100644 --- a/.github/workflows/perftests.yml +++ b/.github/workflows/perftests.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - name: Run build - run: ./Build.ps1 -SkipTests + run: ./Build.ps1 -SkipTests -SkipSamples shell: pwsh - name: Run performance tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30146df1..f32f18c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: shell: pwsh - name: Run build - run: ./Build.ps1 -SkipTests + run: ./Build.ps1 -SkipTests -SkipSamples shell: pwsh - name: Run performance tests diff --git a/Build.ps1 b/Build.ps1 index 9f020c6d..3633c43f 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -2,61 +2,135 @@ param ( [Parameter(Mandatory = $false)] [Switch] - $SkipTests -) - -echo "build: Build started" - -Push-Location "$PSScriptRoot" - -if (Test-Path .\artifacts) { - echo "build: Cleaning .\artifacts" - Remove-Item .\artifacts -Force -Recurse -} - -& dotnet restore --no-cache + $SkipTests, -$branch = @{ $true = $env:GITHUB_REF_NAME; $false = $(git symbolic-ref --short -q HEAD) }[$env:GITHUB_REF_NAME -ne $NULL] -$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:GITHUB_RUN_NUMBER, 10); $false = "local" }[$env:GITHUB_RUN_NUMBER -ne $NULL] -$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10, $branch.Length)))-$revision" }[$branch -ne "dev" -and $revision -ne "local"] + [Parameter(Mandatory = $false)] + [Switch] + $SkipPerfTests, -echo "build: Version suffix is $suffix" + [Parameter(Mandatory = $false)] + [Switch] + $SkipSamples +) -foreach ($src in Get-ChildItem "$PSScriptRoot/src" -Directory) { - Push-Location $src.FullName +echo "build: Build started" - echo "build: Packaging project in $($src.FullName)" +try +{ + Push-Location "$PSScriptRoot" - if ($suffix) { - & dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix - } else { - & dotnet pack -c Release -o ..\..\artifacts + if (Test-Path .\artifacts) + { + echo "build: Cleaning .\artifacts" + Remove-Item .\artifacts -Force -Recurse } - if ($LASTEXITCODE -ne 0) { exit 1 } - Pop-Location -} - -if ($SkipTests -eq $false) { - foreach ($test in Get-ChildItem "$PSScriptRoot/test" -Filter "*.Tests" -Directory) { - Push-Location $test.FullName - - echo "build: Testing project in $($test.FullName)" - - & dotnet test -c Release --collect "XPlat Code Coverage" - if ($LASTEXITCODE -ne 0) { exit 3 } + echo "build: Restoring packages for solution" + & dotnet restore --no-cache + if ($LASTEXITCODE -ne 0) + { + echo "Error returned by dotnet restore. Aborting build." + exit 1 + } + $branch = @{ $true = $env:GITHUB_REF_NAME; $false = $( git symbolic-ref --short -q HEAD ) }[$env:GITHUB_REF_NAME -ne $NULL] + $revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:GITHUB_RUN_NUMBER, 10); $false = "local" }[$env:GITHUB_RUN_NUMBER -ne $NULL] + $suffix = @{ $true = ""; $false = "$($branch.Substring(0,[math]::Min(10, $branch.Length)) )-$revision" }[$branch -ne "dev" -and $revision -ne "local"] + + echo "build: Version suffix is $suffix" + + $sinkProjectPath = "$PSScriptRoot/src/Serilog.Sinks.MSSqlServer" + try + { + Push-Location "$sinkProjectPath" + + echo "build: Packaging sink main project in $sinkProjectPath" + if ($suffix) + { + & dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix + } + else + { + & dotnet pack -c Release -o ..\..\artifacts + } + if ($LASTEXITCODE -ne 0) + { + echo "Error returned by dotnet pack. Aborting build." + exit 1 + } + } + finally + { Pop-Location } - # The performance benchmark tests should at least build without errors during PR validation - $perfTestProjectPath = "$PSScriptRoot/test/Serilog.Sinks.MSSqlServer.PerformanceTests" - Push-Location "$perfTestProjectPath" + if ($SkipTests -eq $false) + { + $testProjectPath = "$PSScriptRoot/test/Serilog.Sinks.MSSqlServer.Tests" + try + { + Push-Location "$testProjectPath" + + echo "build: Testing project in $testProjectPath" + & dotnet test -c Release --collect "XPlat Code Coverage" + if ($LASTEXITCODE -ne 0) + { + exit 2 + } + + } + finally + { + Pop-Location + } + } + + if ($SkipPerfTests -eq $false) + { + # The performance benchmark tests should at least build without errors during PR validation + $perfTestProjectPath = "$PSScriptRoot/test/Serilog.Sinks.MSSqlServer.PerformanceTests" + try + { + Push-Location "$perfTestProjectPath" + + echo "build: Building performance test project in $perfTestProjectPath" + & dotnet build -c Release + if ($LASTEXITCODE -ne 0) + { + exit 3 + } + } + finally + { + Pop-Location + } + } - echo "build: Building performance test project in $perfTestProjectPath" - & dotnet build -c Release + if ($SkipSamples -eq $false) + { + foreach ($src in Get-ChildItem "$PSScriptRoot/samples/**/*.csproj" -File) + { + try + { + Push-Location $src.DirectoryName + + echo "build: Building sample project $( $src.FullName )" + & dotnet pack -c Release -o ..\..\artifacts + if ($LASTEXITCODE -ne 0) + { + echo "Error returned by dotnet build. Aborting build." + exit 4 + } + } + finally + { + Pop-Location + } + } + } +} +finally +{ Pop-Location } - -Pop-Location diff --git a/RunPerfTests.ps1 b/RunPerfTests.ps1 index fd3e4b15..45d0e34c 100644 --- a/RunPerfTests.ps1 +++ b/RunPerfTests.ps1 @@ -7,24 +7,37 @@ param ( echo "perf: Performance tests started with Filter = $Filter" -Push-Location $PSScriptRoot +try +{ + Push-Location $PSScriptRoot -$artifactsPath = "$PSScriptRoot\artifacts\perftests" + $artifactsPath = "$PSScriptRoot\artifacts\perftests" -if (Test-Path "$artifactsPath") { - echo "perf: Cleaning $artifactsPath" - Remove-Item "$artifactsPath" -Force -Recurse -} + if (Test-Path "$artifactsPath") + { + echo "perf: Cleaning $artifactsPath" + Remove-Item "$artifactsPath" -Force -Recurse + } -New-Item -Path "$artifactsPath" -ItemType Directory + New-Item -Path "$artifactsPath" -ItemType Directory -$perfTestProjectPath = "$PSScriptRoot/test/Serilog.Sinks.MSSqlServer.PerformanceTests" -Push-Location "$perfTestProjectPath" + $perfTestProjectPath = "$PSScriptRoot/test/Serilog.Sinks.MSSqlServer.PerformanceTests" + try + { + Push-Location "$perfTestProjectPath" -echo "perf: Running performance test project in $perfTestProjectPath" -& dotnet run -c Release -- -f $Filter + echo "perf: Running performance test project in $perfTestProjectPath" + & dotnet run -c Release -- -f $Filter -cp ".\BenchmarkDotNet.Artifacts\results\*.*" "$artifactsPath\" -Pop-Location + cp ".\BenchmarkDotNet.Artifacts\results\*.*" "$artifactsPath\" + } + finally + { + Pop-Location + } -Pop-Location +} +finally +{ + Pop-Location +} From cbecaafc7d19aebdb050e508c1eabb4ff4779758 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:44:16 +0100 Subject: [PATCH 02/16] Fixed typos in comments --- sample/AppConfigDemo/Program.cs | 2 +- sample/CombinedConfigDemo/Program.cs | 2 +- sample/CustomLogEventFormatterDemo/Program.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sample/AppConfigDemo/Program.cs b/sample/AppConfigDemo/Program.cs index fac7a54c..19844e1e 100644 --- a/sample/AppConfigDemo/Program.cs +++ b/sample/AppConfigDemo/Program.cs @@ -14,7 +14,7 @@ public static class Program public static void Main() { - // Legacy interace - do not use this anymore + // Legacy interface - do not use this anymore //Log.Logger = new LoggerConfiguration().WriteTo // .MSSqlServer( // connectionString: _connectionString, diff --git a/sample/CombinedConfigDemo/Program.cs b/sample/CombinedConfigDemo/Program.cs index df46c730..22e4771f 100644 --- a/sample/CombinedConfigDemo/Program.cs +++ b/sample/CombinedConfigDemo/Program.cs @@ -23,7 +23,7 @@ public static void Main() var columnOptionsSection = configuration.GetSection("Serilog:ColumnOptions"); var sinkOptionsSection = configuration.GetSection("Serilog:SinkOptions"); - // Legacy interace - do not use this anymore + // Legacy interface - do not use this anymore //Log.Logger = new LoggerConfiguration() // .WriteTo.MSSqlServer( // connectionString: _connectionStringName, diff --git a/sample/CustomLogEventFormatterDemo/Program.cs b/sample/CustomLogEventFormatterDemo/Program.cs index d4956ed7..2c5c14fb 100644 --- a/sample/CustomLogEventFormatterDemo/Program.cs +++ b/sample/CustomLogEventFormatterDemo/Program.cs @@ -19,7 +19,7 @@ public static void Main() var customFormatter = new FlatLogEventFormatter(); var levelSwitch = new LoggingLevelSwitch(); - // Legacy interace - do not use this anymore + // Legacy interface - do not use this anymore //Log.Logger = new LoggerConfiguration() // .WriteTo.MSSqlServer(_connectionString, // _tableName, From 529cdcc90a8e45e5263ab3b34ac97c42a65e2125 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:09:17 +0100 Subject: [PATCH 03/16] Upgraded solution to .NET 8 --- Directory.Packages.props | 23 ++++++++++--------- README.md | 4 ++-- .../CombinedConfigDemo.csproj | 4 ++-- .../CustomLogEventFormatterDemo.csproj | 2 +- .../NetStandardDemoApp.csproj | 2 +- .../WorkerServiceDemo.csproj | 2 +- .../Serilog.Sinks.MSSqlServer.csproj | 8 +++---- ....Sinks.MSSqlServer.PerformanceTests.csproj | 2 +- .../Serilog.Sinks.MSSqlServer.Tests.csproj | 8 +++++-- 9 files changed, 30 insertions(+), 25 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6ee1a16a..3ac04573 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,24 +4,25 @@ - - + + - - - - - - + + + + + + + - - - + + + \ No newline at end of file diff --git a/README.md b/README.md index 3fc1eecd..e82b3cbf 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,8 @@ Because of the way external configuration has been implemented in various .NET f | .NET Framework 4.6.2+ | `net462` | app or library | _System.Configuration_ | | .NET Framework 4.6.2+ | `net462` | app or library | _Microsoft.Extensions.Configuration_ | | .NET Standard 2.0 | `netstandard2.0` | library only | _Microsoft.Extensions.Configuration_ | -| .NET 6.0+ | `net6.0` | app or library | _System.Configuration_ | -| .NET 6.0+ | `net6.0` | app or library | _Microsoft.Extensions.Configuration_ | +| .NET 8.0+ | `net8.0` | app or library | _System.Configuration_ | +| .NET 8.0+ | `net8.0` | app or library | _Microsoft.Extensions.Configuration_ | Although it's possible to use both XML and _M.E.C_ configuration with certain frameworks, this is not supported, unintended consequences are possible, and a warning will be emitted to `SelfLog`. If you actually require multiple configuration sources, the _M.E.C_ builder-pattern is designed to support this, and your syntax will be consistent across configuration sources. diff --git a/sample/CombinedConfigDemo/CombinedConfigDemo.csproj b/sample/CombinedConfigDemo/CombinedConfigDemo.csproj index 66f4c42e..b60ac57e 100644 --- a/sample/CombinedConfigDemo/CombinedConfigDemo.csproj +++ b/sample/CombinedConfigDemo/CombinedConfigDemo.csproj @@ -1,8 +1,8 @@ - + Exe - net6.0 + net8.0 diff --git a/sample/CustomLogEventFormatterDemo/CustomLogEventFormatterDemo.csproj b/sample/CustomLogEventFormatterDemo/CustomLogEventFormatterDemo.csproj index de5bab75..9a085ee2 100644 --- a/sample/CustomLogEventFormatterDemo/CustomLogEventFormatterDemo.csproj +++ b/sample/CustomLogEventFormatterDemo/CustomLogEventFormatterDemo.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 diff --git a/sample/NetStandardDemo/NetStandardDemoApp/NetStandardDemoApp.csproj b/sample/NetStandardDemo/NetStandardDemoApp/NetStandardDemoApp.csproj index 0ebc5312..31f254f9 100644 --- a/sample/NetStandardDemo/NetStandardDemoApp/NetStandardDemoApp.csproj +++ b/sample/NetStandardDemo/NetStandardDemoApp/NetStandardDemoApp.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 diff --git a/sample/WorkerServiceDemo/WorkerServiceDemo.csproj b/sample/WorkerServiceDemo/WorkerServiceDemo.csproj index 0a916a2c..4e7c82d3 100644 --- a/sample/WorkerServiceDemo/WorkerServiceDemo.csproj +++ b/sample/WorkerServiceDemo/WorkerServiceDemo.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 dotnet-WorkerServiceDemo-A4DFF8A6-AC69-443B-A3B8-34E284CD1C78 diff --git a/src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj b/src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj index a98903cb..d7eb55df 100644 --- a/src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj +++ b/src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj @@ -2,11 +2,11 @@ A Serilog sink that writes events to Microsoft SQL Server and Azure SQL - 7.0.2 - true + 8.0.0 + false 7.0.0 Michiel van Oudheusden;Christian Kadluba;Serilog Contributors - netstandard2.0;net462;net472;net6.0 + netstandard2.0;net462;net472;net8.0 true true Serilog.Sinks.MSSqlServer @@ -60,7 +60,7 @@ - + diff --git a/test/Serilog.Sinks.MSSqlServer.PerformanceTests/Serilog.Sinks.MSSqlServer.PerformanceTests.csproj b/test/Serilog.Sinks.MSSqlServer.PerformanceTests/Serilog.Sinks.MSSqlServer.PerformanceTests.csproj index b37c5d50..8f4d1eb0 100644 --- a/test/Serilog.Sinks.MSSqlServer.PerformanceTests/Serilog.Sinks.MSSqlServer.PerformanceTests.csproj +++ b/test/Serilog.Sinks.MSSqlServer.PerformanceTests/Serilog.Sinks.MSSqlServer.PerformanceTests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 true Serilog.Sinks.MSSqlServer.PerformanceTests Exe diff --git a/test/Serilog.Sinks.MSSqlServer.Tests/Serilog.Sinks.MSSqlServer.Tests.csproj b/test/Serilog.Sinks.MSSqlServer.Tests/Serilog.Sinks.MSSqlServer.Tests.csproj index b1e02e28..4e9ee5fe 100644 --- a/test/Serilog.Sinks.MSSqlServer.Tests/Serilog.Sinks.MSSqlServer.Tests.csproj +++ b/test/Serilog.Sinks.MSSqlServer.Tests/Serilog.Sinks.MSSqlServer.Tests.csproj @@ -1,7 +1,7 @@  - net462;net472;net6.0 + net462;net472;net8.0 true Serilog.Sinks.MSSqlServer.Tests ../../assets/Serilog.snk @@ -43,7 +43,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -53,6 +53,10 @@ + + + + Always From 1c0aaadf369fa917ee56e5b3a52a779d0da2eb03 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:21:07 +0100 Subject: [PATCH 04/16] Fixed wrong path in build script --- Build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Build.ps1 b/Build.ps1 index 3633c43f..55950dd9 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -108,14 +108,14 @@ try if ($SkipSamples -eq $false) { - foreach ($src in Get-ChildItem "$PSScriptRoot/samples/**/*.csproj" -File) + foreach ($src in Get-ChildItem "$PSScriptRoot/sample/**/*.csproj" -File) { try { Push-Location $src.DirectoryName echo "build: Building sample project $( $src.FullName )" - & dotnet pack -c Release -o ..\..\artifacts + & dotnet build -c Release -o ..\..\artifacts if ($LASTEXITCODE -ne 0) { echo "Error returned by dotnet build. Aborting build." From ffd2cff65ba040abfaed53b1e609240d6bda66ff Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:37:33 +0100 Subject: [PATCH 05/16] Added missing Serilog ref in AppConfigDemo --- sample/AppConfigDemo/AppConfigDemo.csproj | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sample/AppConfigDemo/AppConfigDemo.csproj b/sample/AppConfigDemo/AppConfigDemo.csproj index 2550590f..5d6579f1 100644 --- a/sample/AppConfigDemo/AppConfigDemo.csproj +++ b/sample/AppConfigDemo/AppConfigDemo.csproj @@ -33,12 +33,23 @@ 4 + + + + + + - - - + + + + + + + + @@ -56,8 +67,5 @@ - - - From 037c4c216eb5f2a2458e968b699fa98ebf0b84ff Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:43:17 +0100 Subject: [PATCH 06/16] Removed obsolete sample code --- sample/AppConfigDemo/Program.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sample/AppConfigDemo/Program.cs b/sample/AppConfigDemo/Program.cs index 19844e1e..87bd8c6c 100644 --- a/sample/AppConfigDemo/Program.cs +++ b/sample/AppConfigDemo/Program.cs @@ -14,21 +14,6 @@ public static class Program public static void Main() { - // Legacy interface - do not use this anymore - //Log.Logger = new LoggerConfiguration().WriteTo - // .MSSqlServer( - // connectionString: _connectionString, - // tableName: _tableName, - // restrictedToMinimumLevel: LogEventLevel.Debug, - // batchPostingLimit: MSSqlServerSink.DefaultBatchPostingLimit, - // period: null, - // formatProvider: null, - // autoCreateSqlTable: true, - // columnOptions: null, - // schemaName: _schemaName, - // logEventFormatter: null) - // .CreateLogger(); - // New MSSqlServerSinkOptions based interface Log.Logger = new LoggerConfiguration().WriteTo .MSSqlServer( From 9fcf9e9bff4b5136569374f2a73ebfbd2a00fc45 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:45:26 +0100 Subject: [PATCH 07/16] Auto create DB & table in AppConfigDemo --- sample/AppConfigDemo/App.config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sample/AppConfigDemo/App.config b/sample/AppConfigDemo/App.config index 0e0b3d21..39b41390 100644 --- a/sample/AppConfigDemo/App.config +++ b/sample/AppConfigDemo/App.config @@ -11,7 +11,10 @@ - + + + + From 698f5fd9b419db2f824199829ac64c61eab07709 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:04:01 +0100 Subject: [PATCH 08/16] Fixed bin path in pr-validation.yml --- .github/workflows/pr-validation.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index bc5e2535..a72633dc 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -7,7 +7,7 @@ on: # Run every biweekly to discover failures due to environment changes schedule: - cron: '0 0 1,15 * *' - + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -24,8 +24,8 @@ jobs: - name: Upload binaries artifact for InferSharp job uses: actions/upload-artifact@v4 with: - name: bin-net6 - path: src\Serilog.Sinks.MSSqlServer\bin\Release\net6.0 + name: bin + path: src\Serilog.Sinks.MSSqlServer\bin\Release\net8.0 - name: Upload testresults artifact with code coverage file uses: actions/upload-artifact@v4 @@ -44,13 +44,13 @@ jobs: - name: Download binaries artifact uses: actions/download-artifact@v4 with: - name: bin-net6 - path: bin-net6 + name: bin + path: bin - name: Run Infer# uses: microsoft/infersharpaction@v1.5 with: - binary-path: bin-net6 + binary-path: bin-net - name: Upload SARIF output to GitHub Security Center uses: github/codeql-action/upload-sarif@v3 From 7256a63d53ee4ff0407208dc89f9cde263d60e37 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Wed, 30 Oct 2024 22:19:13 +0100 Subject: [PATCH 09/16] Ref System.Transactions only for .NET Fx In the test project the assembly System.Transactions was referenced also for .NET (Core) which leads to a warning with the update to .NET 8. Now we reference it only for the .NET Framework targets. --- .../Serilog.Sinks.MSSqlServer.Tests.csproj | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/Serilog.Sinks.MSSqlServer.Tests/Serilog.Sinks.MSSqlServer.Tests.csproj b/test/Serilog.Sinks.MSSqlServer.Tests/Serilog.Sinks.MSSqlServer.Tests.csproj index 4e9ee5fe..256f663b 100644 --- a/test/Serilog.Sinks.MSSqlServer.Tests/Serilog.Sinks.MSSqlServer.Tests.csproj +++ b/test/Serilog.Sinks.MSSqlServer.Tests/Serilog.Sinks.MSSqlServer.Tests.csproj @@ -38,6 +38,7 @@ + @@ -53,10 +54,6 @@ - - - - Always From dbd09985e46110cf5a6e3ee33d43b77a1e68940b Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Wed, 30 Oct 2024 22:20:01 +0100 Subject: [PATCH 10/16] Updated nearly all packages to latest --- Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3ac04573..dc769f0c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -15,11 +15,11 @@ - - + + - + From 0c709a49e577a69e33bdd3192d62a668f3c380c7 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Wed, 30 Oct 2024 22:35:05 +0100 Subject: [PATCH 11/16] Fixed artifact path in pr-validation.yml --- .github/workflows/pr-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index a72633dc..65869247 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -50,7 +50,7 @@ jobs: - name: Run Infer# uses: microsoft/infersharpaction@v1.5 with: - binary-path: bin-net + binary-path: bin - name: Upload SARIF output to GitHub Security Center uses: github/codeql-action/upload-sarif@v3 From 45a09edfd71525f7c325c9225f352f2dd766694e Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Wed, 30 Oct 2024 23:54:42 +0100 Subject: [PATCH 12/16] Run pr-analysis-codeql.yml on windows Necessary to have .NET 4.6.2 reference assemblies for building and analyzing AppConfigDemo. --- .github/workflows/pr-analysis-codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-analysis-codeql.yml b/.github/workflows/pr-analysis-codeql.yml index 72d81f4c..25b6fad8 100644 --- a/.github/workflows/pr-analysis-codeql.yml +++ b/.github/workflows/pr-analysis-codeql.yml @@ -9,7 +9,7 @@ on: jobs: build-and-codeql: - runs-on: ubuntu-latest + runs-on: windows-latest permissions: actions: read contents: read From bfd49e7caebb4c4fdf604bcdaf23e21475da97d1 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:06:00 +0100 Subject: [PATCH 13/16] Also build samples in subdirs in Build.ps1 --- Build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build.ps1 b/Build.ps1 index 55950dd9..4a906a52 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -108,7 +108,7 @@ try if ($SkipSamples -eq $false) { - foreach ($src in Get-ChildItem "$PSScriptRoot/sample/**/*.csproj" -File) + foreach ($src in Get-ChildItem "$PSScriptRoot/sample/*.csproj" -File -Recurse) { try { From dd78aa66e479825c2c4c8951bbb52d0bb149258a Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Thu, 31 Oct 2024 08:58:36 +0100 Subject: [PATCH 14/16] Removed vulnerabiliy fix dependencies System.Formats.Asn1 and System.Private.Uri were only added to fix a vulnerability caused by old versions referenced transitively. After the update to .NET 8 and update of all dependencies they can now be removed again. --- Directory.Packages.props | 2 -- src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj | 1 - 2 files changed, 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index dc769f0c..ffca89d9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,8 +6,6 @@ - - diff --git a/src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj b/src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj index d7eb55df..bacc90ab 100644 --- a/src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj +++ b/src/Serilog.Sinks.MSSqlServer/Serilog.Sinks.MSSqlServer.csproj @@ -38,7 +38,6 @@ - From 586d1bb83592f5b6271453aa371b2c1b977a2262 Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Thu, 31 Oct 2024 09:09:55 +0100 Subject: [PATCH 15/16] Removed vuln fix System.Text.Json dep System.Text.Json was only added to fix a vulnerability caused by an old version referenced transitively. After the update to .NET 8 and update of all dependencies it can now be removed again. --- Directory.Packages.props | 1 - 1 file changed, 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ffca89d9..1b575644 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -16,7 +16,6 @@ - From 244181fb9a4fae6e3f6cd66c761cfb9e41cd8e5d Mon Sep 17 00:00:00 2001 From: Christian Kadluba <10721825+ckadluba@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:27:25 +0100 Subject: [PATCH 16/16] Updated CHANGES.md --- CHANGES.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index b104f85c..38e2bcd3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +# 8.0.0 +* Updated to .NET 8 +* Updated nearly all dependencies +* Improved build script (build samples, fail on vulns, ...) +* Removed some obsolete vulnerability fix dependencies +* Fixed missing dependency in AppConfigDemo sample + # 7.0.2 * Fixed issue #580: Removed deprecated transitive dependency on Microsoft.NETCore.Targets by removing runtime identifier (thanks to @david-brink-talogy) * Fixed issues #540 and #541 in README