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

[Data][Filters] Move more filter utils to package and cleanup API #106566

Merged
merged 8 commits into from Jul 28, 2021

Conversation

lizozom
Copy link
Contributor

@lizozom lizozom commented Jul 22, 2021

Summary

Partially addresses #104140

Release Note

The following filter related utilities were marked as deprecated when imported from the data plugin.
Please import them from @kbn/es-query.

On the client side:

  • esFilters is now deprecated
    • FilterLabel, FilterItem, getDisplayValueFromFilter, generateFilters, extractTimeRange can be imported from data\public (not using esFilters).
    • The following utility functions are available to be imported from @kbn/es-query
      • COMPARE_ALL_OPTIONS
      • compareFilters
      • enableFilter
      • pinFilter
      • toggleFilterDisabled
      • dedupFilters
      • onlyDisabledFiltersChanged
      • uniqFilters
    • The following functions are marked from deprecation and won't be part of the 8.0 public API
      • convertRangeFilterToTimeRangeString
      • extractTimeFilter
      • changeTimeFilter
      • mapAndFlattenFilters

On the server side:

  • esFilters is now deprecated
    • All utility functions are available to be imported from @kbn/es-query

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

@lizozom lizozom changed the title Move more utils to package and cleanup API [Data][Filters] Move more filter utils to package and cleanup API Jul 22, 2021
@lizozom lizozom self-assigned this Jul 26, 2021
@lizozom lizozom added release_note:deprecation Team:AppServices technical debt Improvement of the software architecture and operational architecture v7.15.0 v8.0.0 labels Jul 26, 2021
@lizozom lizozom marked this pull request as ready for review July 26, 2021 13:28
@lizozom lizozom requested a review from a team as a code owner July 26, 2021 13:28
@elasticmachine
Copy link
Contributor

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

@lizozom
Copy link
Contributor Author

lizozom commented Jul 26, 2021

@elasticmachine merge upstream

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

Code changes LGTM, added a couple minor notes below

@@ -4,6 +4,13 @@

## esFilters variable

> Warning: This API is now obsolete.
Copy link
Member

Choose a reason for hiding this comment

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

Any reason not to deprecate this now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this would be considered a breaking change, no?

Copy link
Member

Choose a reason for hiding this comment

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

Nah, deprecating something isn't a breaking change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the text to "removed"

src/plugins/data/public/deprecated.ts Outdated Show resolved Hide resolved
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
data 592 596 +4
infra 939 947 +8
maps 797 805 +8
securitySolution 2322 2330 +8
total +28

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
data 3162 3189 +27

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
data 98 99 +1

Async chunks

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

id before after diff
infra 1.7MB 1.7MB +22.0B
maps 3.2MB 3.2MB +23.0B
securitySolution 6.4MB 6.4MB +26.0B
total +71.0B

Page load bundle

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

id before after diff
data 837.7KB 840.1KB +2.4KB
Unknown metric groups

API count

id before after diff
data 3716 3738 +22

References to deprecated APIs

id before after diff
canvas 51 53 +2
dashboard 128 145 +17
dashboardEnhanced 10 13 +3
discover 102 129 +27
discoverEnhanced 19 21 +2
lens 160 166 +6
maps 592 608 +16
observability 34 42 +8
securitySolution 881 909 +28
visualizations 32 34 +2
total +111

History

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

cc @lizozom

@lizozom lizozom added the auto-backport Deprecated: Automatically backport this PR after it's merged label Jul 27, 2021
@lizozom lizozom merged commit eeb88b0 into elastic:master Jul 28, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 28, 2021
…astic#106566)

* Move more utils to package and cleanup API

* docs and imports

* better imports

* change comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jul 28, 2021
…06566) (#106988)

* Move more utils to package and cleanup API

* docs and imports

* better imports

* change comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Liza Katz <lizka.k@gmail.com>
spalger added a commit to spalger/kibana that referenced this pull request Jul 29, 2021
spalger added a commit to spalger/kibana that referenced this pull request Jul 29, 2021
streamich pushed a commit to vadimkibana/kibana that referenced this pull request Aug 8, 2021
…astic#106566)

* Move more utils to package and cleanup API

* docs and imports

* better imports

* change comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated: Automatically backport this PR after it's merged release_note:deprecation technical debt Improvement of the software architecture and operational architecture v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants