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

[8.0][RAC] 117686 replace alert workflow status in alerts view #118723

Merged

Conversation

fkanout
Copy link
Contributor

@fkanout fkanout commented Nov 16, 2021

Summary

This PR fixes #118078, fixes #117686 by:

  • Replace the "Workflow status" EuiButtonGroup to show "Alert status" instead. i.e. "Open / Acknowledged / Closed", we'll have "Show all / Active / Recovered" instead.

Screenshot 2021-11-16 at 16 54 58

  • Hide "Mark as Acknowledged", "Mark as Closed", and "Mark as Open" from the action list in the alerts table.

  • Hide the alerts' leading checkboxes that provide bulk actions with "Mark as Acknowledged", "Mark as Closed", and "Mark as Open".
    This PR can't fulfill "hide the alerts' leading checkboxes" requirements, as there is a bug in the T Grid. (please check this issue for more details).

  • Keep sync the selected alert filter buttons with the rest of the Alerts page (see the expected behavior section).

Expected behavior:

To ease the PR test for the reviewer, here are the use cases that could be tested:

  • Change the alert filter where the KQL bar is empty

Alerts---Observability---Elastic-empty-KQL

  • Change the alert filter where the KQL bar has already one manually-added query

Alerts---Observability---Elastic-one-filter-already-added

  • Keep the alert buttons filter in sync even with a cold start of the Alerts page (from browser URL bar)

Alerts---Observability---Elastic-fesh-start

  • Keep in sync, when adding manually a query first, then add an alert filter.

Alerts---Observability---Elastic-one-filter-already-added

  • Keep in sync, when adding an alert filter first, then manually add a query

Alerts---Observability---Elastic-add-after-alert-filter

  • Detect the filter alert when writing the alert query manually in the KQL bar

Alerts---Observability---Elastic-detect-from-KQL

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@fkanout fkanout added v8.0.0 Theme: rac label obsolete Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" labels Nov 16, 2021
@fkanout fkanout force-pushed the 117686-replace-alert-workflow-status-in-alerts-view branch 3 times, most recently from a8a8e8f to 553dc0c Compare November 17, 2021 14:56
@fkanout fkanout force-pushed the 117686-replace-alert-workflow-status-in-alerts-view branch from 553dc0c to b17d8db Compare November 17, 2021 15:01
@fkanout
Copy link
Contributor Author

fkanout commented Nov 19, 2021

@elasticmachine merge upstream

@fkanout
Copy link
Contributor Author

fkanout commented Nov 22, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

merge conflict between base and head

@@ -330,7 +320,7 @@ const FIELDS_WITHOUT_CELL_ACTIONS = [
];

