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

[Lens] Move field existence from Lens to UnifiedFieldList plugin #139453

Merged

Conversation

dimaanj
Copy link
Contributor

@dimaanj dimaanj commented Aug 25, 2022

Summary

Closes #137658

This PR moves field existence API from Lens server to a common area of UnifiedFieldList plugin. There should be no UI changes.

Checklist

@dimaanj dimaanj self-assigned this Aug 25, 2022
dimaanj and others added 4 commits August 30, 2022 15:10
…eld-existing-to-unified-field-list-plugin

# Conflicts:
#	src/plugins/data_views/public/data_views/data_views_api_client.ts
#	x-pack/plugins/lens/public/app_plugin/app.tsx
#	x-pack/plugins/lens/public/indexpattern_service/loader.ts
#	x-pack/plugins/lens/public/indexpattern_service/service.ts
#	x-pack/plugins/lens/public/mocks/data_views_service_mock.ts
#	x-pack/plugins/lens/server/plugin.tsx
#	x-pack/plugins/lens/server/routes/existing_fields.ts
@dimaanj
Copy link
Contributor Author

dimaanj commented Sep 5, 2022

@elasticmachine merge upstream

@dimaanj dimaanj marked this pull request as ready for review September 6, 2022 08:38
@dimaanj dimaanj requested review from a team as code owners September 6, 2022 08:38
@dimaanj dimaanj added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label Sep 6, 2022
@elasticmachine
Copy link
Contributor

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

@dimaanj dimaanj marked this pull request as draft September 6, 2022 08:39
@dimaanj
Copy link
Contributor Author

dimaanj commented Sep 6, 2022

@elasticmachine merge upstream

@@ -7,3 +7,4 @@
*/

export const PLUGIN_ID = 'unifiedFieldList';
export const FIELD_EXISTENCE_SETTING = 'unifiedFieldList:useFieldExistenceSampling';
Copy link
Member

Choose a reason for hiding this comment

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

I think need migration from lens:useFieldExistenceSampling to unifiedFieldList:useFieldExistenceSampling, else the previous value of unifiedFieldList:useFieldExistenceSampling will get lost

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Didn't run but looks good except for the renaming of the advanced setting, I don't think that's worth the effort.

@@ -367,7 +367,9 @@ function FieldItemPopoverContents(props: FieldItemProps) {
}

if (params?.noDataFound) {
const isUsingSampling = core.uiSettings.get('lens:useFieldExistenceSampling');
const isUsingSampling = core.uiSettings.get(
'unifiedFieldList:useFieldExistenceSampling'
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is not backwards compatible. As we are going to remove this setting in 8.6 anyway, let's keep it under the old name.

@flash1293
Copy link
Contributor

@dimaanj can the draft status be removed on this for final review?

@dimaanj dimaanj marked this pull request as ready for review September 6, 2022 14:57
@dimaanj dimaanj requested a review from flash1293 September 6, 2022 14:57
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested and Lens integration works fine, LGTM

@dimaanj
Copy link
Contributor Author

dimaanj commented Sep 7, 2022

@elasticmachine merge upstream

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

app services changes LGTM

@dimaanj dimaanj requested a review from kertal September 8, 2022 07:42
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 did just a quick check of the code and functionality locally in Lens, LGTM! Thx for taking care of this! 👍

@dimaanj
Copy link
Contributor Author

dimaanj commented Sep 8, 2022

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

merge conflict between base and head

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
unifiedFieldList 71 75 +4

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
lens 533 532 -1
unifiedFieldList 49 52 +3
total +2

Async chunks

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

id before after diff
lens 1.2MB 1.2MB +72.0B
unifiedFieldList 47.6KB 47.6KB +4.0B
total +76.0B

Page load bundle

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

id before after diff
dataViews 42.8KB 42.9KB +73.0B
lens 34.8KB 34.7KB -47.0B
unifiedFieldList 3.6KB 6.1KB +2.6KB
total +2.6KB
Unknown metric groups

API count

id before after diff
lens 619 618 -1
unifiedFieldList 51 54 +3
total +2

History

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

cc @dimaanj

@dimaanj dimaanj merged commit e11bea9 into elastic:main Sep 8, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 8, 2022
@flash1293 flash1293 added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:enhancement labels Oct 12, 2022
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:Lens 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.5.0 WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens][Discover] Migrate field list server functions to public
8 participants