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

[Discover] Prevent agg based visualizations of Discover saved objects with adhoc data views #145583

Merged

Conversation

dimaanj
Copy link
Contributor

@dimaanj dimaanj commented Nov 17, 2022

Summary

Fixes #141812

This PR preventing using Discover saved objects with adhoc data views in aggregation based visualisations.

Test notes

  • Create Saved search based on adhoc data view in Discover
  • Open new Agg based visualisations list and choose one
  • Created Saved search shouldn't appear in the list.

Checklist

@dimaanj dimaanj added Feature:Discover Discover Application release_note:fix Feature:Vis Editor Visualization editor issues auto-backport Deprecated - use backport:version if exact versions are needed Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.5.0 v8.6.0 v8.7.0 labels Nov 17, 2022
@dimaanj dimaanj self-assigned this Nov 17, 2022
@dimaanj
Copy link
Contributor Author

dimaanj commented Nov 18, 2022

@elasticmachine merge upstream

@dimaanj
Copy link
Contributor Author

dimaanj commented Nov 18, 2022

@elasticmachine merge upstream

@dimaanj
Copy link
Contributor Author

dimaanj commented Nov 18, 2022

@elasticmachine merge upstream

@dimaanj dimaanj marked this pull request as ready for review November 18, 2022 16:29
@dimaanj dimaanj requested review from a team as code owners November 18, 2022 16:29
@elasticmachine
Copy link
Contributor

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

@dimaanj dimaanj added v8.5.2 and removed v8.5.0 labels Nov 18, 2022
@dimaanj
Copy link
Contributor Author

dimaanj commented Nov 21, 2022

@elasticmachine merge upstream

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 (input on the update in so type + hash change). My only comment outside the core changes is that it would be nice if you can add a small unit test for the component to make sure its rendering as expected (or splitting the hide/show logic in the showSavedObject into a separate function that you can unit test )

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Visualizations team changes LGTM!

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 code changes LGTM and worked well in local testing. The only thing is I'm not sure isOfAdHocDataView is a clear property name. I'm leaning toward something like usesAdHocDataView or similar. @kertal @jughosta Any thoughts?

@kertal
Copy link
Member

kertal commented Nov 23, 2022

yes, I think usesAdHocDataView sounds preferable 👍

@dimaanj
Copy link
Contributor Author

dimaanj commented Nov 23, 2022

@elasticmachine merge upstream

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 property name update, LGTM 👍

@dimaanj
Copy link
Contributor Author

dimaanj commented Nov 24, 2022

@elasticmachine merge upstream

@dimaanj
Copy link
Contributor Author

dimaanj commented Nov 25, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
visualizations 328 329 +1

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
discover 80 81 +1
savedObjects 152 156 +4
savedSearch 43 44 +1
total +6

Async chunks

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

id before after diff
discover 415.1KB 415.2KB +37.0B
visualizations 267.3KB 267.4KB +81.0B
total +118.0B

Page load bundle

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

id before after diff
savedSearch 5.1KB 5.2KB +76.0B

Saved Objects .kibana field count

Every field in each saved object type adds overhead to Elasticsearch. Kibana needs to keep the total field count below Elasticsearch's default limit of 1000 fields. Only specify field mappings for the fields you wish to search on or query. See https://www.elastic.co/guide/en/kibana/master/saved-objects-service.html#_mappings

id before after diff
search 22 23 +1
Unknown metric groups

API count

id before after diff
discover 97 98 +1
savedObjects 193 197 +4
savedSearch 43 44 +1
total +6

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 443 449 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 68 74 +6
osquery 110 117 +7
securitySolution 520 526 +6
total +21

History

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

cc @dimaanj

