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 locator #102712

Merged
merged 13 commits into from
Jun 23, 2021
Merged

Discover locator #102712

merged 13 commits into from
Jun 23, 2021

Conversation

streamich
Copy link
Contributor

@streamich streamich commented Jun 21, 2021

Summary

Partially addresses #98107

  • Deprecates Discover URL generator
  • Adds Discover locator
  • Switches "Explore Underlying Data" actions to use Discover locator

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@streamich streamich requested a review from a team June 21, 2021 09:53
@streamich streamich requested a review from a team as a code owner June 21, 2021 09:53
@streamich streamich added Feature:SharingURLs Short URLs and Share URL features release_note:skip Skip the PR/issue when compiling release notes review Team:AppServices v7.14.0 v8.0.0 labels Jun 21, 2021
@elasticmachine
Copy link
Contributor

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

@streamich streamich added release_note:deprecation and removed release_note:skip Skip the PR/issue when compiling release notes labels Jun 21, 2021
@streamich streamich mentioned this pull request Jun 22, 2021
29 tasks
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.

Tested Explore underlying data from dashboard to discover and Discover search session which still uses old URL generator.

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.

Code LGTM, KibanaApp owned code review, checked out, tested explore underlying data, works as expected. One question, would it be possible to use this generator in our functional tests?

src/plugins/discover/public/locator.test.ts Show resolved Hide resolved
@streamich
Copy link
Contributor Author

@kertal It is our plan to remove the URL generator in one of the subsequent PRs, so it is better not to use it in any tests; but use locator instead. With regards to functional tests specifically, the functional tests don't know what is used under the hood. So for example "explore underlying data" functional tests just pass.

@kertal
Copy link
Member

kertal commented Jun 23, 2021

@kertal It is our plan to remove the URL generator in one of the subsequent PRs, so it is better not to use it in any tests; but use locator instead. With regards to functional tests specifically, the functional tests don't know what is used under the hood. So for example "explore underlying data" functional tests just pass.

I'm aware of this, my question was more, could we use the functionality of the locator to generate links in our functional tests? often the UI is used for defining time ranges necessary for certain tests. doing it directly with a generated URL would be faster

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discover 375 376 +1

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
discover 52 55 +3
share 78 81 +3
total +6

Page load bundle

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

id before after diff
discover 86.3KB 88.3KB +2.0KB
discoverEnhanced 9.1KB 8.9KB -289.0B
share 73.8KB 74.8KB +1.0KB
total +2.8KB
Unknown metric groups

API count

id before after diff
discover 65 81 +16
share 102 119 +17
total +33

History

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

@streamich streamich merged commit 1386c33 into elastic:master Jun 23, 2021
@streamich
Copy link
Contributor Author

@kertal That's a good questions. I'm not sure. Currently canonically you would consume locator through a plugin contract, but to use it in a functional test we would need to load it somehow differently (or expose a back door for functional tests to use plugin contracts). Maybe part of the locator that generates the link, for some locators, could be extracted into a separate file, and then functional tests could import that file.

streamich added a commit that referenced this pull request Jun 23, 2021
* Add Discover locator

* Add Discover locator tests

* Expose locator for Discover app and deprecate URL generator

* Use Discover locator in Explore Underlying Data

* Fix explore data unit tests after refactor

* fix: 🐛 update Discover plugin mock

* style: 💄 remove any

* test: 💍 fix test mock

* fix: 🐛 adjust property name after refactor

* test: 💍 fix tests after refactor

Co-authored-by: Vadim Kibana <vadimkibana@gmail.com>

Co-authored-by: Vadim Kibana <vadimkibana@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants