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

hasData service #127068

Merged
merged 11 commits into from
Mar 17, 2022
Merged

hasData service #127068

merged 11 commits into from
Mar 17, 2022

Conversation

shivindera
Copy link
Contributor

@shivindera shivindera commented Mar 7, 2022

Summary

As part of the improved UX experience, we'd like to standardize the empty state view check for all apps. For that we have created a new service inside dataViews plugin that checks the below states:

  • hasESData: () => Promise; // Check to see if ES data exists
  • hasDataView: () => Promise; // Check to see if any data view exists (primitive or user created)
  • hasUserDataView: () => Promise; // Check to see if user created data views exist

This is solving issue - #124019

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@shivindera shivindera added v8.2.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed backport:skip This commit does not require backporting Feature:Data Views Data Views code and UI - index patterns before 8.0 Team:AppServicesSv Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages labels Mar 8, 2022
@shivindera shivindera changed the title Initial commit for hasData service hasData service Mar 8, 2022
Copy link
Contributor

@majagrubic majagrubic left a comment

Choose a reason for hiding this comment

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

Thanx for taking this on. Added a few early comments.

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.

A few notes but otherwise everything is moving along nicely

@shivindera shivindera marked this pull request as ready for review March 16, 2022 13:22
@shivindera shivindera requested a review from a team as a code owner March 16, 2022 13:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesSv)

Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

Some nit suggestions

src/plugins/data_views/server/has_user_index_pattern.ts Outdated Show resolved Hide resolved
src/plugins/data_views/server/has_user_index_pattern.ts Outdated Show resolved Hide resolved
src/plugins/data_views/server/has_user_index_pattern.ts Outdated Show resolved Hide resolved
@shivindera shivindera requested a review from a team as a code owner March 16, 2022 14:26
@shivindera shivindera requested a review from Dosant March 16, 2022 14:26
Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

limits.yml LGTM

Copy link
Contributor

@majagrubic majagrubic left a comment

Choose a reason for hiding this comment

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

Service signature looks good for the shared-ux use-case! I had a quick pass through the code, no major concerns there.

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.

What do we have for tests? Are there existing tests that verify this functionality? Some simple unit tests might be helpful as well.

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.

looks good, nice work!

@shivindera shivindera enabled auto-merge (squash) March 17, 2022 17:25
@shivindera shivindera merged commit 2230685 into elastic:main Mar 17, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dataViews 44 46 +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
dataViews 645 711 +66

Async chunks

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

id before after diff
dataViewEditor 114.5KB 114.5KB +5.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
dataViews 10 15 +5

Page load bundle

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

id before after diff
dataViews 40.5KB 42.3KB +1.8KB
Unknown metric groups

API count

id before after diff
dataViews 797 863 +66

References to deprecated APIs

id before after diff
dashboard 81 78 -3
lens 237 234 -3
visualizations 114 111 -3
total -9

Unreferenced deprecated APIs

id before after diff
dataViews 0 2 +2

History

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

@kibanamachine
Copy link
Contributor

⚪ Backport skipped

The pull request was not backported as there were no branches to backport to. If this is a mistake, please apply the desired version labels or run the backport tool manually.

Manual backport

To create the backport manually run:

node scripts/backport --pr 127068

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed backport:skip This commit does not require backporting Feature:Data Views Data Views code and UI - index patterns before 8.0 Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages release_note:skip Skip the PR/issue when compiling release notes v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants