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

[Watcher] Add support for ERROR and UNKNOWN watch action statuses #55092

Merged

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Jan 16, 2020

Fixes #54730

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

Release note

This change fixes a bug in which the UI did not load the watch overview page if one of user's watches had a watch action in an invalid state.

@alisonelizabeth alisonelizabeth added Feature:Watcher v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.7.0 labels Jan 16, 2020
@elasticmachine
Copy link
Contributor

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

@alisonelizabeth alisonelizabeth marked this pull request as ready for review January 17, 2020 13:36
}
)
);
return ACTION_STATES.UNKNOWN;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seemed more appropriate to mark the action in an unknown state, rather than throwing an error and making the watch list view unusable.

The only potential outstanding question is what the overall watch status should return in this scenario. I did not make any code changes to how this is handled, so it currently will return OK. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I definitely agree with rather keeping the view usable in case of a bad status (i.e., catering for this condition here definitely seems like the correct thing to do). Overall I am happy with this approach 👍

The one advantage of throwing in this case, however, is that we were able to discover this bug which I think may have remained hidden otherwise. So being totally silent also has a cost (as you've noted).

Judging how action_status and watch_status hang together, it would be cool to be able to say that if the last action status was unknown, then the watch_status is unknown? Remaining in this state should be a red flag to the user + they can still use the UI, we should communicate it's a possible bug. This could be a separate unit of work to this fix though!

Let me know what you think? We could revert this line for now and address later, or commit and address later. I'm happy with either for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jloleysens I like this idea a lot - thanks! I opened #55410 to address separately.

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.

Left a comment, would like to hear your thoughts there, but we don't have to block for that on the this.lastAcknowledged < this.lastExecution fix.

}
)
);
return ACTION_STATES.UNKNOWN;
Copy link
Contributor

Choose a reason for hiding this comment

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

I definitely agree with rather keeping the view usable in case of a bad status (i.e., catering for this condition here definitely seems like the correct thing to do). Overall I am happy with this approach 👍

The one advantage of throwing in this case, however, is that we were able to discover this bug which I think may have remained hidden otherwise. So being totally silent also has a cost (as you've noted).

Judging how action_status and watch_status hang together, it would be cool to be able to say that if the last action status was unknown, then the watch_status is unknown? Remaining in this state should be a red flag to the user + they can still use the UI, we should communicate it's a possible bug. This could be a separate unit of work to this fix though!

Let me know what you think? We could revert this line for now and address later, or commit and address later. I'm happy with either for now.

alisonelizabeth and others added 2 commits January 21, 2020 09:42
…atus/action_status.js

Co-Authored-By: Jean-Louis Leysens <jloleysens@gmail.com>
@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@alisonelizabeth alisonelizabeth merged commit 7b145bf into elastic:master Jan 22, 2020
@alisonelizabeth alisonelizabeth deleted the watcher/action_status_bugfix branch January 22, 2020 13:35
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jan 22, 2020
…t-of-legacy

* 'master' of github.com:elastic/kibana:
  [Watcher] Add support for additional watch action statuses (elastic#55092)
  [ML] Fix entity controls update. (elastic#55524)
  [ML] Fixing ML's watcher integration (elastic#55439)
  [ML] Fixes permissions checks for data visualizer create job links (elastic#55431)
  [SearchProfiler] Move out of legacy (elastic#55331)

# Conflicts:
#	x-pack/plugins/watcher/server/models/action_status/action_status.js
@cjcenizal cjcenizal added this to Done in Elasticsearch UI Mar 2, 2020
@cjcenizal cjcenizal moved this from Done to Needs sorting in Elasticsearch UI Mar 2, 2020
@cjcenizal cjcenizal moved this from Done - NP migration to Done in Elasticsearch UI Mar 2, 2020
@cjcenizal cjcenizal changed the title [Watcher] Add support for additional watch action statuses [Watcher] Add support for ERROR and UNKNOWN watch action statuses Jul 5, 2022
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 v7.7.0 v8.0.0
Projects
Development

Successfully merging this pull request may close these issues.

[Watcher] Watch action status could not be determined
4 participants