export function AlertsTableTGrid(props: AlertsTableTGridProps) {
const { indexNames, rangeFrom, rangeTo, kuery, workflowStatus, setRefetch, addToQuery } = props;
const { indexNames, rangeFrom, rangeTo, kuery, workflowStatus, setRefetch } = props;
Copy link
Contributor

Choose a reason for hiding this comment

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

@fkanout We should delete workflowStatus from here. There are probably a few more places that workflowStatus might need to be deleted as well. This is not needed, since we are not filtering by workflowStatus anymore in the UI. That's why we still see workflowStatus:open in the urlbar when we first load the page. This is not needed anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as here:
#118723 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing workflowStatus It will blocked by TGridStandaloneCompProps requires filterStatus. Because the value of filterStatus is workflowStatus

Copy link
Contributor

@mgiota mgiota Nov 29, 2021

Choose a reason for hiding this comment

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

@fkanout filterStatus at the moment has value workflowStatus, but nothing prevents us by changing it back to alert status. This change was introduced as part of this PR #109817, so we could pair together to manually revert some workflows status leftover that is not needed

Let's get this PR merged for now. I summarized later on in a comment what we discussed during our sync up.

@mgiota
Copy link
Contributor

mgiota commented Nov 24, 2021

@fkanout Great work on that PR and thanks a lot for the detailed use cases! I like how you synced the search bar with the url bar. I still see workflowStatus:open in the urlbar though. Was it left on purpose?

I understand that you left a few parts in the code on purpose, in case we bring back workflow status filtering. Let's quickly sync up tomorrow regarding what things can stay and what could be removed (for example workflowStatus from the urlbar).

@mgiota
Copy link
Contributor

mgiota commented Nov 24, 2021

@ersin-erdal I totally agree. Could you maybe create a ticket to track down this code improvement you suggested? We could add the label technical-debt or refactoring in this ticket.

@mgiota
Copy link
Contributor

mgiota commented Nov 24, 2021

Btw FYI here's the PR that replaced status filtering with workflow status filtering https://github.com/elastic/kibana/pull/109817/files. And now we are replacing it again. Maybe this is a hint that we should have an AlertsFilter container as @ersin-erdal suggested

@fkanout
Copy link
Contributor Author

fkanout commented Nov 25, 2021

@elasticmachine merge upstream

@fkanout
Copy link
Contributor Author

fkanout commented Nov 29, 2021

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 330 328 -2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observability 352.9KB 351.8KB -1.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observability 80.2KB 80.0KB -139.0B

History

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

cc @fkanout

@mgiota
Copy link
Contributor

mgiota commented Nov 29, 2021

@fkanout As discussed we can merge this PR. I summarize what we discussed:

  • We agreed to get this PR merged as it is, so that we don't block @ersin-erdal with his PR.
  • we agreed to discuss into today's team meeting how we deal with situations where product requires us to keep some code in our codebase that could possibly be reused in the future, but on the other hand makes the code harder to read
  • based on team's feedback as well, we might need to follow up with another PR to clean up the code

@mgiota mgiota self-requested a review November 29, 2021 11:47
@fkanout fkanout merged commit ee3cb46 into elastic:main Nov 29, 2021
@fkanout
Copy link
Contributor Author

fkanout commented Nov 29, 2021

#118723 (comment)

After team discussion, a separate issue will be created to clean up the workflow code.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Dec 1, 2021
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 118723 or prevent reminders by adding the backport:skip label.

fkanout added a commit to fkanout/kibana that referenced this pull request Dec 2, 2021
…ic#118723)

* Add AlertStatus types

* Add alert status filter component

* Remove Filter in action from the t grid table

* Update group buttons to applied Alert status filter instead of Workflow status

* Keep the Alert status button in sync when typing and first page load

* Fix data test object name and translation keys label

* Add possibility to hide the bulk actions

* Update how hide the bulk actions

* Fix showCheckboxes hardcoded "true". Instead use the leadingControlColumns props

* Hide the leading checkboxes  in the T Grid with the bulk actions

* Update showCheckboxes to false

* Fix test as the leading checkboxes are hidden

* Update tests

* Get back disabledCellActions as it's required by T Grid

* Update tests to skip test related to Workflow action buttons

* Skip workflow tests

* Revert fix showCheckboxes

* Remove unused imports

* Revert the o11y tests as the checkBoxes fix is reverted

* Reactive the tests effected by checkBoxes

* Skip alert workflow status

* [Code review] use predefined types

* Remove unused prop

* Use the alert-data index name in the RegEx

* Detect * in KQL as "show al"l alert filter

Co-authored-by: Kibana Machine <[email protected]>
fkanout added a commit that referenced this pull request Dec 2, 2021
…) (#120198)

* Add AlertStatus types

* Add alert status filter component

* Remove Filter in action from the t grid table

* Update group buttons to applied Alert status filter instead of Workflow status

* Keep the Alert status button in sync when typing and first page load

* Fix data test object name and translation keys label

* Add possibility to hide the bulk actions

* Update how hide the bulk actions

* Fix showCheckboxes hardcoded "true". Instead use the leadingControlColumns props

* Hide the leading checkboxes  in the T Grid with the bulk actions

* Update showCheckboxes to false

* Fix test as the leading checkboxes are hidden

* Update tests

* Get back disabledCellActions as it's required by T Grid

* Update tests to skip test related to Workflow action buttons

* Skip workflow tests

* Revert fix showCheckboxes

* Remove unused imports

* Revert the o11y tests as the checkBoxes fix is reverted

* Reactive the tests effected by checkBoxes

* Skip alert workflow status

* [Code review] use predefined types

* Remove unused prop

* Use the alert-data index name in the RegEx

* Detect * in KQL as "show al"l alert filter

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Dec 2, 2021
@fkanout fkanout added the v8.1.0 label Dec 2, 2021
TinLe pushed a commit to TinLe/kibana that referenced this pull request Dec 22, 2021
…ic#118723)

* Add AlertStatus types

* Add alert status filter component

* Remove Filter in action from the t grid table

* Update group buttons to applied Alert status filter instead of Workflow status

* Keep the Alert status button in sync when typing and first page load

* Fix data test object name and translation keys label

* Add possibility to hide the bulk actions

* Update how hide the bulk actions

* Fix showCheckboxes hardcoded "true". Instead use the leadingControlColumns props

* Hide the leading checkboxes  in the T Grid with the bulk actions

* Update showCheckboxes to false

* Fix test as the leading checkboxes are hidden

* Update tests

* Get back disabledCellActions as it's required by T Grid

* Update tests to skip test related to Workflow action buttons

* Skip workflow tests

* Revert fix showCheckboxes

* Remove unused imports

* Revert the o11y tests as the checkBoxes fix is reverted

* Reactive the tests effected by checkBoxes

* Skip alert workflow status

* [Code review] use predefined types

* Remove unused prop

* Use the alert-data index name in the RegEx

* Detect * in KQL as "show al"l alert filter

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" Theme: rac label obsolete v8.0.0 v8.1.0
Projects
None yet
5 participants