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

select the correct healthcheck for alert #1266

Merged
merged 1 commit into from Sep 2, 2016
Merged

Conversation

@ssalinas
Copy link
Member

ssalinas commented Sep 2, 2016

Use the last healthcheck in the list, not the first

/cc @tpetr

@ssalinas ssalinas added the hs_staging label Sep 2, 2016
@@ -406,7 +406,7 @@ function mapHealthchecksToProps(task) {
if (!task) return task;
const { healthcheckResults } = task;
task.hasSuccessfulHealthcheck = healthcheckResults && healthcheckResults.length > 0 && !!_.find(healthcheckResults, (healthcheckResult) => healthcheckResult.statusCode === 200);
task.lastHealthcheckFailed = healthcheckResults && healthcheckResults.length > 0 && healthcheckResults[0].statusCode !== 200;
task.lastHealthcheckFailed = healthcheckResults && healthcheckResults.length > 0 && _.last(healthcheckResults).statusCode !== 200;

This comment has been minimized.

Copy link
@tpetr

tpetr Sep 2, 2016

Member

do you know if this was something that was always broken, or did the sorting change at some point?

This comment has been minimized.

Copy link
@ssalinas

ssalinas Sep 2, 2016

Author Member

I think it got messed up in the translation to react. It used to work. You can see we're actually using last already in the TaskAlert to display it, just not here when determining if it failed

@ssalinas ssalinas merged commit 8604212 into master Sep 2, 2016
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
@ssalinas ssalinas deleted the healthcheck_fail_fix branch Sep 2, 2016
@ssalinas ssalinas modified the milestone: 0.11.0 Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.