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] Cleanup filter docs #107169

Merged
merged 20 commits into from
Aug 2, 2021
Merged

Conversation

lizozom
Copy link
Contributor

@lizozom lizozom commented Jul 29, 2021

Summary

  • Cleanup filter docs
  • Mark APIs with @public and @internal
  • Cleanup any types wherever possible

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 self-assigned this Jul 29, 2021
@lizozom lizozom requested review from a team as code owners July 29, 2021 14:22
@lizozom lizozom added release_note:skip Skip the PR/issue when compiling release notes Team:AppServices v7.15.0 v8.0.0 labels Jul 29, 2021
@elasticmachine
Copy link
Contributor

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

@lizozom lizozom added the docs label Jul 29, 2021
Liza K added 2 commits July 29, 2021 16:36
@lizozom lizozom added the auto-backport Deprecated - use backport:version if exact versions are needed label Jul 29, 2021
Copy link
Member

@Bamieh Bamieh left a comment

Choose a reason for hiding this comment

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

core changes lgtm: fixing a comment typo in src/core/public/fatal_errors/fatal_errors_service.tsx

* @public
*/
export const isExistsFilter = (filter: FieldFilter): filter is ExistsFilter =>
get(filter, 'exists');
Copy link
Member

@tsullivan tsullivan Jul 29, 2021

Choose a reason for hiding this comment

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

This function doesn't explicitly return a boolean, the return value of get is any.

Should this be:

Suggested change
get(filter, 'exists');
get(filter, 'exists') != null;

?

If it's valid for filter.exists to be 0, then this function seems it would return the wrong value. Perhaps this is not a big deal, and also the same issue existed in the previous code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it by replacing get with has which does exactly that

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.

Great job on this! It looks very thorough.

I left a comment about a pattern of code that uses get to determine an object type, and it looks a bit loose to me. But I wouldn't block you from merging this PR based on my comment.

@lizozom lizozom mentioned this pull request Aug 1, 2021
9 tasks
@lizozom
Copy link
Contributor Author

lizozom commented Aug 1, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

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 -11.3KB
maps 3.2MB 3.2MB -11.4KB
securitySolution 6.4MB 6.4MB -9.7KB
total -32.5KB

Page load bundle

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

id before after diff
data 907.1KB 891.0KB -16.0KB
Unknown metric groups

API count missing comments

id before after diff
data 3397 3396 -1

API count with any type

id before after diff
data 99 80 -19

History

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

cc @lizozom

@lizozom lizozom merged commit c048f71 into elastic:master Aug 2, 2021
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 4, 2021
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 107169 or prevent reminders by adding the backport:skip label.

2 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 107169 or prevent reminders by adding the backport:skip label.

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 107169 or prevent reminders by adding the backport:skip label.

lizozom added a commit to lizozom/kibana that referenced this pull request Aug 6, 2021
* Move more utils to package and cleanup API

* docs and imports

* better imports

* change comment

* Better docs

* typos

* typo

* fixes

* casting

* Code review

* Update meta_filter.ts

* fix

Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.castestokbnfieldtypename.md
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getkbntypenames.md
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.buildqueryfromfilters.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.castestokbnfieldtypename.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kuerynode.md
#	src/plugins/data/public/public.api.md
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 7, 2021
lizozom added a commit that referenced this pull request Aug 7, 2021
* Update SM doc for alert per object (#107420)

Update stack monitoring doc to account for alert notification now being send for each node, index, or cluster based on the rule type, instead of always per cluster (PR# 102544)

* [Data] Cleanup filter docs (#107169)

* Move more utils to package and cleanup API

* docs and imports

* better imports

* change comment

* Better docs

* typos

* typo

* fixes

* casting

* Code review

* Update meta_filter.ts

* fix

Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.castestokbnfieldtypename.md
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getkbntypenames.md
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.buildqueryfromfilters.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.castestokbnfieldtypename.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.esqueryconfig.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.filter.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldsubtype.md
#	docs/development/plugins/data/server/kibana-plugin-plugins-data-server.kuerynode.md
#	src/plugins/data/public/public.api.md

* doc

Co-authored-by: Ravi Kesarwani <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
streamich pushed a commit to vadimkibana/kibana that referenced this pull request Aug 8, 2021
* Move more utils to package and cleanup API

* docs and imports

* better imports

* change comment

* Better docs

* typos

* typo

* fixes

* casting

* Code review

* Update meta_filter.ts

* fix

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed docs release_note:skip Skip the PR/issue when compiling release notes v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants