From 5421b3d92314f06ea6a53bd66512dd73c1fcb908 Mon Sep 17 00:00:00 2001 From: "internalautomation[bot]" <85681268+internalautomation[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:39:15 +0000 Subject: [PATCH 1/9] GitHubSync update - release-4.4 --- .gitignore | 1 + src/.editorconfig | 39 ++++++++++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 190ac12b..5bf25cca 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ build/ bld/ [Bb]in/ [Oo]bj/ +*.binlog # Roslyn cache directories *.ide/ diff --git a/src/.editorconfig b/src/.editorconfig index 6a059494..a751d64a 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -41,14 +41,17 @@ dotnet_style_qualification_for_field = false:error dotnet_style_qualification_for_method = false:error dotnet_style_qualification_for_property = false:error +# Namespace/folder matching +dotnet_style_namespace_match_folder = false + # Language keywords vs BCL types preferences dotnet_diagnostic.IDE0049.severity = error dotnet_style_predefined_type_for_locals_parameters_members = true:error dotnet_style_predefined_type_for_member_access = true:error # Modifier preferences -dotnet_diagnostic.IDE0040.severity = error -dotnet_style_require_accessibility_modifiers = omit_if_default:error +dotnet_diagnostic.IDE0040.severity = warning +dotnet_style_require_accessibility_modifiers = omit_if_default:warning # TODO: Change to error dotnet_diagnostic.IDE0044.severity = suggestion @@ -63,8 +66,8 @@ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error # Expression-level preferences -dotnet_diagnostic.IDE0017.severity = error -dotnet_style_object_initializer = true:error +dotnet_diagnostic.IDE0017.severity = warning +dotnet_style_object_initializer = true:warning dotnet_diagnostic.IDE0028.severity = error dotnet_style_collection_initializer = true:error @@ -223,22 +226,22 @@ file_header_template = unset dotnet_diagnostic.IDE0001.severity = error dotnet_diagnostic.IDE0002.severity = error dotnet_diagnostic.IDE0004.severity = error -dotnet_diagnostic.IDE0005.severity = error +dotnet_diagnostic.IDE0005.severity = warning dotnet_diagnostic.IDE0035.severity = error -dotnet_diagnostic.IDE0051.severity = error -dotnet_diagnostic.IDE0052.severity = error +dotnet_diagnostic.IDE0051.severity = warning +dotnet_diagnostic.IDE0052.severity = warning # TODO: Change to error dotnet_diagnostic.IDE0058.severity = suggestion csharp_style_unused_value_expression_statement_preference = discard_variable -dotnet_diagnostic.IDE0059.severity = error +dotnet_diagnostic.IDE0059.severity = warning csharp_style_unused_value_assignment_preference = discard_variable -dotnet_diagnostic.IDE0060.severity = error +dotnet_diagnostic.IDE0060.severity = warning dotnet_code_quality_unused_parameters = non_public -dotnet_diagnostic.IDE0079.severity = error +dotnet_diagnostic.IDE0079.severity = error # Diagnostic does not fail build dotnet_remove_unnecessary_suppression_exclusions = none dotnet_diagnostic.IDE0080.severity = error @@ -249,7 +252,7 @@ dotnet_diagnostic.IDE0110.severity = error #### Formatting Rules #### -dotnet_diagnostic.IDE0055.severity = error +dotnet_diagnostic.IDE0055.severity = warning # New line preferences csharp_new_line_before_catch = true @@ -322,6 +325,14 @@ dotnet_naming_rule.fields.style = camel_case dotnet_naming_rule.fields.symbols = fields dotnet_naming_rule.fields.severity = none +dotnet_naming_rule.local_constants.severity = none +dotnet_naming_rule.local_constants.symbols = local_constants +dotnet_naming_rule.local_constants.style = camel_case + +dotnet_naming_rule.local_variables.severity = suggestion +dotnet_naming_rule.local_variables.symbols = local_variables +dotnet_naming_rule.local_variables.style = camel_case + # Symbol specifications dotnet_naming_symbols.interface.applicable_kinds = interface dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected @@ -339,6 +350,12 @@ dotnet_naming_symbols.fields.applicable_kinds = field dotnet_naming_symbols.fields.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_symbols.fields.required_modifiers = +dotnet_naming_symbols.local_constants.applicable_kinds = local +dotnet_naming_symbols.local_constants.required_modifiers = const + +dotnet_naming_symbols.local_variables.applicable_kinds = local +dotnet_naming_symbols.local_variables.required_modifiers = + # Naming styles dotnet_naming_style.pascal_case.required_prefix = dotnet_naming_style.pascal_case.required_suffix = From 9a69fa9edf8394f72ddf01662a3e4aa6571accec Mon Sep 17 00:00:00 2001 From: David Boike Date: Tue, 15 Jul 2025 14:35:58 -0500 Subject: [PATCH 2/9] Updating runner images on workflows --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28b79c5f..0ee30333 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,9 @@ jobs: strategy: matrix: include: - - os: windows-2022 + - os: windows-latest name: Windows - - os: ubuntu-22.04 + - os: ubuntu-latest name: Linux fail-fast: false steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65aa2fdf..6b4981b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ defaults: shell: pwsh jobs: release: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4.1.6 From ad3de9b0fc3d3e8a86476b3daeb8e4268f8b351f Mon Sep 17 00:00:00 2001 From: David Boike Date: Thu, 7 Aug 2025 15:20:09 -0500 Subject: [PATCH 3/9] Try FUNCTIONS_INPROC_NET8_ENABLED --- src/IntegrationTests.HostV4/local.settings.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/IntegrationTests.HostV4/local.settings.json b/src/IntegrationTests.HostV4/local.settings.json index 71e6cd3e..6dc60d3c 100644 --- a/src/IntegrationTests.HostV4/local.settings.json +++ b/src/IntegrationTests.HostV4/local.settings.json @@ -5,6 +5,8 @@ "FUNCTIONS_WORKER_RUNTIME": "dotnet", "AzureWebJobsServiceBus": "", - "CustomComponentValue": "Custom Component" + "CustomComponentValue": "Custom Component", + + "FUNCTIONS_INPROC_NET8_ENABLED": 1 } -} \ No newline at end of file +} From 304bf1683e47cdbace45a8f6133add52c6feeb38 Mon Sep 17 00:00:00 2001 From: David Boike Date: Thu, 7 Aug 2025 15:35:47 -0500 Subject: [PATCH 4/9] Run permissions fix on in-proc8 directory --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ee30333..e2eae7c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: shell: bash - name: Fix Azure Functions Core Tools permissions - Linux if: runner.os == 'Linux' - run: sudo chmod +x /usr/lib/azure-functions-core-tools/in-proc6/func + run: sudo chmod +x /usr/lib/azure-functions-core-tools/in-proc8/func - name: Build run: dotnet build src --configuration Release - name: Upload packages From e28ac36a29faa30f340dc19e591fb3b416a7fcac Mon Sep 17 00:00:00 2001 From: David Boike Date: Thu, 7 Aug 2025 15:42:04 -0500 Subject: [PATCH 5/9] Set just integration host test to net8 --- src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj b/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj index 71a9094a..519e9cad 100644 --- a/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj +++ b/src/IntegrationTests.HostV4/IntegrationTests.HostV4.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 v4 true $(BaseIntermediateOutputPath)\GeneratedFiles From 05e928e58657495d12f432495e280cf0ef762213 Mon Sep 17 00:00:00 2001 From: David Boike Date: Thu, 7 Aug 2025 16:19:52 -0500 Subject: [PATCH 6/9] Test adding that dependency to ignore list --- .../InProcessFunctionEndpoint.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/InProcessFunctionEndpoint.cs b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/InProcessFunctionEndpoint.cs index b439475e..31f19647 100644 --- a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/InProcessFunctionEndpoint.cs +++ b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/InProcessFunctionEndpoint.cs @@ -154,7 +154,8 @@ public Task Unsubscribe(Type eventType, ExecutionContext executionContext, ILogg "Microsoft.Identity.Client.dll", "Microsoft.Identity.Client.Extensions.Msal.dll", "NCrontab.Signed.dll", - "NServiceBus.Extensions.DependencyInjection.dll" + "NServiceBus.Extensions.DependencyInjection.dll", + "System.ClientModel.dll" }; internal async Task InitializeEndpointIfNecessary(CancellationToken cancellationToken) From 94e4590631e270c6bb8c921a02380b475a28b98e Mon Sep 17 00:00:00 2001 From: David Boike Date: Thu, 7 Aug 2025 16:35:43 -0500 Subject: [PATCH 7/9] See if configuration will work --- src/IntegrationTests.HostV4/Startup.cs | 6 +++++- .../InProcessFunctionEndpoint.cs | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/IntegrationTests.HostV4/Startup.cs b/src/IntegrationTests.HostV4/Startup.cs index e4397b49..04e914f6 100644 --- a/src/IntegrationTests.HostV4/Startup.cs +++ b/src/IntegrationTests.HostV4/Startup.cs @@ -8,6 +8,10 @@ public class Startup : FunctionsStartup { public override void Configure(IFunctionsHostBuilder builder) { - builder.UseNServiceBus(c => c.AdvancedConfiguration.EnableInstallers()); + builder.UseNServiceBus(c => + { + c.AdvancedConfiguration.EnableInstallers(); + c.AdvancedConfiguration.AssemblyScanner().ExcludeAssemblies("System.ClientModel.dll"); + }); } } \ No newline at end of file diff --git a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/InProcessFunctionEndpoint.cs b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/InProcessFunctionEndpoint.cs index 31f19647..b439475e 100644 --- a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/InProcessFunctionEndpoint.cs +++ b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/InProcessFunctionEndpoint.cs @@ -154,8 +154,7 @@ public Task Unsubscribe(Type eventType, ExecutionContext executionContext, ILogg "Microsoft.Identity.Client.dll", "Microsoft.Identity.Client.Extensions.Msal.dll", "NCrontab.Signed.dll", - "NServiceBus.Extensions.DependencyInjection.dll", - "System.ClientModel.dll" + "NServiceBus.Extensions.DependencyInjection.dll" }; internal async Task InitializeEndpointIfNecessary(CancellationToken cancellationToken) From cab2243a16a715db67e66445a9f191c6f3a68950 Mon Sep 17 00:00:00 2001 From: David Boike Date: Fri, 8 Aug 2025 14:37:56 -0500 Subject: [PATCH 8/9] All tests to net8 --- .../NServiceBus.AzureFunctions.Analyzer.Tests.csproj | 2 +- .../NServiceBus.AzureFunctions.SourceGenerator.Tests.csproj | 2 +- src/ServiceBus.AcceptanceTests/FunctionEndpointComponent.cs | 2 +- .../ServiceBus.AcceptanceTests.csproj | 2 +- src/ServiceBus.Tests/ServiceBus.Tests.csproj | 2 +- src/Testing.Handlers/Testing.Handlers.csproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/NServiceBus.AzureFunctions.Analyzer.Tests/NServiceBus.AzureFunctions.Analyzer.Tests.csproj b/src/NServiceBus.AzureFunctions.Analyzer.Tests/NServiceBus.AzureFunctions.Analyzer.Tests.csproj index 83b11c6a..c36d232a 100644 --- a/src/NServiceBus.AzureFunctions.Analyzer.Tests/NServiceBus.AzureFunctions.Analyzer.Tests.csproj +++ b/src/NServiceBus.AzureFunctions.Analyzer.Tests/NServiceBus.AzureFunctions.Analyzer.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 diff --git a/src/NServiceBus.AzureFunctions.SourceGenerator.Tests/NServiceBus.AzureFunctions.SourceGenerator.Tests.csproj b/src/NServiceBus.AzureFunctions.SourceGenerator.Tests/NServiceBus.AzureFunctions.SourceGenerator.Tests.csproj index 2f70cd2f..2c144240 100644 --- a/src/NServiceBus.AzureFunctions.SourceGenerator.Tests/NServiceBus.AzureFunctions.SourceGenerator.Tests.csproj +++ b/src/NServiceBus.AzureFunctions.SourceGenerator.Tests/NServiceBus.AzureFunctions.SourceGenerator.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 true ..\NServiceBusTests.snk diff --git a/src/ServiceBus.AcceptanceTests/FunctionEndpointComponent.cs b/src/ServiceBus.AcceptanceTests/FunctionEndpointComponent.cs index adbe3c16..2b9f2b85 100644 --- a/src/ServiceBus.AcceptanceTests/FunctionEndpointComponent.cs +++ b/src/ServiceBus.AcceptanceTests/FunctionEndpointComponent.cs @@ -47,7 +47,7 @@ public Task CreateRunner(RunDescriptor runDescriptor) => sendsAtomicWithReceive, ServiceBusMessageActionsFactory)); - protected IList Messages { get; } = new List(); + protected IList Messages { get; } = []; protected bool DoNotFailOnErrorMessages { get; init; } diff --git a/src/ServiceBus.AcceptanceTests/ServiceBus.AcceptanceTests.csproj b/src/ServiceBus.AcceptanceTests/ServiceBus.AcceptanceTests.csproj index 10d5b350..ee50408c 100644 --- a/src/ServiceBus.AcceptanceTests/ServiceBus.AcceptanceTests.csproj +++ b/src/ServiceBus.AcceptanceTests/ServiceBus.AcceptanceTests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 true ..\NServiceBusTests.snk diff --git a/src/ServiceBus.Tests/ServiceBus.Tests.csproj b/src/ServiceBus.Tests/ServiceBus.Tests.csproj index c8645caa..e670f559 100644 --- a/src/ServiceBus.Tests/ServiceBus.Tests.csproj +++ b/src/ServiceBus.Tests/ServiceBus.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 true ..\NServiceBusTests.snk diff --git a/src/Testing.Handlers/Testing.Handlers.csproj b/src/Testing.Handlers/Testing.Handlers.csproj index 8e209c3d..89473b06 100644 --- a/src/Testing.Handlers/Testing.Handlers.csproj +++ b/src/Testing.Handlers/Testing.Handlers.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 From 9231c48206b5210619a0523ce0076286bd19ef2d Mon Sep 17 00:00:00 2001 From: David Boike Date: Fri, 8 Aug 2025 15:01:39 -0500 Subject: [PATCH 9/9] Ignore warning normally suppressed by SDK --- .../SourceGeneratorApprovals.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NServiceBus.AzureFunctions.SourceGenerator.Tests/SourceGeneratorApprovals.cs b/src/NServiceBus.AzureFunctions.SourceGenerator.Tests/SourceGeneratorApprovals.cs index b667875f..ed95c1dc 100644 --- a/src/NServiceBus.AzureFunctions.SourceGenerator.Tests/SourceGeneratorApprovals.cs +++ b/src/NServiceBus.AzureFunctions.SourceGenerator.Tests/SourceGeneratorApprovals.cs @@ -229,7 +229,11 @@ static CSharpCompilation Compile(IEnumerable syntaxTrees, IEnumerabl // Verify the code compiled: var compilationErrors = compilation .GetDiagnostics() - .Where(d => d.Severity >= DiagnosticSeverity.Warning); + .Where(d => d.Severity >= DiagnosticSeverity.Warning) + // Ignoring warning CS1701: Assuming Microsoft.Extensions.Logging.Abstractions v6 and v8 are the same thing + // because component targets net6 while tests are now net8. SDK suppresses this for you but hits here due + // to direct compiler invocation. See https://github.com/dotnet/roslyn/issues/19640 + .Where(d => d.Id != "CS1701"); // Assert.IsEmpty(compilationErrors, compilationErrors.FirstOrDefault()?.GetMessage()); return compilation;