Skip to content
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

4.x Add a new addCheck variant allowing the caller to set the health check name; add tests; revise doc #7994

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Nov 13, 2023

Description

Resolves #7827

As Tomas suggested in the issue comments, this PR adds a variant to the HealthObserver builder that accepts a Supplier<HealthCheckResult>, a health check type, and (this is the new part) a name for the added health check.

(The original code provided no way to assign a name to a health check that was added by using a lambda or method reference for the health check response.)

Documentation

Doc update included in the PR.

I revised the doc slightly so the example code uses a variable of type Supplier<HealthCheckResponse> instead of HealthCheck so the doc could show the use of the new method. IMO this is a better pattern to illustrate than creating a check without an explicit name which yields the output I showed in the issue in which the generated name is shown as something like "name": "Main$$Lambda/0x00000001320ac800".

The revised doc shows the code explicitly setting the name when invoking addCheck and the corresponding clearer output.

…k name; add tests; revise doc

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
@tjquinno tjquinno self-assigned this Nov 13, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 13, 2023
@tjquinno tjquinno changed the title Add a new addCheck variant allowing the caller to set the health check name; add tests; revise doc Add a new addCheck variant allowing the caller to set the health check name; add tests; revise doc Nov 13, 2023
@tjquinno tjquinno changed the title Add a new addCheck variant allowing the caller to set the health check name; add tests; revise doc 4.x Add a new addCheck variant allowing the caller to set the health check name; add tests; revise doc Nov 14, 2023
Copy link
Contributor

@ljamen ljamen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ljamen ljamen merged commit 7e72ac8 into helidon-io:main Nov 14, 2023
12 checks passed
@tjquinno tjquinno deleted the 4.x-health-check-name branch November 14, 2023 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.x SE HealthCheckResponse no longer supports a name
2 participants