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

[DataViews] Remove No matching indices found toasts 🍞 #151788

Merged
merged 6 commits into from
Mar 6, 2023

Conversation

kertal
Copy link
Member

@kertal kertal commented Feb 21, 2023

Summary

This is a toast-flavored SDH investigation that became a PR ...
Fixes #151670

This PR removes the No matching indices found toasts, part of some toast storms . The toasts were triggered when there were no matching indices of a given data view's index pattern.

If indication is needed, that there are no available matching indices (it could also be an issue of lack of permissions to the requested indices), it's easy to check following property of an existing data view, if the length of matchedIndices is 0, this equals a 'indices are missing condition`.

* list of indices that the index pattern matched
*/
public matchedIndices: string[] = [];

Examples for 🍞 not being displayed because of this:
Bildschirmfoto 2023-02-21 um 11 05 31
Bildschirmfoto 2023-02-21 um 11 08 17

Testing

  • Install our demo data
  • Navigate to Transforms , create a transform based on one of demo data sets, more transforms based on different data views ... more toasts
  • Delete the indices containing the data in Console, but not the data views
  • Navigate to Transforms ... no toasts
  • Also there shall be no toast displayed showing the demo dashboards
  • There might be other areas of Discover without toasts
  • Neithertheless you can have a toast for breakfast, that's ok!

Checklist

@kertal kertal added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label Feb 21, 2023
@kertal kertal self-assigned this Feb 21, 2023
@kertal kertal changed the title Discover don't toast when indices are missing Add onMissingIndices to DataViews API handing the state of missing indices seperately Feb 22, 2023
@kertal kertal changed the title Add onMissingIndices to DataViews API handing the state of missing indices seperately Remove triggering of onNotification when a there are no available indices matching the given data view index pattern Feb 22, 2023
@kertal kertal changed the title Remove triggering of onNotification when a there are no available indices matching the given data view index pattern Remove triggering of onNotification when there are no available indices matching the given data view index pattern Feb 22, 2023
@kertal kertal changed the title Remove triggering of onNotification when there are no available indices matching the given data view index pattern [DataViews] Remove triggering of onNotification when there are no available indices matching the given data view index pattern Feb 22, 2023
@kertal kertal added release_note:skip Skip the PR/issue when compiling release notes Feature:Data Views Data Views code and UI - index patterns before 8.0 labels Feb 22, 2023
@kertal kertal changed the title [DataViews] Remove triggering of onNotification when there are no available indices matching the given data view index pattern [DataViews] Remove toasts when there are no available indices matching the given index pattern Feb 22, 2023
@kertal kertal changed the title [DataViews] Remove toasts when there are no available indices matching the given index pattern [DataViews] Remove No matching indices toasts 🍞 Feb 22, 2023
@kertal kertal changed the title [DataViews] Remove No matching indices toasts 🍞 [DataViews] Remove No matching indices found toasts 🍞 Feb 22, 2023
@kertal kertal marked this pull request as ready for review February 22, 2023 21:02
@kertal kertal requested a review from a team as a code owner February 22, 2023 21:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

Changes look good and work well!

@neptunian
Copy link
Contributor

Is there a plan to remove allowNoIndex or is that still being used in some way?

@mattkime
Copy link
Contributor

@neptunian I think it still preserves the field list if its saved to the data view. That said, there's some allowNoIndices related code that can be removed from the data views api.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Page load bundle

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

id before after diff
dataViews 44.2KB 43.9KB -285.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 428 430 +2

Total ESLint disabled count

id before after diff
securitySolution 506 508 +2

History

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

cc @kertal

@kertal kertal merged commit ec690bc into elastic:main Mar 6, 2023
@kibanamachine kibanamachine added v8.8.0 backport:skip This commit does not require backporting labels Mar 6, 2023
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
## Summary
This PR removes the `No matching indices found ` toasts, part of some
toast storms . The toasts were triggered when there were no matching
indices of a given data view's index pattern.

If indication is needed, that there are no available matching indices
(it could also be an issue of lack of permissions to the requested
indices), it's easy to check following property of an existing data
view, if the length of matchedIndices is 0, this equals a 'indices are
missing condition`.
mattkime added a commit that referenced this pull request Mar 24, 2023
… empty field list (#152059)

## Summary

Part of #151670
and follow up to #151788

When a data view is loaded, it automatically loads its field list.
Previously, it would error if the index pattern failed to match an
index. Going forward, this will be treated as a valid empty state -
`allowNoIndices` is being passed to the field_caps requests. When
`allowNoIndices` is set to true, ES will return a valid empty set rather
than a 404 error.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
jennypavlova pushed a commit to jennypavlova/kibana that referenced this pull request Mar 24, 2023
… empty field list (elastic#152059)

## Summary

Part of elastic#151670
and follow up to elastic#151788

When a data view is loaded, it automatically loads its field list.
Previously, it would error if the index pattern failed to match an
index. Going forward, this will be treated as a valid empty state -
`allowNoIndices` is being passed to the field_caps requests. When
`allowNoIndices` is set to true, ES will return a valid empty set rather
than a 404 error.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
mattkime added a commit that referenced this pull request Mar 27, 2023
## Summary

#151788 established that data
views would no longer error when they failed to retrieve a field list.
This index pattern validation code exists since previously ALL index
pattern segments needed to match in order to avoid an error response
from field caps, rather than just one. Now we can remove the validation
code and simply pass the index pattern to field caps directly.


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
drewdaemon added a commit that referenced this pull request Mar 30, 2023
## Summary

Since #151788 landed, there's no
need to insert `allowNoIndex` at the Lens level.

Still no toasts:
<img width="1901" alt="Screenshot 2023-03-29 at 4 30 58 PM"
src="https://user-images.githubusercontent.com/315764/228676314-b9ba2add-a404-43ec-a9d8-b1d3b562ba2f.png">

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't show toasts when there are missing indices
6 participants