-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates for health contributors and endpoint #1451
base: main
Are you sure you want to change the base?
Conversation
5fc1d4d
to
8ec3ed2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed a subset of the changes.
src/Management/src/Endpoint/Actuators/Health/Availability/LivenessStateContributorOptions.cs
Outdated
Show resolved
Hide resolved
src/Management/src/Endpoint/Actuators/Health/Availability/ReadinessStateContributorOptions.cs
Outdated
Show resolved
Hide resolved
src/Management/src/Endpoint/Actuators/Health/Contributors/DiskSpaceContributor.cs
Show resolved
Hide resolved
src/Management/src/Endpoint/Actuators/Health/PostConfigureHealthEndpointOptions.cs
Outdated
Show resolved
Hide resolved
src/Management/src/Endpoint/Actuators/Health/HealthEndpointOptions.cs
Outdated
Show resolved
Hide resolved
@@ -153,10 +153,12 @@ private async Task ActAndAssertAsync(IHostBuilder builder, Type endpointOptionsT | |||
response.StatusCode.Should().Be(expectSuccess ? HttpStatusCode.OK : HttpStatusCode.Forbidden); | |||
} | |||
|
|||
#pragma warning disable SA1602 // Enumeration items should be documented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this added? It wasn't needed before, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it because I was getting SA1602 errors here. I thought that was odd, but didn't think it was worth trying to understand or document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you get the errors exactly? I see them in VS, but running a build in release mode (both from VS and dotnet build
) doesn't produce errors.
Either way, it's pretty unusual to have public enums in test projects. However, in this case, it's required for TheoryData
. A better way to suppress is to add SA1602
to NoWarn
in shared-test.props
. Because we'd never want errors in test projects for that.
src/Management/test/Endpoint.Test/ActuatorRouteBuilderExtensionsTest.cs
Outdated
Show resolved
Hide resolved
src/Management/test/Endpoint.Test/Actuators/Health/HealthEndpointOptionsTest.cs
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
ffda503
to
6d3d3e9
Compare
- remove status from details - improve probe parity with Spring - separate switches for showing components and their details - enhance groups to override showComponents and showDetails - add path & exists property to disk space
Co-authored-by: Bart Koelman <[email protected]>
6d3d3e9
to
af5f623
Compare
This comment was marked as resolved.
This comment was marked as resolved.
@@ -8,20 +8,20 @@ | |||
namespace Steeltoe.Management.Endpoint.Actuators.Health; | |||
|
|||
internal sealed class PostConfigureHealthEndpointOptions( | |||
IOptions<LivenessStateContributorOptions> livenessOptions, IOptions<ReadinessStateContributorOptions> readinessOptions) | |||
IOptionsMonitor<LivenessStateContributorOptions> livenessOptions, IOptionsMonitor<ReadinessStateContributorOptions> readinessOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameters should be renamed to livenessOptionsMonitor
/readinessOptionsMonitor
, as their types have changed. And please introduce private readonly fields instead of accessing the primary ctor parameters directly.
@@ -74,17 +81,4 @@ public void Constructor_BindsRoleCorrectly() | |||
Assert.Equal(ClaimTypes.Role, options.Claim.Type); | |||
Assert.Equal("role-claim-value", options.Claim.Value); | |||
} | |||
|
|||
[Fact] | |||
public void CanClearDefaultGroups() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand, readiness/liveness contributors are not added automatically anymore. However, when they are added, their groups are automatically created. We still need a way to configure not creating any groups.
@@ -153,10 +153,12 @@ private async Task ActAndAssertAsync(IHostBuilder builder, Type endpointOptionsT | |||
response.StatusCode.Should().Be(expectSuccess ? HttpStatusCode.OK : HttpStatusCode.Forbidden); | |||
} | |||
|
|||
#pragma warning disable SA1602 // Enumeration items should be documented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you get the errors exactly? I see them in VS, but running a build in release mode (both from VS and dotnet build
) doesn't produce errors.
Either way, it's pretty unusual to have public enums in test projects. However, in this case, it's required for TheoryData
. A better way to suppress is to add SA1602
to NoWarn
in shared-test.props
. Because we'd never want errors in test projects for that.
Quality Gate passedIssues Measures |
Description
Updates to more closely align with Spring:
Resolves #1440
docs updated in SteeltoeOSS/Documentation#343
Open question to resolve: Should liveness and readiness be controlled by a shared switch like
management:endpoint:health:probes:enabled
, as they are in Spring? I think probably not since we're already at least slightly mismatched by using "endpoints" instead of "endpoint", but I'm open to making the changeQuality checklist
If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.