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

[VisualizeList] Move CM client into separate plugin #165292

Closed
wants to merge 16 commits into from

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Aug 31, 2023

Summary

Fixes #163246

This PR fixes a couple of issues with the current CM code:

  • fixes CRUD operations for SO type who are not visualization types (i.e. Lens, Maps)
    • 🐛 fixed Maps update operation definition which was missing the overwrite flag
  • migrates the current Visualize List search operation into the mSearch operation which is more correct

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

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

@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 31, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #63 / Cases - group 1 View case Lens visualization adds lens visualization in description
  • [job] [logs] FTR Configs #63 / Cases - group 1 View case Lens visualization adds lens visualization in description
  • [job] [logs] FTR Configs #46 / dashboard feature controls dashboard time to visualize security lens by value works without library save permissions should allow new lens to be added by value, but not by reference
  • [job] [logs] FTR Configs #46 / dashboard feature controls dashboard time to visualize security lens by value works without library save permissions should allow new lens to be added by value, but not by reference
  • [job] [logs] FTR Configs #31 / dashboard sync colors should sync colors on dashboard by default
  • [job] [logs] FTR Configs #31 / dashboard sync colors should sync colors on dashboard by default
  • [job] [logs] FTR Configs #53 / endpoint Response Actions Responder from timeline should show Responder from alert in a timeline
  • [job] [logs] FTR Configs #53 / endpoint Response Actions Responder from timeline should show Responder from alert in a timeline
  • [job] [logs] FTR Configs #37 / Journey[many_fields_lens_editor] Open existing Lens visualization
  • [job] [logs] FTR Configs #37 / Journey[many_fields_lens_editor] Open existing Lens visualization
  • [job] [logs] FTR Configs #69 / Lens Accessibility "after all" hook for "saves lens chart"
  • [job] [logs] FTR Configs #69 / Lens Accessibility "after all" hook for "saves lens chart"
  • [job] [logs] FTR Configs #69 / Lens Accessibility lens XY chart
  • [job] [logs] FTR Configs #69 / Lens Accessibility lens XY chart
  • [job] [logs] FTR Configs #57 / lens app - Agg based Vis Open in Lens Pie should convert aggregation with params
  • [job] [logs] FTR Configs #57 / lens app - Agg based Vis Open in Lens Pie should convert aggregation with params
  • [job] [logs] FTR Configs #30 / lens app - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #45 / lens app - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #30 / lens app - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #45 / lens app - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #11 / lens app - group 2 lens partition charts "before all" hook for "should be able to nest up to 3 levels for Pie charts"
  • [job] [logs] FTR Configs #11 / lens app - group 2 lens partition charts "before all" hook for "should be able to nest up to 3 levels for Pie charts"
  • [job] [logs] FTR Configs #39 / lens app - group 3 lens add-to-dashboards tests should allow new lens to be added by value to a new dashboard
  • [job] [logs] FTR Configs #39 / lens app - group 3 lens add-to-dashboards tests should allow new lens to be added by value to a new dashboard
  • [job] [logs] FTR Configs #1 / lens app - group 4 lens color palette tests should allow to pick color palette in xy chart
  • [job] [logs] FTR Configs #1 / lens app - group 4 lens color palette tests should allow to pick color palette in xy chart
  • [job] [logs] FTR Configs #51 / lens app - group 5 lens drag and drop tests basic drag and drop should construct the basic split xy chart
  • [job] [logs] FTR Configs #51 / lens app - group 5 lens drag and drop tests basic drag and drop should construct the basic split xy chart
  • [job] [logs] FTR Configs #59 / lens app - group 6 lens metric should render a metric
  • [job] [logs] FTR Configs #59 / lens app - group 6 lens metric should render a metric
  • [job] [logs] FTR Configs #36 / lens app - TSVB Open in Lens Metric should convert to Lens
  • [job] [logs] FTR Configs #36 / lens app - TSVB Open in Lens Metric should convert to Lens
  • [job] [logs] FTR Configs #13 / lens search sessions lens search sessions doesn't shows search sessions indicator UI
  • [job] [logs] FTR Configs #13 / lens search sessions lens search sessions doesn't shows search sessions indicator UI
  • [job] [logs] Jest Tests #10 / LensStore load throws if an error is returned
  • [job] [logs] Jest Tests #10 / LensStore save creates and returns a visualization document
  • [job] [logs] Jest Tests #10 / LensStore save updates and returns a visualization document
  • [job] [logs] FTR Configs #65 / machine learning - data visualizer index based with view in lens action farequote index pattern loads lens charts
  • [job] [logs] FTR Configs #65 / machine learning - data visualizer index based with view in lens action farequote index pattern loads lens charts
  • [job] [logs] FTR Configs #47 / machine learning basic license - data visualizer - group 2 index based with view in lens action farequote index pattern loads lens charts
  • [job] [logs] FTR Configs #47 / machine learning basic license - data visualizer - group 2 index based with view in lens action farequote index pattern loads lens charts
  • [job] [logs] FTR Configs #56 / maps app visualize create menu edit meta-data should allow to change meta-data on a map visualization
  • [job] [logs] FTR Configs #56 / maps app visualize create menu edit meta-data should allow to change meta-data on a map visualization
  • [job] [logs] FTR Configs #9 / Sanity checks lens app lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #24 / Sanity checks lens app lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #25 / Sanity checks lens app lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #25 / Sanity checks lens app lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #24 / Sanity checks lens app lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #9 / Sanity checks lens app lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] Jest Tests #5 / saved_visualize_utils findListItems deduplicates types and search fields
  • [job] [logs] Jest Tests #5 / saved_visualize_utils findListItems searches searchFields and types specified by app extensions
  • [job] [logs] Jest Tests #5 / saved_visualize_utils findListItems searches the search term prefix
  • [job] [logs] Jest Tests #5 / saved_visualize_utils findListItems searches visualization title and description
  • [job] [logs] Jest Tests #5 / saved_visualize_utils findListItems searches with references

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 1139 1140 +1
visualizeListClient - 4 +4
total +5

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
contentManagement 126 127 +1
visualizations 793 783 -10
visualizeListClient - 10 +10
total +1

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.4MB 1.4MB -148.0B
maps 2.8MB 2.8MB -1019.0B
visualizations 264.8KB 264.9KB +86.0B
total -1.1KB

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
visualizations 19 18 -1
visualizeListClient - 3 +3
total +2

