Skip to content

Conversation

@alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Jun 2, 2020

Fixes #22209
Fixes #25134
Fixes #18462

How to review

The top two linked issues include different ways to test.

I would like confirmation that the logic change is reasonable for the end user. Previously, the UI was determining an "error" status only by the last_execution_successful flag. This could be misleading as a user could end up in a situation where the last_execution_successful is indeed false, but the issue causing the original error has since been resolved and the condition is no longer being met. I have updated the logic so that the "error" state will only appear if the last_execution_successful is false, and the last time the watch condition was checked is equal to the last execution. Please let me know if you see any issues with this, or if you can think of any case that this wouldn't cover.

Release note

This change fixes an issue in Watcher, where a watch status or action status was incorrectly marked as "Error".

@alisonelizabeth alisonelizabeth added release_note:fix Feature:Watcher v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v7.9.0 labels Jun 2, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Did not test, but happy with the addition of the tests!

Great work @alisonelizabeth

it('lastExecutionSuccessful is equal to false', () => {
it('lastExecutionSuccessful is equal to false and it is the most recent execution', () => {
upstreamJson.actionStatusJson.last_execution.successful = false;
upstreamJson.actionStatusJson.last_execution.timestamp =
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% sure what this assignment is doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what I was going for there either 😂 . Removed.

Comment on lines +35 to +38
if (
this.lastExecutionSuccessful === false &&
this.lastCheckedRawFormat === this.lastExecutionRawFormat
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

From this it looks like lastExecutionSuccessful can be false but we have an edge case where lastCheckedRawFormat come after that? I.o.w. the last execution could be successful even though the lastExecutionSuccessful field is false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the watch only "executes" when the condition is met, but the watch condition is checked on a given interval. So the last time it was executed could be false, but the next time it is checked the condition may not be met so it doesn't execute. Does that make sense? I also tried to explain this in the PR description, but I'm probably not doing the best job so let me know if you need me to clarify more 😅 .

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Watcher release_note:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v7.9.0 v8.0.0

Projects

None yet

4 participants