Skip to content

Commit

Permalink
chore: bump version, update changelog, fix analyzer warrnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cugoszi committed Jan 31, 2024
1 parent ef33a3f commit 6b9129f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -272,14 +272,14 @@ protected override Task<FallbackResult> Fallback(
}
}

private class TestCall : TestCallBase<TestRequest>
private sealed class TestCall : TestCallBase<TestRequest>
{
public TestCall(TestCallConfiguration configuration) : base(configuration)
{
}
}

private class TestCallTimeout : TestCallBase<TestRequestTimeout>
private sealed class TestCallTimeout : TestCallBase<TestRequestTimeout>
{
private readonly TestCallConfiguration _configuration;

Expand All @@ -294,7 +294,7 @@ public TestCallTimeout(TestCallConfiguration configuration) : base(configuration
TimeSpan.FromMilliseconds(_configuration.DefaultTimeoutInMs.Value));
}

private class TestCallCustomPolicy : TestCallBase<TestRequestCustomPolicy>
private sealed class TestCallCustomPolicy : TestCallBase<TestRequestCustomPolicy>
{
private readonly TestCallConfiguration _configuration;

Expand All @@ -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<TestResponse>;
private sealed record TestRequest(string Data) : IRequest<TestResponse>;

private record TestRequestTimeout(string Data) : IRequest<TestResponse>;
private sealed record TestRequestTimeout(string Data) : IRequest<TestResponse>;

private record TestRequestCustomPolicy(string Data) : IRequest<TestResponse>;
private sealed record TestRequestCustomPolicy(string Data) : IRequest<TestResponse>;

private record TestResponse(string Data);
private sealed record TestResponse(string Data);

#region Sample
private class SampleDependencyCall : DependencyCall<SampleRequestData, SampleResponseData>
private sealed class SampleDependencyCall : DependencyCall<SampleRequestData, SampleResponseData>
{
protected override Task<SampleResponseData> Execute(
SampleRequestData request,
Expand All @@ -338,7 +338,7 @@ protected override Task<FallbackResult> Fallback(
}
}

private class SampleNoFallbackDependencyCall : DependencyCall<SampleRequestData, SampleResponseData>
private sealed class SampleNoFallbackDependencyCall : DependencyCall<SampleRequestData, SampleResponseData>
{
protected override Task<SampleResponseData> Execute(
SampleRequestData request,
Expand All @@ -356,8 +356,8 @@ protected override Task<FallbackResult> Fallback(
}
}

private record SampleRequestData(string Data) : IRequest<SampleResponseData>;
private sealed record SampleRequestData(string Data) : IRequest<SampleResponseData>;

private record SampleResponseData(string Data);
private sealed record SampleResponseData(string Data);
#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/Allegro.Extensions.DependencyCall/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Allegro.Extensions.DependencyCall/version.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionPrefix>1.1.0</VersionPrefix>
</PropertyGroup>
</Project>

0 comments on commit 6b9129f

Please sign in to comment.