Page load bundle

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

id before after diff
lens 36.3KB 37.0KB +734.0B
maps 45.3KB 46.4KB +1.1KB
visualizations 56.9KB 57.2KB +320.0B
visualizeListClient - 1.7KB +1.7KB
total +3.8KB
Unknown metric groups

API count

id before after diff
@kbn/content-management-utils 188 189 +1
contentManagement 149 150 +1
visualizations 823 813 -10
visualizeListClient - 10 +10
total +2

References to deprecated APIs

id before after diff
visualizations 79 77 -2

History

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

@dej611 dej611 closed this Sep 4, 2023
dej611 added a commit that referenced this pull request Sep 13, 2023
… CM (#165485)

## Summary

Fix #163246

This PR fixes the CM problems within the Visualize List page leveraging
the services already in place.
The approach here is lighter than #165292 as it passes each client via
the TypesService already used to register extensions in the
Visualization scope. Also the `search` method now transparently uses the
`mSearch` if more content types are detected without leaking any
implementation detail outside the `VisualizationClient` interface.

More fixes/features:
* fixed Maps update operation definition which was missing the
`overwrite` flag
* Allow `mSearch` to accept an options object argument
* Added new helper functions to interact with the metadata flyout in
Listing page


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Stratoula Kalafateli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CM][Visualizations] Correct usage of CM in visualize library
3 participants