Exclude checks result from host's health when empty selection is saved #1858
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR makes sure to ignore the checks result from the host's aggregated health computation when an empty selection is saved.
Imagine a host whose heartbeat is successful, but the latest checks execution is warning: the resulting host health would be warning.
If we now deselect all the checks for the host and save the empty selection, no other execution would run and the checks_health would remain in warning, keeping also the host's aggregated health in warning state, which would not make sense if there are no selected checks.
How was this tested?
Automated test added