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

[Discover] Bypass no-data check in dev mode #133461

Merged
merged 8 commits into from
Jun 10, 2022

Conversation

majagrubic
Copy link
Contributor

@majagrubic majagrubic commented Jun 3, 2022

Summary

Addresses: #133273

Developers have a use-case to view dotted-prefixed indexed. In the current implementation of hasESData check, these indices will be treated as non-user-created (which they are); which means we will treat them as there is no actual data in Elasticsearch. This can cause unnecessary steps for developers who have an interest in those indices; they will now need to create a non-dot prefixed index to use Discover.

This PR bypasses the no-data check in case of a dev environment.

As mentioned in the issue, I believe the appropriate place to implement this is in the service itself. As such, let's consider this a short-term mitigation.

Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
- [ ] Documentation was added for features that require explanation or tutorials

  • Unit or functional tests were updated or added to match the most common scenarios
    - [ ] Any UI touched in this PR is usable by keyboard only (learn more about keyboard accessibility)
    - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)
    - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
    - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser)
    - [ ] This was checked for cross-browser compatibility

For maintainers

@majagrubic majagrubic force-pushed the discover-dev-mode branch from 46feeca to f68d97e Compare June 3, 2022 07:06
@majagrubic majagrubic marked this pull request as ready for review June 3, 2022 13:43
@majagrubic majagrubic requested a review from a team as a code owner June 3, 2022 13:43
@majagrubic majagrubic added v8.4.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Discover Discover Application labels Jun 3, 2022
@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

I managed to break it for some reason. So I've been testing, and it looked good, but then at a certain point I started to get a blank Discover view, without any error message

image

I started to investigate and when I was looking into the data views section there were some new ones that I didn't create, they were created by the system:

Bildschirmfoto 2022-06-08 um 09 12 51

Looking at my browser history, it seems I've accidentally clicked on our security app

And this lead to the white screen because hasUserDataView in the code was set to true for this case.
kibana_–_discover_main_route_tsx

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
discover 447.8KB 447.8KB +39.0B

Page load bundle

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

id before after diff
discover 40.6KB 40.6KB +41.0B

History

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

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

LGTM 👍 The empty page when security data views were provided is fixed. So this fixes it for dev mode. On thing I wonder, are we sure this is not a demand for the non - dev -mode?

@majagrubic
Copy link
Contributor Author

If we bypass this check in non-dev mode, the no-data check basically makes no sense as there will always be system-created indices. We want to explicitly guide users to add integrations and add data.

@majagrubic majagrubic merged commit 6f2a7f4 into elastic:main Jun 10, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 10, 2022
@majagrubic majagrubic deleted the discover-dev-mode branch June 10, 2022 05:06
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:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants