From d4523ed7720f8ef53b1e5cc1ec5ed59478a2f352 Mon Sep 17 00:00:00 2001 From: John Simons Date: Tue, 11 Aug 2026 07:24:33 +1000 Subject: [PATCH] Upgrade Particular Analyzers and triage new diagnostics Unpins the Particular.Analyzers version, enabling newer rules across the solution. New warnings introduced by the upgrade are suppressed in `.editorconfig` files as technical debt, with a plan to address them incrementally. Includes initial fixes for `DateTime` to `DateTimeOffset` usage, and adds pragmas for intentional `async void` and reference equality usages identified by the analyzers. --- src/Custom.Build.props | 2 -- .../.editorconfig | 7 ++++++- .../.editorconfig | 5 +++++ .../.editorconfig | 8 ++++++++ src/Particular.LicensingComponent/.editorconfig | 10 +++++++++- src/ServiceControl.AcceptanceTesting/.editorconfig | 7 +++++++ .../.editorconfig | 8 +++++++- src/ServiceControl.AcceptanceTests/.editorconfig | 12 ++++++++++++ .../When_a_messages_fails_multiple_times.cs | 2 +- .../Recoverability/When_a_message_is_retried.cs | 2 +- .../When_single_message_fails_in_batch.cs | 2 +- src/ServiceControl.Api/.editorconfig | 7 +++++++ .../.editorconfig | 6 ++++++ .../.editorconfig | 5 +++++ .../.editorconfig | 6 ++++++ .../.editorconfig | 7 +++++++ .../.editorconfig | 6 ++++++ .../.editorconfig | 6 +++++- src/ServiceControl.Audit.Persistence/.editorconfig | 6 ++++++ src/ServiceControl.Audit.UnitTests/.editorconfig | 7 +++++++ src/ServiceControl.Audit/.editorconfig | 11 +++++++++++ .../DetectSuccessfulRetriesEnricher.cs | 2 +- src/ServiceControl.Config.Tests/.editorconfig | 6 ++++++ src/ServiceControl.Config/AppBootstrapper.cs | 2 ++ .../Framework/Commands/AwaitableAbstractCommand.cs | 2 ++ .../Framework/Commands/AwaitableDelegateCommand.cs | 2 ++ .../Framework/Rx/RxViewAware.cs | 2 ++ .../UI/ListInstances/ListInstancesViewModel.cs | 6 ++++++ .../Xaml/Behaviours/RichTextBoxHelper.cs | 2 ++ src/ServiceControl.DomainEvents/.editorconfig | 7 +++++++ src/ServiceControl.Hosting/.editorconfig | 6 ++++++ ...nsions.cs => HostApplicationBuilderExtensions.cs} | 2 +- .../.editorconfig | 7 +++++++ .../.editorconfig | 5 +++++ src/ServiceControl.Infrastructure/.editorconfig | 10 ++++++++++ .../.editorconfig | 6 ++++++ .../.editorconfig | 6 ++++++ src/ServiceControl.Monitoring/.editorconfig | 7 +++++++ .../.editorconfig | 7 +++++++ .../.editorconfig | 7 ++++++- .../.editorconfig | 7 ++++++- src/ServiceControl.Persistence.EFCore/.editorconfig | 12 +++++++++++- src/ServiceControl.Persistence.RavenDB/.editorconfig | 9 +++++++++ .../.editorconfig | 5 +++++ .../.editorconfig | 8 ++++++++ .../.editorconfig | 5 +++++ .../.editorconfig | 8 ++++++++ src/ServiceControl.Persistence.Tests/.editorconfig | 8 ++++++++ src/ServiceControl.Persistence/.editorconfig | 8 ++++++++ src/ServiceControl.RavenDB/.editorconfig | 6 ++++++ .../.editorconfig | 7 ++++++- src/ServiceControl.Transports.ASBS/.editorconfig | 7 +++++++ .../.editorconfig | 7 ++++++- src/ServiceControl.Transports.ASQ/.editorconfig | 6 ++++++ .../.editorconfig | 6 ++++++ src/ServiceControl.Transports.IBMMQ/.editorconfig | 7 +++++++ .../IBMMQTransportCustomization.cs | 4 +++- src/ServiceControl.Transports.Learning/.editorconfig | 6 ++++++ .../.editorconfig | 7 ++++++- src/ServiceControl.Transports.Msmq/.editorconfig | 5 +++++ .../.editorconfig | 7 ++++++- .../.editorconfig | 8 ++++++++ src/ServiceControl.Transports.RabbitMQ/.editorconfig | 7 +++++++ .../.editorconfig | 7 ++++++- .../.editorconfig | 7 ++++++- .../.editorconfig | 7 ++++++- .../.editorconfig | 7 ++++++- .../.editorconfig | 7 ++++++- src/ServiceControl.Transports.SQS/.editorconfig | 6 ++++++ .../.editorconfig | 7 ++++++- .../.editorconfig | 8 ++++++++ src/ServiceControl.Transports.Tests/.editorconfig | 8 +++++++- src/ServiceControl.Transports/.editorconfig | 8 ++++++++ src/ServiceControl.UnitTests/.editorconfig | 8 ++++++++ src/ServiceControl/.editorconfig | 12 ++++++++++++ .../CompositeViews/Messages/ScatterGatherApi.cs | 3 +-- src/ServiceControl/Licensing/ActiveLicense.cs | 2 +- 77 files changed, 454 insertions(+), 29 deletions(-) create mode 100644 src/ServiceControl.Api/.editorconfig create mode 100644 src/ServiceControl.DomainEvents/.editorconfig create mode 100644 src/ServiceControl.Hosting/.editorconfig rename src/ServiceControl.Hosting/{IHostApplicationBuilderExtensions.cs => HostApplicationBuilderExtensions.cs} (90%) create mode 100644 src/ServiceControl.Infrastructure.Metrics/.editorconfig create mode 100644 src/ServiceControl.Infrastructure/.editorconfig create mode 100644 src/ServiceControl.Management.PowerShell/.editorconfig create mode 100644 src/ServiceControl.Transports.IBMMQ.Tests/.editorconfig create mode 100644 src/ServiceControl.Transports.IBMMQ/.editorconfig diff --git a/src/Custom.Build.props b/src/Custom.Build.props index 4e8b08ce0d..dd2a87b3cf 100644 --- a/src/Custom.Build.props +++ b/src/Custom.Build.props @@ -8,8 +8,6 @@ false Particular.ServiceControl.Management $(ArtifactsPath)PowerShellModules\$(PowerShellModuleName)\ - - 0.9.0 true diff --git a/src/Particular.LicensingComponent.Persistence.InMemory/.editorconfig b/src/Particular.LicensingComponent.Persistence.InMemory/.editorconfig index 320c6fad7c..8a988261dd 100644 --- a/src/Particular.LicensingComponent.Persistence.InMemory/.editorconfig +++ b/src/Particular.LicensingComponent.Persistence.InMemory/.editorconfig @@ -8,4 +8,9 @@ dotnet_diagnostic.CA2007.severity = none # Justification: Rider displays an error to do with "Accessibility modifiers required (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0040)" dotnet_diagnostic.IDE0040.severity = none -csharp_style_var_elsewhere = true:error \ No newline at end of file +csharp_style_var_elsewhere = true:error + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none diff --git a/src/Particular.LicensingComponent.Persistence/.editorconfig b/src/Particular.LicensingComponent.Persistence/.editorconfig index ff993b49bb..eae5d84087 100644 --- a/src/Particular.LicensingComponent.Persistence/.editorconfig +++ b/src/Particular.LicensingComponent.Persistence/.editorconfig @@ -2,3 +2,8 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none diff --git a/src/Particular.LicensingComponent.UnitTests/.editorconfig b/src/Particular.LicensingComponent.UnitTests/.editorconfig index 5f68a610b3..474aec5159 100644 --- a/src/Particular.LicensingComponent.UnitTests/.editorconfig +++ b/src/Particular.LicensingComponent.UnitTests/.editorconfig @@ -2,3 +2,11 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0006.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/Particular.LicensingComponent/.editorconfig b/src/Particular.LicensingComponent/.editorconfig index f16f0e5105..97adb8c6b7 100644 --- a/src/Particular.LicensingComponent/.editorconfig +++ b/src/Particular.LicensingComponent/.editorconfig @@ -11,4 +11,12 @@ dotnet_diagnostic.IDE0040.severity = none dotnet_diagnostic.IDE0010.severity = suggestion csharp_style_var_elsewhere = true:error -csharp_style_var_for_built_in_types = true:error \ No newline at end of file +csharp_style_var_for_built_in_types = true:error + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0008.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0019.severity = none diff --git a/src/ServiceControl.AcceptanceTesting/.editorconfig b/src/ServiceControl.AcceptanceTesting/.editorconfig index 196d6e44a8..f3c943025f 100644 --- a/src/ServiceControl.AcceptanceTesting/.editorconfig +++ b/src/ServiceControl.AcceptanceTesting/.editorconfig @@ -2,3 +2,10 @@ # Justification: Usage is from test projects dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0019.severity = none diff --git a/src/ServiceControl.AcceptanceTests.RavenDB/.editorconfig b/src/ServiceControl.AcceptanceTests.RavenDB/.editorconfig index 0279bdc2db..bbcb303765 100644 --- a/src/ServiceControl.AcceptanceTests.RavenDB/.editorconfig +++ b/src/ServiceControl.AcceptanceTests.RavenDB/.editorconfig @@ -1,4 +1,10 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.AcceptanceTests/.editorconfig b/src/ServiceControl.AcceptanceTests/.editorconfig index 5f68a610b3..4fcb63e0be 100644 --- a/src/ServiceControl.AcceptanceTests/.editorconfig +++ b/src/ServiceControl.AcceptanceTests/.editorconfig @@ -2,3 +2,15 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0018.severity = none + +# Timezone debt: these DateTime values are Kind=Unspecified or Local, so the implicit cast to +# DateTimeOffset uses the build agent's offset. Each needs individual review before removing. +dotnet_diagnostic.PS0022.severity = none diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_messages_fails_multiple_times.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_messages_fails_multiple_times.cs index ffd9515517..434f6c776d 100644 --- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_messages_fails_multiple_times.cs +++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_a_messages_fails_multiple_times.cs @@ -59,7 +59,7 @@ protected override TransportOperations CreateMessage(TestContext context) { var endpointName = NServiceBus.AcceptanceTesting.Customization.Conventions.EndpointNamingConvention(typeof(AnEndpoint)); var messageId = Guid.NewGuid().ToString(); - var earliestTimeOfFailure = DateTime.UtcNow; + var earliestTimeOfFailure = DateTimeOffset.UtcNow; context.UniqueMessageId = DeterministicGuid.MakeId(messageId, endpointName).ToString(); diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/When_a_message_is_retried.cs b/src/ServiceControl.AcceptanceTests/Recoverability/When_a_message_is_retried.cs index 12060bad9c..6e8859f666 100644 --- a/src/ServiceControl.AcceptanceTests/Recoverability/When_a_message_is_retried.cs +++ b/src/ServiceControl.AcceptanceTests/Recoverability/When_a_message_is_retried.cs @@ -131,7 +131,7 @@ protected override TransportOperations CreateMessage(TestContext context) headers["NServiceBus.FailedQ"] = Conventions.EndpointNamingConvention(typeof(VerifyHeader)); headers["$.diagnostics.hostid"] = Guid.NewGuid().ToString(); - headers["NServiceBus.TimeOfFailure"] = DateTimeOffsetHelper.ToWireFormattedString(DateTime.UtcNow); + headers["NServiceBus.TimeOfFailure"] = DateTimeOffsetHelper.ToWireFormattedString(DateTimeOffset.UtcNow); var outgoingMessage = new OutgoingMessage(messageId, headers, context.BodyToSend); diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/When_single_message_fails_in_batch.cs b/src/ServiceControl.AcceptanceTests/Recoverability/When_single_message_fails_in_batch.cs index 1e90dac10b..ea6bf5a65a 100644 --- a/src/ServiceControl.AcceptanceTests/Recoverability/When_single_message_fails_in_batch.cs +++ b/src/ServiceControl.AcceptanceTests/Recoverability/When_single_message_fails_in_batch.cs @@ -82,7 +82,7 @@ protected override TransportOperations CreateMessage(MyContext context) [Headers.MessageId] = i == 2 ? context.MessageId : Guid.NewGuid().ToString(), ["NServiceBus.FailedQ"] = Conventions.EndpointNamingConvention(typeof(Sendonly)), ["$.diagnostics.hostid"] = Guid.NewGuid().ToString(), - ["NServiceBus.TimeOfFailure"] = DateTimeOffsetHelper.ToWireFormattedString(DateTime.UtcNow) + ["NServiceBus.TimeOfFailure"] = DateTimeOffsetHelper.ToWireFormattedString(DateTimeOffset.UtcNow) }; diff --git a/src/ServiceControl.Api/.editorconfig b/src/ServiceControl.Api/.editorconfig new file mode 100644 index 0000000000..1942f21999 --- /dev/null +++ b/src/ServiceControl.Api/.editorconfig @@ -0,0 +1,7 @@ +[*.cs] + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0017.severity = none diff --git a/src/ServiceControl.Audit.AcceptanceTests.RavenDB/.editorconfig b/src/ServiceControl.Audit.AcceptanceTests.RavenDB/.editorconfig index 5f68a610b3..bbcb303765 100644 --- a/src/ServiceControl.Audit.AcceptanceTests.RavenDB/.editorconfig +++ b/src/ServiceControl.Audit.AcceptanceTests.RavenDB/.editorconfig @@ -2,3 +2,9 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Audit.AcceptanceTests/.editorconfig b/src/ServiceControl.Audit.AcceptanceTests/.editorconfig index 5f68a610b3..0a6ae3dffe 100644 --- a/src/ServiceControl.Audit.AcceptanceTests/.editorconfig +++ b/src/ServiceControl.Audit.AcceptanceTests/.editorconfig @@ -2,3 +2,8 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Audit.Persistence.InMemory/.editorconfig b/src/ServiceControl.Audit.Persistence.InMemory/.editorconfig index ff993b49bb..522a310bff 100644 --- a/src/ServiceControl.Audit.Persistence.InMemory/.editorconfig +++ b/src/ServiceControl.Audit.Persistence.InMemory/.editorconfig @@ -2,3 +2,9 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Audit.Persistence.RavenDB/.editorconfig b/src/ServiceControl.Audit.Persistence.RavenDB/.editorconfig index ff993b49bb..e2d491d8f7 100644 --- a/src/ServiceControl.Audit.Persistence.RavenDB/.editorconfig +++ b/src/ServiceControl.Audit.Persistence.RavenDB/.editorconfig @@ -2,3 +2,10 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0020.severity = none diff --git a/src/ServiceControl.Audit.Persistence.Tests.RavenDB/.editorconfig b/src/ServiceControl.Audit.Persistence.Tests.RavenDB/.editorconfig index 5f68a610b3..d786f604c0 100644 --- a/src/ServiceControl.Audit.Persistence.Tests.RavenDB/.editorconfig +++ b/src/ServiceControl.Audit.Persistence.Tests.RavenDB/.editorconfig @@ -2,3 +2,9 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0020.severity = none diff --git a/src/ServiceControl.Audit.Persistence.Tests/.editorconfig b/src/ServiceControl.Audit.Persistence.Tests/.editorconfig index 613ad2b9a4..d9eedc8bed 100644 --- a/src/ServiceControl.Audit.Persistence.Tests/.editorconfig +++ b/src/ServiceControl.Audit.Persistence.Tests/.editorconfig @@ -6,4 +6,8 @@ dotnet_diagnostic.PS0004.severity = none # A parameter of type CancellationToke dotnet_diagnostic.PS0018.severity = none # Add a CancellationToken parameter # Justification: Tests don't support cancellation and don't need to forward IMessageHandlerContext.CancellationToken -dotnet_diagnostic.NSB0002.severity = suggestion \ No newline at end of file +dotnet_diagnostic.NSB0002.severity = suggestion + +# Timezone debt: these DateTime values are Kind=Unspecified or Local, so the implicit cast to +# DateTimeOffset uses the build agent's offset. Each needs individual review before removing. +dotnet_diagnostic.PS0022.severity = none diff --git a/src/ServiceControl.Audit.Persistence/.editorconfig b/src/ServiceControl.Audit.Persistence/.editorconfig index ff993b49bb..522a310bff 100644 --- a/src/ServiceControl.Audit.Persistence/.editorconfig +++ b/src/ServiceControl.Audit.Persistence/.editorconfig @@ -2,3 +2,9 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Audit.UnitTests/.editorconfig b/src/ServiceControl.Audit.UnitTests/.editorconfig index 5f68a610b3..b0c4497648 100644 --- a/src/ServiceControl.Audit.UnitTests/.editorconfig +++ b/src/ServiceControl.Audit.UnitTests/.editorconfig @@ -2,3 +2,10 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Audit/.editorconfig b/src/ServiceControl.Audit/.editorconfig index ff993b49bb..c83c803ef4 100644 --- a/src/ServiceControl.Audit/.editorconfig +++ b/src/ServiceControl.Audit/.editorconfig @@ -2,3 +2,14 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0019.severity = none +dotnet_diagnostic.PS0020.severity = none +dotnet_diagnostic.PS0021.severity = none diff --git a/src/ServiceControl.Audit/Recoverability/DetectSuccessfulRetriesEnricher.cs b/src/ServiceControl.Audit/Recoverability/DetectSuccessfulRetriesEnricher.cs index a97ab1af44..e3f8f5b154 100644 --- a/src/ServiceControl.Audit/Recoverability/DetectSuccessfulRetriesEnricher.cs +++ b/src/ServiceControl.Audit/Recoverability/DetectSuccessfulRetriesEnricher.cs @@ -34,7 +34,7 @@ public void Enrich(AuditEnricherContext context) //and did not send the acknowledgment. We send it here to the acknowledgment queue. var ackMessage = new OutgoingMessage(Guid.NewGuid().ToString(), new Dictionary { - ["ServiceControl.Retry.Successful"] = DateTimeOffsetHelper.ToWireFormattedString(DateTime.UtcNow), + ["ServiceControl.Retry.Successful"] = DateTimeOffsetHelper.ToWireFormattedString(DateTimeOffset.UtcNow), ["ServiceControl.Retry.UniqueMessageId"] = newRetryMessageId }, Array.Empty()); var ackOperation = new TransportOperation(ackMessage, new UnicastAddressTag(ackQueue)); diff --git a/src/ServiceControl.Config.Tests/.editorconfig b/src/ServiceControl.Config.Tests/.editorconfig index c5410d8c02..235eef7320 100644 --- a/src/ServiceControl.Config.Tests/.editorconfig +++ b/src/ServiceControl.Config.Tests/.editorconfig @@ -6,3 +6,9 @@ dotnet_diagnostic.CA2007.severity = none # Justification: Executable specifications intentionally assign properties after the # object initializer to mirror user interaction order (e.g. typing a name after load) dotnet_diagnostic.IDE0017.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none diff --git a/src/ServiceControl.Config/AppBootstrapper.cs b/src/ServiceControl.Config/AppBootstrapper.cs index 4b8d0d19c6..33570c1bf6 100644 --- a/src/ServiceControl.Config/AppBootstrapper.cs +++ b/src/ServiceControl.Config/AppBootstrapper.cs @@ -84,6 +84,7 @@ protected override void BuildUp(object instance) container.InjectProperties(instance); } +#pragma warning disable PS0027 // Overrides BootstrapperBase.OnStartup, a void-returning Application.Startup handler protected override async void OnStartup(object sender, StartupEventArgs e) { ValidatorOptions.Global.DefaultRuleLevelCascadeMode = CascadeMode.Stop; @@ -99,6 +100,7 @@ protected override async void OnStartup(object sender, StartupEventArgs e) Application.Current.Shutdown(-1); } } +#pragma warning restore PS0027 IContainer container; } diff --git a/src/ServiceControl.Config/Framework/Commands/AwaitableAbstractCommand.cs b/src/ServiceControl.Config/Framework/Commands/AwaitableAbstractCommand.cs index e6339d7925..5f7c025895 100644 --- a/src/ServiceControl.Config/Framework/Commands/AwaitableAbstractCommand.cs +++ b/src/ServiceControl.Config/Framework/Commands/AwaitableAbstractCommand.cs @@ -14,6 +14,7 @@ bool System.Windows.Input.ICommand.CanExecute(object parameter) return CanExecute((T)parameter); } +#pragma warning disable PS0027 // ICommand.Execute returns void, so there is nothing to return the task to async void ICommand.Execute(T obj) { using (StartExecuting()) @@ -23,6 +24,7 @@ async void ICommand.Execute(T obj) } } +#pragma warning restore PS0027 void System.Windows.Input.ICommand.Execute(object parameter) { diff --git a/src/ServiceControl.Config/Framework/Commands/AwaitableDelegateCommand.cs b/src/ServiceControl.Config/Framework/Commands/AwaitableDelegateCommand.cs index 6742a36e41..fceff09df6 100644 --- a/src/ServiceControl.Config/Framework/Commands/AwaitableDelegateCommand.cs +++ b/src/ServiceControl.Config/Framework/Commands/AwaitableDelegateCommand.cs @@ -22,10 +22,12 @@ bool System.Windows.Input.ICommand.CanExecute(object parameter) return CanExecute((T)parameter); } +#pragma warning disable PS0027 // ICommand.Execute returns void, so there is nothing to return the task to async void System.Windows.Input.ICommand.Execute(object parameter) { await ExecuteAsync((T)parameter); } +#pragma warning restore PS0027 public async Task ExecuteAsync(T parameter) { diff --git a/src/ServiceControl.Config/Framework/Rx/RxViewAware.cs b/src/ServiceControl.Config/Framework/Rx/RxViewAware.cs index 7ad381fc88..6d97b121f0 100644 --- a/src/ServiceControl.Config/Framework/Rx/RxViewAware.cs +++ b/src/ServiceControl.Config/Framework/Rx/RxViewAware.cs @@ -18,7 +18,9 @@ public RxViewAware() /// /// The view chache for this instance. /// +#pragma warning disable PS0025 // Keyed by view context identity, so reference equality is what is wanted protected IDictionary Views { get; } +#pragma warning restore PS0025 /// /// Raised when a view is attached. diff --git a/src/ServiceControl.Config/UI/ListInstances/ListInstancesViewModel.cs b/src/ServiceControl.Config/UI/ListInstances/ListInstancesViewModel.cs index d94a29c949..0313b9de8e 100644 --- a/src/ServiceControl.Config/UI/ListInstances/ListInstancesViewModel.cs +++ b/src/ServiceControl.Config/UI/ListInstances/ListInstancesViewModel.cs @@ -127,6 +127,11 @@ public async Task HandleAsync(ResetInstances message, CancellationToken cancella NotifyOfPropertyChange(nameof(Instances)); } + // TODO: this is a genuine async void, not an event handler. Because it returns at the first + // await, HandleAsync(RefreshInstances) publishes PostRefreshInstances before the removals have + // finished, which is the ordering that method's own remarks say must not happen. Converting it + // to async Task needs the constructor call site at the top of this class restructured first. +#pragma warning disable PS0027 async void AddAndRemoveInstances() { // Remove instances that no longer exist on disk @@ -164,6 +169,7 @@ async void AddAndRemoveInstances() NotifyOfPropertyChange(nameof(HasConfigurationErrors)); NotifyOfPropertyChange(nameof(ConfigurationErrorMessage)); } +#pragma warning restore PS0027 readonly Func instanceDetailsFunc; readonly Func> getAllInstances; diff --git a/src/ServiceControl.Config/Xaml/Behaviours/RichTextBoxHelper.cs b/src/ServiceControl.Config/Xaml/Behaviours/RichTextBoxHelper.cs index d55efb0343..5fbb85fded 100644 --- a/src/ServiceControl.Config/Xaml/Behaviours/RichTextBoxHelper.cs +++ b/src/ServiceControl.Config/Xaml/Behaviours/RichTextBoxHelper.cs @@ -24,7 +24,9 @@ public static void SetDocumentXaml(DependencyObject obj, string value) obj.SetValue(DocumentXamlProperty, value); } +#pragma warning disable PS0025 // Tracks which threads are already inside the callback, so reference equality is what is wanted static HashSet recursionProtection = []; +#pragma warning restore PS0025 static readonly Regex doubleNewlineRegex = new Regex(@"\r?\n\r?\n", RegexOptions.Compiled); static readonly Regex singleNewlineRegex = new Regex(@"\r?\n", RegexOptions.Compiled); diff --git a/src/ServiceControl.DomainEvents/.editorconfig b/src/ServiceControl.DomainEvents/.editorconfig new file mode 100644 index 0000000000..dc8438ce16 --- /dev/null +++ b/src/ServiceControl.DomainEvents/.editorconfig @@ -0,0 +1,7 @@ +[*.cs] + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0019.severity = none diff --git a/src/ServiceControl.Hosting/.editorconfig b/src/ServiceControl.Hosting/.editorconfig new file mode 100644 index 0000000000..2815635efb --- /dev/null +++ b/src/ServiceControl.Hosting/.editorconfig @@ -0,0 +1,6 @@ +[*.cs] + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Hosting/IHostApplicationBuilderExtensions.cs b/src/ServiceControl.Hosting/HostApplicationBuilderExtensions.cs similarity index 90% rename from src/ServiceControl.Hosting/IHostApplicationBuilderExtensions.cs rename to src/ServiceControl.Hosting/HostApplicationBuilderExtensions.cs index 303595b337..b221b73663 100644 --- a/src/ServiceControl.Hosting/IHostApplicationBuilderExtensions.cs +++ b/src/ServiceControl.Hosting/HostApplicationBuilderExtensions.cs @@ -4,7 +4,7 @@ namespace ServiceControl.Hosting; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting.WindowsServices; -public static class IHostApplicationBuilderExtensions +public static class HostApplicationBuilderExtensions { public static void AddWindowsServiceWithRequestTimeout(this IHostApplicationBuilder builder) { diff --git a/src/ServiceControl.Infrastructure.Metrics/.editorconfig b/src/ServiceControl.Infrastructure.Metrics/.editorconfig new file mode 100644 index 0000000000..3e7fc9797e --- /dev/null +++ b/src/ServiceControl.Infrastructure.Metrics/.editorconfig @@ -0,0 +1,7 @@ +[*.cs] + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0020.severity = none diff --git a/src/ServiceControl.Infrastructure.Tests/.editorconfig b/src/ServiceControl.Infrastructure.Tests/.editorconfig index 5f68a610b3..b09da988d4 100644 --- a/src/ServiceControl.Infrastructure.Tests/.editorconfig +++ b/src/ServiceControl.Infrastructure.Tests/.editorconfig @@ -2,3 +2,8 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0019.severity = none diff --git a/src/ServiceControl.Infrastructure/.editorconfig b/src/ServiceControl.Infrastructure/.editorconfig new file mode 100644 index 0000000000..ac122a63b6 --- /dev/null +++ b/src/ServiceControl.Infrastructure/.editorconfig @@ -0,0 +1,10 @@ +[*.cs] + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0020.severity = none +dotnet_diagnostic.PS0021.severity = none diff --git a/src/ServiceControl.Management.PowerShell/.editorconfig b/src/ServiceControl.Management.PowerShell/.editorconfig new file mode 100644 index 0000000000..2815635efb --- /dev/null +++ b/src/ServiceControl.Management.PowerShell/.editorconfig @@ -0,0 +1,6 @@ +[*.cs] + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Monitoring.AcceptanceTests/.editorconfig b/src/ServiceControl.Monitoring.AcceptanceTests/.editorconfig index 5f68a610b3..bbcb303765 100644 --- a/src/ServiceControl.Monitoring.AcceptanceTests/.editorconfig +++ b/src/ServiceControl.Monitoring.AcceptanceTests/.editorconfig @@ -2,3 +2,9 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Monitoring/.editorconfig b/src/ServiceControl.Monitoring/.editorconfig index aff82c0034..c1cb416fea 100644 --- a/src/ServiceControl.Monitoring/.editorconfig +++ b/src/ServiceControl.Monitoring/.editorconfig @@ -2,3 +2,10 @@ # Justification: Application synchronization contexts don't require ConfigureAwait(false) dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0019.severity = none diff --git a/src/ServiceControl.MultiInstance.AcceptanceTests/.editorconfig b/src/ServiceControl.MultiInstance.AcceptanceTests/.editorconfig index 5f68a610b3..b0c4497648 100644 --- a/src/ServiceControl.MultiInstance.AcceptanceTests/.editorconfig +++ b/src/ServiceControl.MultiInstance.AcceptanceTests/.editorconfig @@ -2,3 +2,10 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Persistence.EFCore.PostgreSql/.editorconfig b/src/ServiceControl.Persistence.EFCore.PostgreSql/.editorconfig index 1a80b3d27b..ea99d7cc09 100644 --- a/src/ServiceControl.Persistence.EFCore.PostgreSql/.editorconfig +++ b/src/ServiceControl.Persistence.EFCore.PostgreSql/.editorconfig @@ -3,7 +3,12 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none + # Disable style rules for auto-generated EF migrations [Migrations/**.cs] dotnet_diagnostic.IDE0065.severity = none -generated_code = true \ No newline at end of file +generated_code = true diff --git a/src/ServiceControl.Persistence.EFCore.SqlServer/.editorconfig b/src/ServiceControl.Persistence.EFCore.SqlServer/.editorconfig index 1a80b3d27b..ea99d7cc09 100644 --- a/src/ServiceControl.Persistence.EFCore.SqlServer/.editorconfig +++ b/src/ServiceControl.Persistence.EFCore.SqlServer/.editorconfig @@ -3,7 +3,12 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none + # Disable style rules for auto-generated EF migrations [Migrations/**.cs] dotnet_diagnostic.IDE0065.severity = none -generated_code = true \ No newline at end of file +generated_code = true diff --git a/src/ServiceControl.Persistence.EFCore/.editorconfig b/src/ServiceControl.Persistence.EFCore/.editorconfig index 1a80b3d27b..7651f47081 100644 --- a/src/ServiceControl.Persistence.EFCore/.editorconfig +++ b/src/ServiceControl.Persistence.EFCore/.editorconfig @@ -3,7 +3,17 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0004.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0019.severity = none + # Disable style rules for auto-generated EF migrations [Migrations/**.cs] dotnet_diagnostic.IDE0065.severity = none -generated_code = true \ No newline at end of file +generated_code = true diff --git a/src/ServiceControl.Persistence.RavenDB/.editorconfig b/src/ServiceControl.Persistence.RavenDB/.editorconfig index ff993b49bb..5642cb469b 100644 --- a/src/ServiceControl.Persistence.RavenDB/.editorconfig +++ b/src/ServiceControl.Persistence.RavenDB/.editorconfig @@ -2,3 +2,12 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0020.severity = none +dotnet_diagnostic.PS0021.severity = none diff --git a/src/ServiceControl.Persistence.Tests.InMemory/.editorconfig b/src/ServiceControl.Persistence.Tests.InMemory/.editorconfig index 5f68a610b3..0a6ae3dffe 100644 --- a/src/ServiceControl.Persistence.Tests.InMemory/.editorconfig +++ b/src/ServiceControl.Persistence.Tests.InMemory/.editorconfig @@ -2,3 +2,8 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Persistence.Tests.PostgreSql/.editorconfig b/src/ServiceControl.Persistence.Tests.PostgreSql/.editorconfig index 20102eaa39..e88159f88e 100644 --- a/src/ServiceControl.Persistence.Tests.PostgreSql/.editorconfig +++ b/src/ServiceControl.Persistence.Tests.PostgreSql/.editorconfig @@ -3,3 +3,11 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0008.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0019.severity = none + diff --git a/src/ServiceControl.Persistence.Tests.RavenDB/.editorconfig b/src/ServiceControl.Persistence.Tests.RavenDB/.editorconfig index 5f68a610b3..0a6ae3dffe 100644 --- a/src/ServiceControl.Persistence.Tests.RavenDB/.editorconfig +++ b/src/ServiceControl.Persistence.Tests.RavenDB/.editorconfig @@ -2,3 +2,8 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Persistence.Tests.SqlServer/.editorconfig b/src/ServiceControl.Persistence.Tests.SqlServer/.editorconfig index 20102eaa39..e88159f88e 100644 --- a/src/ServiceControl.Persistence.Tests.SqlServer/.editorconfig +++ b/src/ServiceControl.Persistence.Tests.SqlServer/.editorconfig @@ -3,3 +3,11 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0008.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0019.severity = none + diff --git a/src/ServiceControl.Persistence.Tests/.editorconfig b/src/ServiceControl.Persistence.Tests/.editorconfig index 5f68a610b3..3fca48a527 100644 --- a/src/ServiceControl.Persistence.Tests/.editorconfig +++ b/src/ServiceControl.Persistence.Tests/.editorconfig @@ -2,3 +2,11 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0006.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Persistence/.editorconfig b/src/ServiceControl.Persistence/.editorconfig index ff993b49bb..ef7d8e541d 100644 --- a/src/ServiceControl.Persistence/.editorconfig +++ b/src/ServiceControl.Persistence/.editorconfig @@ -2,3 +2,11 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.RavenDB/.editorconfig b/src/ServiceControl.RavenDB/.editorconfig index ff993b49bb..522a310bff 100644 --- a/src/ServiceControl.RavenDB/.editorconfig +++ b/src/ServiceControl.RavenDB/.editorconfig @@ -2,3 +2,9 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.ASBS.Tests/.editorconfig b/src/ServiceControl.Transports.ASBS.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.ASBS.Tests/.editorconfig +++ b/src/ServiceControl.Transports.ASBS.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.ASBS/.editorconfig b/src/ServiceControl.Transports.ASBS/.editorconfig index ff993b49bb..430f2565bd 100644 --- a/src/ServiceControl.Transports.ASBS/.editorconfig +++ b/src/ServiceControl.Transports.ASBS/.editorconfig @@ -2,3 +2,10 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0004.severity = none +dotnet_diagnostic.PS0017.severity = none diff --git a/src/ServiceControl.Transports.ASQ.Tests/.editorconfig b/src/ServiceControl.Transports.ASQ.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.ASQ.Tests/.editorconfig +++ b/src/ServiceControl.Transports.ASQ.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.ASQ/.editorconfig b/src/ServiceControl.Transports.ASQ/.editorconfig index ff993b49bb..13cac70b79 100644 --- a/src/ServiceControl.Transports.ASQ/.editorconfig +++ b/src/ServiceControl.Transports.ASQ/.editorconfig @@ -2,3 +2,9 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0017.severity = none diff --git a/src/ServiceControl.Transports.IBMMQ.Tests/.editorconfig b/src/ServiceControl.Transports.IBMMQ.Tests/.editorconfig new file mode 100644 index 0000000000..2815635efb --- /dev/null +++ b/src/ServiceControl.Transports.IBMMQ.Tests/.editorconfig @@ -0,0 +1,6 @@ +[*.cs] + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.IBMMQ/.editorconfig b/src/ServiceControl.Transports.IBMMQ/.editorconfig new file mode 100644 index 0000000000..1942f21999 --- /dev/null +++ b/src/ServiceControl.Transports.IBMMQ/.editorconfig @@ -0,0 +1,7 @@ +[*.cs] + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0017.severity = none diff --git a/src/ServiceControl.Transports.IBMMQ/IBMMQTransportCustomization.cs b/src/ServiceControl.Transports.IBMMQ/IBMMQTransportCustomization.cs index c013240ea8..2a52523a46 100644 --- a/src/ServiceControl.Transports.IBMMQ/IBMMQTransportCustomization.cs +++ b/src/ServiceControl.Transports.IBMMQ/IBMMQTransportCustomization.cs @@ -9,6 +9,7 @@ using NServiceBus.CustomChecks; using NServiceBus.Transport.IBMMQ; +#pragma warning disable PS0024 // The I is from IBM, matching NServiceBus.Transport.IBMMQ public class IBMMQTransportCustomization : TransportCustomization { protected override void CustomizeTransportForPrimaryEndpoint(EndpointConfiguration endpointConfiguration, IBMMQTransport transportDefinition, TransportSettings transportSettings) => @@ -84,4 +85,5 @@ protected override IBMMQTransport CreateTransport(TransportSettings transportSet return transport; } -} \ No newline at end of file +} +#pragma warning restore PS0024 \ No newline at end of file diff --git a/src/ServiceControl.Transports.Learning/.editorconfig b/src/ServiceControl.Transports.Learning/.editorconfig index ff993b49bb..13cac70b79 100644 --- a/src/ServiceControl.Transports.Learning/.editorconfig +++ b/src/ServiceControl.Transports.Learning/.editorconfig @@ -2,3 +2,9 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0017.severity = none diff --git a/src/ServiceControl.Transports.Msmq.Tests/.editorconfig b/src/ServiceControl.Transports.Msmq.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.Msmq.Tests/.editorconfig +++ b/src/ServiceControl.Transports.Msmq.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.Msmq/.editorconfig b/src/ServiceControl.Transports.Msmq/.editorconfig index ff993b49bb..eae5d84087 100644 --- a/src/ServiceControl.Transports.Msmq/.editorconfig +++ b/src/ServiceControl.Transports.Msmq/.editorconfig @@ -2,3 +2,8 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none diff --git a/src/ServiceControl.Transports.PostgreSql.Tests/.editorconfig b/src/ServiceControl.Transports.PostgreSql.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.PostgreSql.Tests/.editorconfig +++ b/src/ServiceControl.Transports.PostgreSql.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.PostgreSql/.editorconfig b/src/ServiceControl.Transports.PostgreSql/.editorconfig index ff993b49bb..efbfc38b1f 100644 --- a/src/ServiceControl.Transports.PostgreSql/.editorconfig +++ b/src/ServiceControl.Transports.PostgreSql/.editorconfig @@ -2,3 +2,11 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0004.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0019.severity = none diff --git a/src/ServiceControl.Transports.RabbitMQ/.editorconfig b/src/ServiceControl.Transports.RabbitMQ/.editorconfig index ff993b49bb..9927cfeb58 100644 --- a/src/ServiceControl.Transports.RabbitMQ/.editorconfig +++ b/src/ServiceControl.Transports.RabbitMQ/.editorconfig @@ -2,3 +2,10 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0019.severity = none diff --git a/src/ServiceControl.Transports.RabbitMQClassicConventionalRouting.Tests/.editorconfig b/src/ServiceControl.Transports.RabbitMQClassicConventionalRouting.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.RabbitMQClassicConventionalRouting.Tests/.editorconfig +++ b/src/ServiceControl.Transports.RabbitMQClassicConventionalRouting.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.RabbitMQClassicDirectRouting.Tests/.editorconfig b/src/ServiceControl.Transports.RabbitMQClassicDirectRouting.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.RabbitMQClassicDirectRouting.Tests/.editorconfig +++ b/src/ServiceControl.Transports.RabbitMQClassicDirectRouting.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.RabbitMQQuorumConventionalRouting.Tests/.editorconfig b/src/ServiceControl.Transports.RabbitMQQuorumConventionalRouting.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.RabbitMQQuorumConventionalRouting.Tests/.editorconfig +++ b/src/ServiceControl.Transports.RabbitMQQuorumConventionalRouting.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.RabbitMQQuorumDirectRouting.Tests/.editorconfig b/src/ServiceControl.Transports.RabbitMQQuorumDirectRouting.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.RabbitMQQuorumDirectRouting.Tests/.editorconfig +++ b/src/ServiceControl.Transports.RabbitMQQuorumDirectRouting.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.SQS.Tests/.editorconfig b/src/ServiceControl.Transports.SQS.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.SQS.Tests/.editorconfig +++ b/src/ServiceControl.Transports.SQS.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.SQS/.editorconfig b/src/ServiceControl.Transports.SQS/.editorconfig index ff993b49bb..13cac70b79 100644 --- a/src/ServiceControl.Transports.SQS/.editorconfig +++ b/src/ServiceControl.Transports.SQS/.editorconfig @@ -2,3 +2,9 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0017.severity = none diff --git a/src/ServiceControl.Transports.SqlServer.Tests/.editorconfig b/src/ServiceControl.Transports.SqlServer.Tests/.editorconfig index 0279bdc2db..0a6ae3dffe 100644 --- a/src/ServiceControl.Transports.SqlServer.Tests/.editorconfig +++ b/src/ServiceControl.Transports.SqlServer.Tests/.editorconfig @@ -1,4 +1,9 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports.SqlServer/.editorconfig b/src/ServiceControl.Transports.SqlServer/.editorconfig index ff993b49bb..efbfc38b1f 100644 --- a/src/ServiceControl.Transports.SqlServer/.editorconfig +++ b/src/ServiceControl.Transports.SqlServer/.editorconfig @@ -2,3 +2,11 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0004.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0019.severity = none diff --git a/src/ServiceControl.Transports.Tests/.editorconfig b/src/ServiceControl.Transports.Tests/.editorconfig index 0279bdc2db..062de7d0db 100644 --- a/src/ServiceControl.Transports.Tests/.editorconfig +++ b/src/ServiceControl.Transports.Tests/.editorconfig @@ -1,4 +1,10 @@ [*.cs] # Justification: Test project -dotnet_diagnostic.CA2007.severity = none \ No newline at end of file +dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl.Transports/.editorconfig b/src/ServiceControl.Transports/.editorconfig index ff993b49bb..6d6299e825 100644 --- a/src/ServiceControl.Transports/.editorconfig +++ b/src/ServiceControl.Transports/.editorconfig @@ -2,3 +2,11 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0019.severity = none diff --git a/src/ServiceControl.UnitTests/.editorconfig b/src/ServiceControl.UnitTests/.editorconfig index 5f68a610b3..d9b7048273 100644 --- a/src/ServiceControl.UnitTests/.editorconfig +++ b/src/ServiceControl.UnitTests/.editorconfig @@ -2,3 +2,11 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0018.severity = none diff --git a/src/ServiceControl/.editorconfig b/src/ServiceControl/.editorconfig index ff993b49bb..935fb04254 100644 --- a/src/ServiceControl/.editorconfig +++ b/src/ServiceControl/.editorconfig @@ -2,3 +2,15 @@ # Justification: ServiceControl app has no synchronization context dotnet_diagnostic.CA2007.severity = none + +# Cancellation analyzer debt. These fire because Particular.Analyzers is no longer pinned to 0.9.0. +# They are scheduled work, not accepted exceptions: remove a line once this project has no +# violations of that rule left, and never add a rule back to this list. +dotnet_diagnostic.PS0003.severity = none +dotnet_diagnostic.PS0004.severity = none +dotnet_diagnostic.PS0006.severity = none +dotnet_diagnostic.PS0013.severity = none +dotnet_diagnostic.PS0017.severity = none +dotnet_diagnostic.PS0018.severity = none +dotnet_diagnostic.PS0019.severity = none +dotnet_diagnostic.PS0020.severity = none diff --git a/src/ServiceControl/CompositeViews/Messages/ScatterGatherApi.cs b/src/ServiceControl/CompositeViews/Messages/ScatterGatherApi.cs index 9058cb9be6..1b4f167667 100644 --- a/src/ServiceControl/CompositeViews/Messages/ScatterGatherApi.cs +++ b/src/ServiceControl/CompositeViews/Messages/ScatterGatherApi.cs @@ -157,8 +157,7 @@ async Task> FetchAndParse(HttpClient httpClient, string pathAn remoteInstanceSetting.TemporarilyUnavailable = true; logger.LogWarning( httpRequestException, - "An HttpRequestException occurred when querying remote instance at {RemoteInstanceBaseAddress}. The instance at uri: {RemoteInstanceBaseAddress} will be temporarily disabled", - remoteInstanceSetting.BaseAddress, + "An HttpRequestException occurred when querying remote instance at {RemoteInstanceBaseAddress}. The instance will be temporarily disabled", remoteInstanceSetting.BaseAddress); return QueryResult.Empty(); } diff --git a/src/ServiceControl/Licensing/ActiveLicense.cs b/src/ServiceControl/Licensing/ActiveLicense.cs index eed4880136..2fe69304a6 100644 --- a/src/ServiceControl/Licensing/ActiveLicense.cs +++ b/src/ServiceControl/Licensing/ActiveLicense.cs @@ -47,7 +47,7 @@ internal static async Task ValidateTrialLicense(LicenseDetails l } //If the trial end date in db has been tampered, invalidate the license - if (trialEndDateInDb > DateOnly.FromDateTime(DateTime.Now).AddDays(MaxTrialPeriodInDays)) + if (trialEndDateInDb > DateOnly.FromDateTime(DateTime.UtcNow).AddDays(MaxTrialPeriodInDays)) { return LicenseDetails.TrialExpired(); }