Skip to content

Commit

Permalink
Created dependency isolation package: HealthCheckPlus.Abstractions. N…
Browse files Browse the repository at this point in the history
…ow all public interfaces and classes are isolated in another assembly
  • Loading branch information
Fernando Cerqueira committed Feb 26, 2024
1 parent aef3c9b commit 2a6dc6e
Show file tree
Hide file tree
Showing 39 changed files with 178 additions and 58 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT

- name: Pack NuGet Package
run: dotnet pack src/HealthCheckPlus.csproj -c Release -o ./dist -p:Version=${{ steps.setup_version.outputs.VERSION }}
run: dotnet pack src/HealthCheckPlus/HealthCheckPlus.csproj -c Release -o ./dist -p:Version=${{ steps.setup_version.outputs.VERSION }}
run: dotnet pack src/HealthCheckPlus.Abstractions/HealthCheckPlus.Abstractions.csproj -c Release -o ./dist -p:Version=${{ steps.setup_version.outputs.VERSION }}

- name: Publish
run: dotnet nuget push dist/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
29 changes: 19 additions & 10 deletions HealthCheckPlus.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34511.84
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthCheckPlus", "src\HealthCheckPlus.csproj", "{59A3979A-4DA9-48EB-B037-B69A1A8B53BF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthCheckPlusDemoBackgroudService", "Samples\HealthCheckPlusDemoBackgroudService\HealthCheckPlusDemoBackgroudService.csproj", "{6730E215-ECA5-401C-B28A-F8AC11FE64DC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{46A1CA76-6EE4-4CDF-98DF-8FB4A89F4677}"
ProjectSection(SolutionItems) = preProject
docs\apis\apis.md = docs\apis\apis.md
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
CONTRIBUTING.md = CONTRIBUTING.md
docapitemplate.md = docapitemplate.md
Expand All @@ -23,23 +22,21 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{46A1CA76-6
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthCheckPlusDemo", "Samples\HealthCheckPlusDemo\HealthCheckPlusDemo.csproj", "{072C0E0E-5888-492C-B154-8934476D6330}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthCheckPlus", "src\HealthCheckPlus\HealthCheckPlus.csproj", "{CB19A01B-9DAC-4D87-97BD-2BAEEA10480B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthCheckPlus.Abstractions", "src\HealthCheckPlus.Abstractions\HealthCheckPlus.Abstractions.csproj", "{5A6FAFA9-DB5E-48F6-96EB-71716FEBD806}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
local|Any CPU = local|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{59A3979A-4DA9-48EB-B037-B69A1A8B53BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59A3979A-4DA9-48EB-B037-B69A1A8B53BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59A3979A-4DA9-48EB-B037-B69A1A8B53BF}.local|Any CPU.ActiveCfg = local|Any CPU
{59A3979A-4DA9-48EB-B037-B69A1A8B53BF}.local|Any CPU.Build.0 = local|Any CPU
{59A3979A-4DA9-48EB-B037-B69A1A8B53BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59A3979A-4DA9-48EB-B037-B69A1A8B53BF}.Release|Any CPU.Build.0 = Release|Any CPU
{6730E215-ECA5-401C-B28A-F8AC11FE64DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6730E215-ECA5-401C-B28A-F8AC11FE64DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6730E215-ECA5-401C-B28A-F8AC11FE64DC}.local|Any CPU.ActiveCfg = Debug|Any CPU
{6730E215-ECA5-401C-B28A-F8AC11FE64DC}.local|Any CPU.Build.0 = Debug|Any CPU
{6730E215-ECA5-401C-B28A-F8AC11FE64DC}.local|Any CPU.ActiveCfg = local|Any CPU
{6730E215-ECA5-401C-B28A-F8AC11FE64DC}.local|Any CPU.Build.0 = local|Any CPU
{6730E215-ECA5-401C-B28A-F8AC11FE64DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6730E215-ECA5-401C-B28A-F8AC11FE64DC}.Release|Any CPU.Build.0 = Release|Any CPU
{072C0E0E-5888-492C-B154-8934476D6330}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -48,6 +45,18 @@ Global
{072C0E0E-5888-492C-B154-8934476D6330}.local|Any CPU.Build.0 = local|Any CPU
{072C0E0E-5888-492C-B154-8934476D6330}.Release|Any CPU.ActiveCfg = Release|Any CPU
{072C0E0E-5888-492C-B154-8934476D6330}.Release|Any CPU.Build.0 = Release|Any CPU
{CB19A01B-9DAC-4D87-97BD-2BAEEA10480B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB19A01B-9DAC-4D87-97BD-2BAEEA10480B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB19A01B-9DAC-4D87-97BD-2BAEEA10480B}.local|Any CPU.ActiveCfg = local|Any CPU
{CB19A01B-9DAC-4D87-97BD-2BAEEA10480B}.local|Any CPU.Build.0 = local|Any CPU
{CB19A01B-9DAC-4D87-97BD-2BAEEA10480B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB19A01B-9DAC-4D87-97BD-2BAEEA10480B}.Release|Any CPU.Build.0 = Release|Any CPU
{5A6FAFA9-DB5E-48F6-96EB-71716FEBD806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A6FAFA9-DB5E-48F6-96EB-71716FEBD806}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A6FAFA9-DB5E-48F6-96EB-71716FEBD806}.local|Any CPU.ActiveCfg = local|Any CPU
{5A6FAFA9-DB5E-48F6-96EB-71716FEBD806}.local|Any CPU.Build.0 = local|Any CPU
{5A6FAFA9-DB5E-48F6-96EB-71716FEBD806}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A6FAFA9-DB5E-48F6-96EB-71716FEBD806}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HealthCheckPlus;
using HealthCheckPlus.Abstractions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Diagnostics.HealthChecks;

Expand Down
3 changes: 2 additions & 1 deletion Samples/HealthCheckPlusDemo/HealthCheckPlusDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\HealthCheckPlus.csproj" />
<ProjectReference Include="..\..\src\HealthCheckPlus.Abstractions\HealthCheckPlus.Abstractions.csproj" />
<ProjectReference Include="..\..\src\HealthCheckPlus\HealthCheckPlus.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Samples/HealthCheckPlusDemo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HealthCheckPlus;
using HealthCheckPlus.Abstractions;
using HealthCheckPlus.options;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using System.Text.Json;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HealthCheckPlus;
using HealthCheckPlus.Abstractions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Diagnostics.HealthChecks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\HealthCheckPlus.csproj" />
<ProjectReference Include="..\..\src\HealthCheckPlus.Abstractions\HealthCheckPlus.Abstractions.csproj" />
<ProjectReference Include="..\..\src\HealthCheckPlus\HealthCheckPlus.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Samples/HealthCheckPlusDemoBackgroudService/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HealthCheckPlus;
using HealthCheckPlus.Abstractions;
using HealthCheckPlus.options;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.Extensions.Diagnostics.HealthChecks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HealthCheckPlus;
using HealthCheckPlus.Abstractions;
using Microsoft.Extensions.Diagnostics.HealthChecks;

namespace HealthCheckPlusDemoBackgroudService
Expand Down
16 changes: 9 additions & 7 deletions docs/apis/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@

[**Main**](../index.md#table-of-contents)

# Assembly HealthCheckPlus
# Assembly HealthCheckPlus.Abstractions

## Namespace HealthCheckPlus.Abstractions

## Namespace HealthCheckPlus
- [HealthCheckTrigger](./healthcheckplus.abstractions.healthchecktrigger.md)

- [HealthCheckTrigger](./healthcheckplus.healthchecktrigger.md)
- [HealthReportExtensions](./healthcheckplus.abstractions.healthreportextensions.md)

- [HealthReportExtensions](./healthcheckplus.healthreportextensions.md)
- [IDataHealthPlus](./healthcheckplus.abstractions.idatahealthplus.md)

- [IDataHealthPlus](./healthcheckplus.idatahealthplus.md)
- [IHealthCheckPlusPublisher](./healthcheckplus.abstractions.ihealthcheckpluspublisher.md)

- [IHealthCheckPlusPublisher](./healthcheckplus.ihealthcheckpluspublisher.md)
- [IStateHealthChecksPlus](./healthcheckplus.abstractions.istatehealthchecksplus.md)

- [IStateHealthChecksPlus](./healthcheckplus.istatehealthchecksplus.md)
# Assembly HealthCheckPlus

## Namespace HealthCheckPlus.options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

# HealthCheckTrigger

Namespace: HealthCheckPlus
Namespace: HealthCheckPlus.Abstractions

Enumerator values for origin of last status result.

```csharp
public enum HealthCheckTrigger
```

Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ValueType](https://docs.microsoft.com/en-us/dotnet/api/system.valuetype) → [Enum](https://docs.microsoft.com/en-us/dotnet/api/system.enum) → [HealthCheckTrigger](./healthcheckplus.healthchecktrigger.md)<br>
Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ValueType](https://docs.microsoft.com/en-us/dotnet/api/system.valuetype) → [Enum](https://docs.microsoft.com/en-us/dotnet/api/system.enum) → [HealthCheckTrigger](./healthcheckplus.abstractions.healthchecktrigger.md)<br>
Implements [IComparable](https://docs.microsoft.com/en-us/dotnet/api/system.icomparable), [IFormattable](https://docs.microsoft.com/en-us/dotnet/api/system.iformattable), [IConvertible](https://docs.microsoft.com/en-us/dotnet/api/system.iconvertible)

## Fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

# HealthReportExtensions

Namespace: HealthCheckPlus
Namespace: HealthCheckPlus.Abstractions

The Extensions for HealthReport

```csharp
public static class HealthReportExtensions
```

Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [HealthReportExtensions](./healthcheckplus.healthreportextensions.md)
Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [HealthReportExtensions](./healthcheckplus.abstractions.healthreportextensions.md)
## Methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# IDataHealthPlus

Namespace: HealthCheckPlus
Namespace: HealthCheckPlus.Abstractions

Represents data from the last Health Check performed

Expand Down Expand Up @@ -77,7 +77,7 @@ public abstract HealthCheckTrigger Origin { get; }

#### Property Value

[HealthCheckTrigger](./healthcheckplus.healthchecktrigger.md)<br>
[HealthCheckTrigger](./healthcheckplus.abstractions.healthchecktrigger.md)<br>


- - -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# IHealthCheckPlusPublisher

Namespace: HealthCheckPlus
Namespace: HealthCheckPlus.Abstractions

Represents a publisher of information.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# IStateHealthChecksPlus

Namespace: HealthCheckPlus
Namespace: HealthCheckPlus.Abstractions

Represents the commands of the HealthChecksPlus for access data

Expand All @@ -21,7 +21,7 @@ public interface IStateHealthChecksPlus

### <a id="methods-converttoplus"/>**ConvertToPlus(HealthReport)**

Convert to [IDataHealthPlus](./healthcheckplus.idatahealthplus.md)
Convert to [IDataHealthPlus](./healthcheckplus.abstractions.idatahealthplus.md)

```csharp
IEnumerable<IDataHealthPlus> ConvertToPlus(HealthReport report)
Expand All @@ -47,7 +47,7 @@ HealthStatus Status(string name)
#### Parameters

`name` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
name of url request([HealthCheckPlusOptions.HealthCheckName](./healthcheckplus.options.healthcheckplusoptions.md#healthcheckname)).
name for url request.

#### Returns

Expand Down
9 changes: 5 additions & 4 deletions docs/apis/healthcheckplus.options.healthcheckplusoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ The .
`report` HealthReport<br>
The .

`statecache` [IStateHealthChecksPlus](./healthcheckplus.istatehealthchecksplus.md)<br>
The cache instance : [IStateHealthChecksPlus](./healthcheckplus.istatehealthchecksplus.md).
`statecache` IStateHealthChecksPlus<br>
The cache instance : [IStateHealthChecksPlus](./healthcheckplus.abstractions.istatehealthchecksplus.md).


#### Returns

Expand Down Expand Up @@ -174,7 +175,7 @@ The .
`report` HealthReport<br>
The .

`statecache` [IStateHealthChecksPlus](./healthcheckplus.istatehealthchecksplus.md)<br>
`statecache` IStateHealthChecksPlus<br>
The cache instance : [IStateHealthChecksPlus](./healthcheckplus.istatehealthchecksplus.md).

#### Returns
Expand Down Expand Up @@ -217,7 +218,7 @@ The .
`report` HealthReport<br>
The .

`statecache` [IStateHealthChecksPlus](./healthcheckplus.istatehealthchecksplus.md)<br>
`statecache` IStateHealthChecksPlus<br>
The cache instance : [IStateHealthChecksPlus](./healthcheckplus.istatehealthchecksplus.md).

#### Returns
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<NeutralLanguage>en</NeutralLanguage>
<AssemblyName>HealthCheckPlus.Abstractions</AssemblyName>
<RootNamespace>HealthCheckPlus.Abstractions</RootNamespace>
<Configurations>Debug;Release;local</Configurations>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<Authors>Fernando Cerqueira</Authors>
<Description>Abstractions HealthCheck with individual check interval and Unhealth/Degraded/Healthy interval policy</Description>
<PackageReleaseNotes>https://github.com/FRACerqueira/HealthCheckPlus/releases</PackageReleaseNotes>
<PackageTags>HealthCheck;c#;</PackageTags>
<RepositoryUrl>https://github.com/FRACerqueira/HealthCheckPlus</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageId>HealthCheckPlus.Abstractions</PackageId>
<PackageReadmeFile>NugetREADME.md</PackageReadmeFile>
<PackageProjectUrl>https://fracerqueira.github.io/HealthCheckPlus</PackageProjectUrl>
<Version>2.0.1</Version>
<PackageIcon>icon.png</PackageIcon>
<Copyright>© 2023 - Fernando Cerqueira</Copyright>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='local'">
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName).Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<Content Include="..\README.txt">
<Pack>true</Pack>
<PackagePath>README.txt</PackagePath>
</Content>
</ItemGroup>

<ItemGroup>
<None Include="..\NugetREADME.md" Pack="true" PackagePath="\" />
<None Include="..\..\docs\images\icon.png" Pack="true" PackagePath="\" />
<None Include="..\README.md" Pack="false" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)|$(TargetFramework)'=='local|net8.0'">
<Exec Command="xmldoc2md $(SolutionDir)src\HealthCheckPlus.Abstractions\bin\local\net7.0\HealthCheckPlus.Abstractions.dll $(SolutionDir)docs\apis --templatefile $(SolutionDir)docapitemplate.md --excludeinternal --index-page-name apisAbstractions --back-button &quot;Back to List Api&quot; --link-back-button &quot;./apis.md&quot; --back-index-button &quot;Main&quot; --link-backindex-button &quot;../index.md#table-of-contents&quot;" />
</Target>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="8.0.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// The maintenance and evolution is maintained by the HealthCheckPlus project under MIT license
// ********************************************************************************************

namespace HealthCheckPlus
namespace HealthCheckPlus.Abstractions
{
/// <summary>
/// Enumerator values for origin of last status result.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Runtime.CompilerServices;
using Microsoft.Extensions.Diagnostics.HealthChecks;

namespace HealthCheckPlus
namespace HealthCheckPlus.Abstractions
{
/// <summary>
/// The Extensions for HealthReport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using Microsoft.Extensions.Diagnostics.HealthChecks;

namespace HealthCheckPlus
namespace HealthCheckPlus.Abstractions
{
/// <summary>
/// Represents data from the last Health Check performed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
using System;
// ********************************************************************************************
// MIT LICENCE
// The maintenance and evolution is maintained by the HealthCheckPlus project under MIT license
// ********************************************************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Diagnostics.HealthChecks;

namespace HealthCheckPlus
namespace HealthCheckPlus.Abstractions
{
/// <summary>
/// Represents a publisher of <see cref="HealthReport"/> information.
Expand Down
Loading

0 comments on commit 2a6dc6e

Please sign in to comment.