Skip to content

Commit 448251c

Browse files
authored
Merge pull request #6 from astar-development/features/drop-astar-dev-functional-extensions
Features/drop astar dev functional extensions
2 parents e9469fa + de5e004 commit 448251c

File tree

8 files changed

+56
-15
lines changed

8 files changed

+56
-15
lines changed

src/AStar.Dev.Api.HealthChecks/AStar.Dev.Api.HealthChecks.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
<PackageLicenseFile>LICENSE</PackageLicenseFile>
2222
<PackageProjectUrl>https://github.com/astar-development/astar-dev-api-health-checks</PackageProjectUrl>
2323
<PackageReadmeFile>Readme.md</PackageReadmeFile>
24-
<PackageReleaseNotes>Removes the defunct Health Check, leaving the 'Result' object-based version.</PackageReleaseNotes>
24+
<PackageReleaseNotes>Drop AStar.Dev.Function.Extensions for CSharpFunctionalExtensions</PackageReleaseNotes>
2525
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2626
<PackageTags>ASP.Core HealthChecks;HealthChecks</PackageTags>
2727
<RepositoryType>git</RepositoryType>
2828
<RepositoryUrl>https://github.com/astar-development/astar-dev-api-health-checks.git</RepositoryUrl>
2929
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
3030
<TargetFramework>net9.0</TargetFramework>
3131
<Title>AStar API HealthChecks</Title>
32-
<Version>0.4.1</Version>
32+
<Version>0.4.2</Version>
3333
</PropertyGroup>
3434

3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -43,7 +43,7 @@
4343
</PropertyGroup>
4444

4545
<ItemGroup>
46-
<PackageReference Include="AStar.Dev.Functional.Extensions" Version="0.2.0"/>
46+
<PackageReference Include="CSharpFunctionalExtensions" Version="3.6.0"/>
4747
<PackageReference Include="AStar.Dev.Technical.Debt.Reporting" Version="0.1.0"/>
4848
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="9.0.4"/>
4949
<PackageReference Include="Microsoft.Extensions.Features" Version="9.0.4"/>
@@ -60,7 +60,7 @@
6060
</None>
6161
<None Update="Readme.md">
6262
<Pack>true</Pack>
63-
<PackagePath></PackagePath>
63+
<PackagePath>\</PackagePath>
6464
</None>
6565
</ItemGroup>
6666

src/AStar.Dev.Api.HealthChecks/AStar.Dev.Api.HealthChecks.xml

Lines changed: 17 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
11
namespace AStar.Dev.Api.HealthChecks;
22

33
/// <summary>
4+
/// The <see cref="HealthStatusResponse" /> class contains a strongly-typed response for the Health Checks to use
45
/// </summary>
56
public sealed record HealthStatusResponse
67
{
78
/// <summary>
9+
/// Gets or sets the name of the Health Check
810
/// </summary>
911
public string Name { get; set; } = string.Empty;
1012

1113
/// <summary>
14+
/// Gets or sets the description of the Health Status response
1215
/// </summary>
1316
public string? Description { get; set; } = "Unable to retrieve the description of the Health Status";
1417

1518
/// <summary>
19+
/// Gets or sets the Status of the Health Status response
1620
/// </summary>
1721
public string Status { get; set; } = string.Empty;
1822

1923
/// <summary>
24+
/// Gets or sets the milliseconds the Health Check took to complete
2025
/// </summary>
2126
public double DurationInMilliseconds { get; set; }
2227

2328
/// <summary>
29+
/// TBH, not sure if this is populated anywhere at the time of writing
2430
/// </summary>
2531
public IReadOnlyDictionary<string, object>? Data { get; set; }
2632

2733
/// <summary>
34+
/// Gets or sets the <see cref="Exception" /> (or derived type) encountered during the Health Check call
2835
/// </summary>
2936
public string? Exception { get; set; } = string.Empty;
3037
}

