-
Notifications
You must be signed in to change notification settings - Fork 363
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
Readiness health checks story 2 in db #3361
Readiness health checks story 2 in db #3361
Conversation
e28fe36
to
44ea08a
Compare
Now when a user supplies the readiness health check properties via the app manifest, the values are stored on the process, and saved in the database. Signed-off-by: Renee Chu <[email protected]>
44ea08a
to
85b22b9
Compare
class HealthCheckPolicy | ||
def initialize(process, health_check_timeout, health_check_invocation_timeout) | ||
def initialize(process, health_check_timeout, health_check_invocation_timeout, health_check_type, health_check_http_endpoint) |
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.
We refactored the health check policy, to contain all of the checks for health checks, and removed some checks that were in the process model. We think this consolidates these checks more.
Also we refactored so that we could make a ReadinessHealthCheckPolicy that inherits from this class.
Signed-off-by: Amelia Downs <[email protected]>
was added by mistake. Signed-off-by: Maria Shaldybin <[email protected]>
def self.constants_to_array | ||
[ | ||
HTTP, | ||
NONE, |
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 don't understand why we have NONE
at all, do you? Trying to set a health check to none via the API results in the following error:
± sb |readiness-health-checks-story-2-in-db → origin {3} ?:1 ✗| → cf curl -X PATCH v3/processes/c6493e8f-84b0-4e84-be1f-7156b7704039 -d '{"health_check": {"type": "none","data": { }}}'
{
"errors": [
{
"detail": "Health check type must be \"port\", \"process\", or \"http\"",
"title": "CF-UnprocessableEntity",
"code": 10008
}
]
}
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.
It looks like it used to be an option, but no longer is. It looks like for awhile there was backwards compatible logic where it would map none -> process. I suspect it is dead code now and could be ripped out. If you want we can do it in another story.
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.
It'd be nice to clean up, but NONE
's presence doesn't seem too onerous right now. I'll leave it to you to decide if you want to do it, and if not I'll create a story/github issue to track it.
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 a story in our epic to do it.
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.
LGTM! The only major thing I would ask you to consider changing is the ReadinessHealthCheckPolicy < HealthCheckPolicy
inheritance pattern. I think having a BaseHealthCheckPolicy
that both policies inherit from would avoid any surprises that might come from changing HealthCheckPolicy
and seeing the effects in ReadinessHealthCheckPolicy
split out readiness health check types into its own method
29f6068
to
2cfe394
Compare
@sethboyles The latest commit adds BaseHealthCheckPolicy class for both the ReadinessHealthCheckPolicy and HealthCheckPolicy classes to inherit from. Both the ReadinessHealthCheckPolicy and HealthCheckPolicy are very slimmed down now. I wasn't sure about the best way to test all these components. Options for testing health check policy classes
I chose option 3. I am happy to change the testing pattern if you would prefer a different option. |
LGTM! |
This PR is part of a larger effort detailed here in this Cloud Controller PR and here in this CFF RFC.
In this story, the 3 new app manifest properties (created in this PR), are set in the db.
New App Manifest Properties
Acceptance Steps
Previous PRs