From 6b9129f376f908835793301b68c412c15b02db39 Mon Sep 17 00:00:00 2001 From: Mateusz Marciniak Date: Wed, 31 Jan 2024 12:37:26 +0100 Subject: [PATCH] chore: bump version, update changelog, fix analyzer warrnings --- .../PrometheusDependencyCallMetrics.cs | 5 +++- .../DependencyCallDispatcherSpec.cs | 26 +++++++++---------- .../Fixture.cs | 2 +- .../CHANGELOG.md | 6 +++++ .../version.xml | 2 +- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Metrics.Prometheus/PrometheusDependencyCallMetrics.cs b/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Metrics.Prometheus/PrometheusDependencyCallMetrics.cs index 347466e..09b5476 100644 --- a/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Metrics.Prometheus/PrometheusDependencyCallMetrics.cs +++ b/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Metrics.Prometheus/PrometheusDependencyCallMetrics.cs @@ -18,8 +18,11 @@ private static Histogram DependencyCallDurationFactory(IMetricFactory metrics, s "Duration of dependency call", new HistogramConfiguration() { + // CA1861 : Prefer 'static readonly' fields over constant array arguments if the called method is called repeatedly and is not mutating the passed array +#pragma warning disable CA1861 LabelNames = new[] { "dependencyCallName", "type" }, - Buckets = new[] { 0.008, 0.016, 0.032, 0.064, 0.128, 0.512, 1, 4, 16 } +#pragma warning restore CA1861 + Buckets = new[] { 0.008, 0.016, 0.032, 0.064, 0.128, 0.512, 1, 4, 16 }, }); public void Succeeded(IRequest request, TimeSpan duration) diff --git a/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Tests.Unit/DependencyCallDispatcherSpec.cs b/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Tests.Unit/DependencyCallDispatcherSpec.cs index e4fa627..0793ad0 100644 --- a/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Tests.Unit/DependencyCallDispatcherSpec.cs +++ b/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Tests.Unit/DependencyCallDispatcherSpec.cs @@ -225,7 +225,7 @@ public void Able_to_register_prometheus_metrics() } } - private record TestCallConfiguration( + private sealed record TestCallConfiguration( TestResponse Response, bool ShouldThrowOnError = false, Exception? Exception = null, @@ -272,14 +272,14 @@ protected override Task Fallback( } } - private class TestCall : TestCallBase + private sealed class TestCall : TestCallBase { public TestCall(TestCallConfiguration configuration) : base(configuration) { } } - private class TestCallTimeout : TestCallBase + private sealed class TestCallTimeout : TestCallBase { private readonly TestCallConfiguration _configuration; @@ -294,7 +294,7 @@ public TestCallTimeout(TestCallConfiguration configuration) : base(configuration TimeSpan.FromMilliseconds(_configuration.DefaultTimeoutInMs.Value)); } - private class TestCallCustomPolicy : TestCallBase + private sealed class TestCallCustomPolicy : TestCallBase { private readonly TestCallConfiguration _configuration; @@ -307,20 +307,20 @@ public TestCallCustomPolicy(TestCallConfiguration configuration) : base(configur _configuration.CustomPolicy ?? base.CustomPolicy; } - private class TestException : Exception + private sealed class TestException : Exception { } - private record TestRequest(string Data) : IRequest; + private sealed record TestRequest(string Data) : IRequest; - private record TestRequestTimeout(string Data) : IRequest; + private sealed record TestRequestTimeout(string Data) : IRequest; - private record TestRequestCustomPolicy(string Data) : IRequest; + private sealed record TestRequestCustomPolicy(string Data) : IRequest; - private record TestResponse(string Data); + private sealed record TestResponse(string Data); #region Sample - private class SampleDependencyCall : DependencyCall + private sealed class SampleDependencyCall : DependencyCall { protected override Task Execute( SampleRequestData request, @@ -338,7 +338,7 @@ protected override Task Fallback( } } - private class SampleNoFallbackDependencyCall : DependencyCall + private sealed class SampleNoFallbackDependencyCall : DependencyCall { protected override Task Execute( SampleRequestData request, @@ -356,8 +356,8 @@ protected override Task Fallback( } } - private record SampleRequestData(string Data) : IRequest; + private sealed record SampleRequestData(string Data) : IRequest; - private record SampleResponseData(string Data); + private sealed record SampleResponseData(string Data); #endregion } \ No newline at end of file diff --git a/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Tests.Unit/Fixture.cs b/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Tests.Unit/Fixture.cs index 0dd5798..28dc7cb 100644 --- a/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Tests.Unit/Fixture.cs +++ b/src/Allegro.Extensions.DependencyCall/Allegro.Extensions.DependencyCall.Tests.Unit/Fixture.cs @@ -6,7 +6,7 @@ namespace Allegro.Extensions.DependencyCall.Tests.Unit; -internal class Fixture +internal sealed class Fixture { private readonly ServiceCollection _services; private readonly Assembly[] _applicationAssemblies; diff --git a/src/Allegro.Extensions.DependencyCall/CHANGELOG.md b/src/Allegro.Extensions.DependencyCall/CHANGELOG.md index 0d51e34..13171c8 100644 --- a/src/Allegro.Extensions.DependencyCall/CHANGELOG.md +++ b/src/Allegro.Extensions.DependencyCall/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.0] - 2024-01-31 + +### Added + +* Filtered out Microsoft packages from assembly loading due to a bug in Microsoft.Data.SqlClient and .net 8 + ## [1.0.0] - 2023-06-27 ### Added diff --git a/src/Allegro.Extensions.DependencyCall/version.xml b/src/Allegro.Extensions.DependencyCall/version.xml index 581c1f4..faedbe2 100644 --- a/src/Allegro.Extensions.DependencyCall/version.xml +++ b/src/Allegro.Extensions.DependencyCall/version.xml @@ -1,5 +1,5 @@ - 1.0.0 + 1.1.0 \ No newline at end of file