src/AStar.Dev.Api.HealthChecks/IApiClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using AStar.Dev.Functional.Extensions;
1+
using CSharpFunctionalExtensions;
22

33
namespace AStar.Dev.Api.HealthChecks;
44

@@ -12,7 +12,7 @@ public interface IApiClient
1212
/// </summary>
1313
/// <param name="cancellationToken">The token to optionally use to cancel the operation</param>
1414
/// <returns>
15-
/// An instance of the <see cref="Result{TError,TSuccess}" /> class wrapping an instance of the <see href="HealthStatusResponse"></see> class when successful (containing the text representation of
15+
/// An instance of the <see cref="Result" /> class wrapping an instance of the <see href="HealthStatusResponse"></see> class when successful (containing the text representation of
1616
/// the API Health Status). When the call fails, a string error message will be returned
1717
/// </returns>
1818
public Task<Result<string, HealthStatusResponse>> GetHealthCheckAsync(CancellationToken cancellationToken = default);
Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
Update
1+
# AStar.Dev.Api.HealthChecks
2+
3+
This NuGet package, as the name suggests, contains the generic methods for making Health-Check calls to the AStar Dev APIs
4+
5+
## GitHub build
6+
7+
[![.NET](https://github.com/astar-development/astar-dev-api-health-checks/actions/workflows/dotnet.yml/badge.svg)](https://github.com/astar-development/astar-dev-api-health-checks/actions/workflows/dotnet.yml)
8+
9+
## SonarCloud Analysis Results
10+
11+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=jbarden_astar-dev-api-health-checks&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=jbarden_astar-dev-api-health-checks)
12+
13+
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=jbarden_astar-dev-api-health-checks&metric=bugs)](https://sonarcloud.io/summary/new_code?id=jbarden_astar-dev-api-health-checks)
14+
15+
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=jbarden_astar-dev-api-health-checks&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=jbarden_astar-dev-api-health-checks)
16+
17+
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=jbarden_astar-dev-api-health-checks&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=jbarden_astar-dev-api-health-checks)
18+
19+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=jbarden_astar-dev-api-health-checks&metric=coverage)](https://sonarcloud.io/summary/new_code?id=jbarden_astar-dev-api-health-checks)
20+
21+
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=jbarden_astar-dev-api-health-checks&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=jbarden_astar-dev-api-health-checks)
22+

test/AStar.Dev.Api.HealthChecks.Tests.Unit/AStar.Dev.Api.HealthChecks.Tests.Unit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="AStar.Dev.Utilities" Version="1.6.0"/>
18+
<PackageReference Include="AStar.Dev.Utilities" Version="1.6.1"/>
1919
<PackageReference Include="coverlet.collector" Version="6.0.4">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

test/AStar.Dev.Api.HealthChecks.Tests.Unit/HealthCheckExtensionsShould.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace AStar.Dev.Api.HealthChecks;
77

88
[TestSubject(typeof(HealthCheckExtensions))]
9-
public class HealthCheckExtensionsShould()
9+
public class HealthCheckExtensionsShould
1010
{
1111
[Fact]
1212
public void ConfigureTheHealthCheckEndpoints()

test/AStar.Dev.Api.HealthChecks.Tests.Unit/HealthStatusResponseShould.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ public class HealthStatusResponseShould
99
[Fact]
1010
public void ContainTheExpectedProperties()
1111
{
12-
new HealthStatusResponse(){Name = "Test Name", Description = "Test Description", DurationInMilliseconds = 123, Data = new Dictionary<string, object>(), Exception = "Test Exception", Status = "OK"}
12+
new HealthStatusResponse
13+
{ Name = "Test Name", Description = "Test Description", DurationInMilliseconds = 123, Data = new Dictionary<string, object>(), Exception = "Test Exception", Status = "OK" }
1314
.ToJson().ShouldMatchApproved();
1415
}
1516
}

0 commit comments

Comments
 (0)