select the correct healthcheck for alert #1266

Merged
merged 1 commit into from Sep 2, 2016

Conversation

Projects
None yet
2 participants
@ssalinas
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.

@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?

@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.

@ssalinas

ssalinas Sep 2, 2016

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 Sep 2, 2016

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

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