@dimaanj dimaanj merged commit 2c9043a into elastic:main Nov 25, 2022
kibanamachine pushed a commit that referenced this pull request Nov 25, 2022
… with adhoc data views (#145583)

## Summary

Fixes #141812

This PR preventing using Discover saved objects with adhoc data views in
aggregation based visualisations.

### Test notes
- Create Saved search based on adhoc data view in Discover
- Open new Agg based visualisations list and choose one
- Created Saved search shouldn't appear in the list.

### Checklist

- [ ] [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

(cherry picked from commit 2c9043a)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.6
8.5 Backport failed because of merge conflicts

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 145583

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

kibanamachine added a commit that referenced this pull request Nov 25, 2022
…bjects with adhoc data views (#145583) (#146344)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Discover] Prevent agg based visualizations of Discover saved objects
with adhoc data views
(#145583)](#145583)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dmitry
Tomashevich","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-11-25T13:16:34Z","message":"[Discover]
Prevent agg based visualizations of Discover saved objects with adhoc
data views (#145583)\n\n## Summary\r\n\r\nFixes #141812\r\n\r\nThis PR
preventing using Discover saved objects with adhoc data views
in\r\naggregation based visualisations.\r\n\r\n### Test notes \r\n-
Create Saved search based on adhoc data view in Discover\r\n- Open new
Agg based visualisations list and choose one\r\n- Created Saved search
shouldn't appear in the list. \r\n\r\n### Checklist\r\n\r\n\r\n- [ ]
[Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:fix","Feature:Vis
Editor","auto-backport","Team:DataDiscovery","v8.6.0","v8.7.0","v8.5.2"],"number":145583,"url":"https://github.com/elastic/kibana/pull/145583","mergeCommit":{"message":"[Discover]
Prevent agg based visualizations of Discover saved objects with adhoc
data views (#145583)\n\n## Summary\r\n\r\nFixes #141812\r\n\r\nThis PR
preventing using Discover saved objects with adhoc data views
in\r\naggregation based visualisations.\r\n\r\n### Test notes \r\n-
Create Saved search based on adhoc data view in Discover\r\n- Open new
Agg based visualisations list and choose one\r\n- Created Saved search
shouldn't appear in the list. \r\n\r\n### Checklist\r\n\r\n\r\n- [ ]
[Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4"}},"sourceBranch":"main","suggestedTargetBranches":["8.6","8.5"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145583","number":145583,"mergeCommit":{"message":"[Discover]
Prevent agg based visualizations of Discover saved objects with adhoc
data views (#145583)\n\n## Summary\r\n\r\nFixes #141812\r\n\r\nThis PR
preventing using Discover saved objects with adhoc data views
in\r\naggregation based visualisations.\r\n\r\n### Test notes \r\n-
Create Saved search based on adhoc data view in Discover\r\n- Open new
Agg based visualisations list and choose one\r\n- Created Saved search
shouldn't appear in the list. \r\n\r\n### Checklist\r\n\r\n\r\n- [ ]
[Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4"}},{"branch":"8.5","label":"v8.5.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dmitry Tomashevich <[email protected]>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 28, 2022
* main: (30 commits)
  [Cloud Posture] test latest findings table sort (elastic#144668)
  [api-docs] 2022-11-28 Daily api_docs build (elastic#146359)
  [api-docs] 2022-11-27 Daily api_docs build (elastic#146353)
  [api-docs] 2022-11-26 Daily api_docs build (elastic#146350)
  [DataViews] Fix form validation UX when the same data view name already exists (elastic#146126)
  [Discover] Prevent agg based visualizations of Discover saved objects with adhoc data views (elastic#145583)
  [Health Gateway] Update response aggregation (elastic#145761)
  [api-docs] 2022-11-25 Daily api_docs build (elastic#146341)
  [Metric threshold rule] Adds new context variable for group by keys (elastic#145654)
  [Controls] [Portable Dashboards] Add control group renderer example plugin (elastic#146189)
  Refactor Observability Overview Page (elastic#146182)
  Send complete test data to xMatters, so it can create an alert (elastic#145431)
  [Dashboard] [Controls] Allow options list suggestions to be sorted (elastic#144867)
  Add open API specification for list connector types (elastic#145951)
  skip flaky suite (elastic#146086)
  [ML] Removing duplicate tooltip text (elastic#146308)
  Refactor Rules Page (elastic#146193)
  [DOCS] Alert limit for cases (elastic#145950)
  Extend session index fields mapping with a session creation timestamp. (elastic#145997)
  [Files] Move <Image /> component to `@kbn/shared-ux` package (elastic#145995)
  ...
@dimaanj
Copy link
Contributor Author

dimaanj commented Nov 28, 2022

💚 All backports created successfully

Status Branch Result
8.5

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

dimaanj added a commit to dimaanj/kibana that referenced this pull request Nov 28, 2022
… with adhoc data views (elastic#145583)

## Summary

Fixes elastic#141812

This PR preventing using Discover saved objects with adhoc data views in
aggregation based visualisations.

### Test notes
- Create Saved search based on adhoc data view in Discover
- Open new Agg based visualisations list and choose one
- Created Saved search shouldn't appear in the list.

### Checklist

- [ ] [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

(cherry picked from commit 2c9043a)

# Conflicts:
#	src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts
dimaanj added a commit that referenced this pull request Nov 28, 2022
…bjects with adhoc data views (#145583) (#146412)

# Backport

This will backport the following commits from `main` to `8.5`:
- [[Discover] Prevent agg based visualizations of Discover saved objects
with adhoc data views
(#145583)](#145583)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dmitry
Tomashevich","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-11-25T13:16:34Z","message":"[Discover]
Prevent agg based visualizations of Discover saved objects with adhoc
data views (#145583)\n\n## Summary\r\n\r\nFixes #141812\r\n\r\nThis PR
preventing using Discover saved objects with adhoc data views
in\r\naggregation based visualisations.\r\n\r\n### Test notes \r\n-
Create Saved search based on adhoc data view in Discover\r\n- Open new
Agg based visualisations list and choose one\r\n- Created Saved search
shouldn't appear in the list. \r\n\r\n### Checklist\r\n\r\n\r\n- [ ]
[Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:fix","Feature:Vis
Editor","auto-backport","Team:DataDiscovery","v8.6.0","v8.7.0","v8.5.2"],"number":145583,"url":"https://github.com/elastic/kibana/pull/145583","mergeCommit":{"message":"[Discover]
Prevent agg based visualizations of Discover saved objects with adhoc
data views (#145583)\n\n## Summary\r\n\r\nFixes #141812\r\n\r\nThis PR
preventing using Discover saved objects with adhoc data views
in\r\naggregation based visualisations.\r\n\r\n### Test notes \r\n-
Create Saved search based on adhoc data view in Discover\r\n- Open new
Agg based visualisations list and choose one\r\n- Created Saved search
shouldn't appear in the list. \r\n\r\n### Checklist\r\n\r\n\r\n- [ ]
[Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4"}},"sourceBranch":"main","suggestedTargetBranches":["8.5"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/146344","number":146344,"state":"MERGED","mergeCommit":{"sha":"461c04ec6cf855ba590b06d5be7ba121cefc00ba","message":"[8.6]
[Discover] Prevent agg based visualizations of Discover saved objects
with adhoc data views (#145583) (#146344)\n\n# Backport\n\nThis will
backport the following commits from `main` to `8.6`:\n- [[Discover]
Prevent agg based visualizations of Discover saved objects\nwith adhoc
data
views\n(#145583)](https://github.com/elastic/kibana/pull/145583)\n\n<!---
Backport version: 8.9.7 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Dmitry\nTomashevich\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2022-11-25T13:16:34Z\",\"message\":\"[Discover]\nPrevent
agg based visualizations of Discover saved objects with adhoc\ndata
views (#145583)\\n\\n## Summary\\r\\n\\r\\nFixes #141812\\r\\n\\r\\nThis
PR\npreventing using Discover saved objects with adhoc data
views\nin\\r\\naggregation based visualisations.\\r\\n\\r\\n### Test
notes \\r\\n-\nCreate Saved search based on adhoc data view in
Discover\\r\\n- Open new\nAgg based visualisations list and choose
one\\r\\n- Created Saved search\nshouldn't appear in the list.
\\r\\n\\r\\n### Checklist\\r\\n\\r\\n\\r\\n- [ ]\n[Unit
or\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated
or added to match the most
common\nscenarios\",\"sha\":\"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4\",\"branchLabelMapping\":{\"^v8.7.0$\":\"main\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"Feature:Discover\",\"release_note:fix\",\"Feature:Vis\nEditor\",\"auto-backport\",\"Team:DataDiscovery\",\"v8.6.0\",\"v8.7.0\",\"v8.5.2\"],\"number\":145583,\"url\":\"https://github.com/elastic/kibana/pull/145583\",\"mergeCommit\":{\"message\":\"[Discover]\nPrevent
agg based visualizations of Discover saved objects with adhoc\ndata
views (#145583)\\n\\n## Summary\\r\\n\\r\\nFixes #141812\\r\\n\\r\\nThis
PR\npreventing using Discover saved objects with adhoc data
views\nin\\r\\naggregation based visualisations.\\r\\n\\r\\n### Test
notes \\r\\n-\nCreate Saved search based on adhoc data view in
Discover\\r\\n- Open new\nAgg based visualisations list and choose
one\\r\\n- Created Saved search\nshouldn't appear in the list.
\\r\\n\\r\\n### Checklist\\r\\n\\r\\n\\r\\n- [ ]\n[Unit
or\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated
or added to match the most
common\nscenarios\",\"sha\":\"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.6\",\"8.5\"],\"targetPullRequestStates\":[{\"branch\":\"8.6\",\"label\":\"v8.6.0\",\"labelRegex\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"main\",\"label\":\"v8.7.0\",\"labelRegex\":\"^v8.7.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/145583\",\"number\":145583,\"mergeCommit\":{\"message\":\"[Discover]\nPrevent
agg based visualizations of Discover saved objects with adhoc\ndata
views (#145583)\\n\\n## Summary\\r\\n\\r\\nFixes #141812\\r\\n\\r\\nThis
PR\npreventing using Discover saved objects with adhoc data
views\nin\\r\\naggregation based visualisations.\\r\\n\\r\\n### Test
notes \\r\\n-\nCreate Saved search based on adhoc data view in
Discover\\r\\n- Open new\nAgg based visualisations list and choose
one\\r\\n- Created Saved search\nshouldn't appear in the list.
\\r\\n\\r\\n### Checklist\\r\\n\\r\\n\\r\\n- [ ]\n[Unit
or\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated
or added to match the most
common\nscenarios\",\"sha\":\"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4\"}},{\"branch\":\"8.5\",\"label\":\"v8.5.2\",\"labelRegex\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by:
Dmitry Tomashevich
<[email protected]>"}},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145583","number":145583,"mergeCommit":{"message":"[Discover]
Prevent agg based visualizations of Discover saved objects with adhoc
data views (#145583)\n\n## Summary\r\n\r\nFixes #141812\r\n\r\nThis PR
preventing using Discover saved objects with adhoc data views
in\r\naggregation based visualisations.\r\n\r\n### Test notes \r\n-
Create Saved search based on adhoc data view in Discover\r\n- Open new
Agg based visualisations list and choose one\r\n- Created Saved search
shouldn't appear in the list. \r\n\r\n### Checklist\r\n\r\n\r\n- [ ]
[Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"2c9043ab431cebbbdeb77c96aa2a5c0bc5b0ddf4"}},{"branch":"8.5","label":"v8.5.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

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 Feature:Discover Discover Application Feature:Vis Editor Visualization editor issues release_note:fix Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.5.2 v8.5.3 v8.6.0 v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aggregation-based Visualizations display "Search not found" when using ad-hoc data views
8 participants