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

Use the last healthcheck in the list, not the first

/cc @tpetr

@@ -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;
Copy link
Contributor

@tpetr tpetr Sep 2, 2016

Choose a reason for hiding this comment

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

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

Copy link
Member Author

@ssalinas ssalinas Sep 2, 2016

Choose a reason for hiding this comment

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

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
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants