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

[UnifiedDocViewer] Move Discover doc viewer into plugin/package #162847

Merged
merged 80 commits into from
Aug 31, 2023

Conversation

lukasolson
Copy link
Member

@lukasolson lukasolson commented Jul 31, 2023

Summary

Replaces #154012.

Moves the Discover doc viewer component into a new plugin/package, @kbn/unified-doc-viewer and @kbn/unified-doc-viewer-plugin.

Checklist

Risk Matrix

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@lukasolson lukasolson added Feature:Discover Discover Application release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. ci:cloud-deploy Create or update a Cloud deployment v8.10.0 labels Jul 31, 2023
@lukasolson lukasolson self-assigned this Jul 31, 2023
@lukasolson lukasolson marked this pull request as ready for review August 8, 2023 14:37
@lukasolson lukasolson requested review from a team as code owners August 8, 2023 14:37
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

The latest changes look good! I like that we're abstracting away the services and registry, and this API feels more in line with some of the other AnalystXP components. I also tested locally again and things still seem to be working as expected. I just have a couple of minor comments on the code.

src/plugins/discover/public/build_services.ts Outdated Show resolved Hide resolved
@lukasolson
Copy link
Member Author

Sorry @walterra, I didn't mean to re-request your review, clicked on accident!

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Thanks for the last bit of cleanup! I did a final round of testing including Discover, Surrounding Docs, and Dashboard with both the new data grid and the legacy one and confirmed everything seems to be working as expected. Thanks for all the great work on this, LGTM 👍

@kertal kertal added the Feature:UnifiedDocViewer Issues relating to the unified doc viewer component label Aug 31, 2023
@kertal kertal changed the title Move doc viewer into plugin/package [UnifiedDocViewer] Move Discover doc viewer into plugin/package Aug 31, 2023
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.

Looking great 🥳 Thx so much for bringing this over the finishing line! Just left some minor remarks having another look at the code

@lukasolson lukasolson enabled auto-merge (squash) August 31, 2023 17:46
@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 31, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Serverless Observability Tests / serverless common UI home page has project header
  • [job] [logs] Serverless Observability Examples Tests / serverless examples UI Discover customization examples Customizations "before all" hook for "Top nav"
  • [job] [logs] Serverless Security Examples Tests / serverless examples UI Search examples handling warnings with search source fetch shows shard failure warning notifications by default

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
canvas 1235 1237 +2
dataVisualizer 554 567 +13
discover 629 598 -31
savedSearch 47 49 +2
unifiedDocViewer - 107 +107
total +93

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
@kbn/discover-utils 34 38 +4
@kbn/unified-doc-viewer - 7 +7
@kbn/unified-field-list 277 275 -2
discover 72 71 -1
unifiedDocViewer - 10 +10
total +18

Async chunks

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

id before after diff
dataVisualizer 606.3KB 606.1KB -220.0B
discover 564.3KB 504.0KB -60.3KB
eventAnnotation 177.4KB 177.1KB -221.0B
lens 1.4MB 1.4MB -446.0B
unifiedDocViewer - 56.3KB +56.3KB
total -4.9KB

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
@kbn/unified-doc-viewer - 5 +5
discover 17 15 -2
unifiedDocViewer - 3 +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 31.5KB 29.6KB -1.9KB
unifiedDocViewer - 9.8KB +9.8KB
total +7.9KB
Unknown metric groups

API count

id before after diff
@kbn/discover-utils 59 65 +6
@kbn/unified-doc-viewer - 10 +10
@kbn/unified-field-list 306 302 -4
discover 99 98 -1
unifiedDocViewer - 13 +13
total +24

async chunk count

id before after diff
discover 21 17 -4
unifiedDocViewer - 6 +6
total +2

ESLint disabled line counts

id before after diff
discover 43 32 -11
unifiedDocViewer - 8 +8
total -3

Total ESLint disabled count

id before after diff
discover 43 32 -11
unifiedDocViewer - 8 +8
total -3

History

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

cc @lukasolson

@lukasolson lukasolson merged commit 09cd69d into elastic:main Aug 31, 2023
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.10 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.10:
- [Security Solution] Expandable flyout - update copy writing (#164929)

Manual backport

To create the backport manually run:

node scripts/backport --pr 162847

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
backport:skip This commit does not require backporting Feature:Discover Discover Application Feature:UnifiedDocViewer Issues relating to the unified doc viewer component release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants