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 view mgmt data view lazy #190292

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

mattkime
Copy link
Contributor

@mattkime mattkime commented Aug 12, 2024

Summary

Summarize your PR. If it involves visual changes include a screenshot or gif.

  • scripted fields tab
  • update data view lazy
  • update list of scripted fields after creating scripted field

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

@mattkime
Copy link
Contributor Author

/ci

@mattkime
Copy link
Contributor Author

/ci

@mattkime
Copy link
Contributor Author

/ci

@mattkime
Copy link
Contributor Author

/ci

@mattkime
Copy link
Contributor Author

/ci

@@ -69,7 +61,7 @@ export interface Props {
*/
onCancel: () => void;
defaultTypeIsRollup?: boolean;
editData?: DataView;
editData?: DataViewLazy;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks like an external type, not sure I want to change it.

@@ -57,7 +57,7 @@ export const getEditorOpener =
}
};

const onSaveIndexPattern = (indexPattern: DataView) => {
const onSaveIndexPattern = (indexPattern: AbstractDataView) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

try leaving this alone or change separately

.getDataViewLazy(decodeURIComponent(props.match.params.id))
.then((ip: DataViewLazy) => {
dataViewMgmtService.setDataView(ip);
// todo
Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably want to fold in next calls into service

@mattkime
Copy link
Contributor Author

/ci

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 22, 2024

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #1 / dashboard app - group 1 Changing field formatter to Url applied on discover
  • [job] [logs] FTR Configs #1 / dashboard app - group 1 Changing field formatter to Url applied on discover
  • [job] [logs] FTR Configs #85 / dashboard app - group 5 embed mode default URL params renders as expected
  • [job] [logs] FTR Configs #85 / dashboard app - group 5 embed mode default URL params renders as expected
  • [job] [logs] x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group6.ts / Discover alerting Search source Alert should navigate to alert results via link provided in notification
  • [job] [logs] x-pack/test_serverless/functional/test_suites/security/common_configs/config.group6.ts / Discover alerting Search source Alert should navigate to alert results via link provided in notification
  • [job] [logs] FTR Configs #14 / Discover alerting Search source Alert should navigate to alert results via link provided in notification
  • [job] [logs] FTR Configs #84 / Discover alerting Search source Alert should navigate to alert results via link provided in notification
  • [job] [logs] x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group6.ts / Discover alerting Search source Alert should navigate to alert results via link provided in notification
  • [job] [logs] FTR Configs #14 / Discover alerting Search source Alert should navigate to alert results via link provided in notification
  • [job] [logs] x-pack/test_serverless/functional/test_suites/security/common_configs/config.group6.ts / Discover alerting Search source Alert should navigate to alert results via link provided in notification
  • [job] [logs] FTR Configs #84 / Discover alerting Search source Alert should navigate to alert results via link provided in notification
  • [job] [logs] FTR Configs #107 / discover/group4 data view flyout update data view with a different time field
  • [job] [logs] FTR Configs #107 / discover/group4 data view flyout update data view with a different time field
  • [job] [logs] FTR Configs #65 / discover/group6 discover time field column should add a time field column ESQL mode should render selected columns correctly
  • [job] [logs] FTR Configs #65 / discover/group6 discover time field column should add a time field column ESQL mode should render selected columns correctly
  • [job] [logs] Jest Tests #3 / EditableMarkdown Save button click calls onSaveContent and onChangeEditable when text area value changed
  • [job] [logs] Jest Tests #8 / IndexPatterns should handle version conflicts
  • [job] [logs] Jest Tests #8 / IndexPatterns should handle version conflicts
  • [job] [logs] FTR Configs #4 / lens app - group 6 lens workspace size gauge size (absolute pixels) - major arc
  • [job] [logs] FTR Configs #4 / lens app - group 6 lens workspace size gauge size (absolute pixels) - major arc
  • [job] [logs] FTR Configs #77 / management index result field sort field list pagination makelogs data should have expected number of fields
  • [job] [logs] FTR Configs #77 / management index result field sort field list pagination makelogs data should have expected number of fields
  • [job] [logs] FTR Configs #39 / maps app documents source search hits layer query should apply layer query to fit to bounds
  • [job] [logs] FTR Configs #39 / maps app documents source search hits layer query should apply layer query to fit to bounds
  • [job] [logs] FTR Configs #57 / Options list control Interactions between options list and dashboard "after all" hook in "Interactions between options list and dashboard"
  • [job] [logs] FTR Configs #57 / Options list control Interactions between options list and dashboard "after all" hook in "Interactions between options list and dashboard"
  • [job] [logs] FTR Configs #57 / Options list control Interactions between options list and dashboard Test data view runtime field "after all" hook for "making selection has expected results"
  • [job] [logs] FTR Configs #57 / Options list control Interactions between options list and dashboard Test data view runtime field "after all" hook for "making selection has expected results"
  • [job] [logs] FTR Configs #57 / Options list control Interactions between options list and dashboard Test data view runtime field can create options list control on runtime field
  • [job] [logs] FTR Configs #57 / Options list control Interactions between options list and dashboard Test data view runtime field can create options list control on runtime field
  • [job] [logs] FTR Configs #13 / Serverless Common UI - Management Data View Management runtime fields create runtime field should create runtime field
  • [job] [logs] FTR Configs #83 / Serverless Common UI - Management Data View Management runtime fields create runtime field should create runtime field
  • [job] [logs] FTR Configs #89 / Serverless Common UI - Management Data View Management runtime fields create runtime field should create runtime field
  • [job] [logs] FTR Configs #83 / Serverless Common UI - Management Data View Management runtime fields create runtime field should create runtime field
  • [job] [logs] FTR Configs #13 / Serverless Common UI - Management Data View Management runtime fields create runtime field should create runtime field
  • [job] [logs] FTR Configs #89 / Serverless Common UI - Management Data View Management runtime fields create runtime field should create runtime field
  • [job] [logs] FTR Configs #90 / serverless observability UI Dataset Quality Dataset quality summary shows poor, degraded and good count as 0 and all dataset as healthy
  • [job] [logs] FTR Configs #90 / serverless observability UI Dataset Quality Dataset quality summary shows poor, degraded and good count as 0 and all dataset as healthy

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dataViewManagement 236 238 +2

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
dataViews 443 476 +33

Async chunks

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

id before after diff
dataViewEditor 49.3KB 49.3KB -25.0B
dataViewManagement 140.2KB 142.4KB +2.2KB
lens 1.5MB 1.5MB +30.0B
unifiedSearch 218.5KB 218.6KB +44.0B
total +2.2KB

Page load bundle

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

id before after diff
dataViewManagement 5.0KB 5.2KB +139.0B
dataViews 62.2KB 62.5KB +280.0B
total +419.0B
Unknown metric groups

API count

id before after diff
dataViews 1224 1313 +89

ESLint disabled line counts

id before after diff
dataViewManagement 3 2 -1

References to deprecated APIs

id before after diff
@kbn/lens-embeddable-utils 1 2 +1
@kbn/ml-data-view-utils 1 2 +1
@kbn/search-errors 1 2 +1
@kbn/unified-field-list 3 6 +3
canvas 96 105 +9
controls 23 27 +4
data 29 42 +13
dataViewManagement 45 30 -15
dataVisualizer 11 12 +1
enterpriseSearch 17 20 +3
eventAnnotationListing 2 4 +2
exploratoryView 15 27 +12
fleet 72 73 +1
graph 65 69 +4
infra 6 11 +5
inputControlVis 10 13 +3
lens 84 86 +2
logsShared 2 3 +1
maps 33 34 +1
ml 34 53 +19
presentationUtil 3 4 +1
savedObjectsManagement 10 12 +2
securitySolution 472 476 +4
stackAlerts 24 27 +3
timelines 1 2 +1
transform 9 12 +3
triggersActionsUi 27 28 +1
unifiedSearch 13 16 +3
upgradeAssistant 12 13 +1
uptime 3 5 +2
ux 1 2 +1
visDefaultEditor 3 6 +3
visTypeTimelion 2 4 +2
visTypeTimeseries 24 36 +12
visTypeVega 1 2 +1
total +111

Total ESLint disabled count

id before after diff
dataViewManagement 3 2 -1

Unreferenced deprecated APIs

id before after diff
dataViews 0 3 +3

History

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

@mattkime mattkime added the backport:prev-major Backport to (8.x, 8.17, 8.16) the previous major branch and other branches in development label Sep 23, 2024
mattkime added a commit that referenced this pull request Sep 25, 2024
## Summary

Intermediate step in converting Data View Management to DataViewLazy.
Moved `useCallback` functionality into central service so much of the
state functionality is in one place and easier to understand and
refactor.

Part of #178926

Broken out from #190292 which
tried to do everything in one go and became too messy.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Julia Rechkunova <[email protected]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 25, 2024
## Summary

Intermediate step in converting Data View Management to DataViewLazy.
Moved `useCallback` functionality into central service so much of the
state functionality is in one place and easier to understand and
refactor.

Part of elastic#178926

Broken out from elastic#190292 which
tried to do everything in one go and became too messy.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Julia Rechkunova <[email protected]>
(cherry picked from commit d772a11)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 25, 2024
## Summary

Intermediate step in converting Data View Management to DataViewLazy.
Moved `useCallback` functionality into central service so much of the
state functionality is in one place and easier to understand and
refactor.

Part of elastic#178926

Broken out from elastic#190292 which
tried to do everything in one go and became too messy.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Julia Rechkunova <[email protected]>
(cherry picked from commit d772a11)
@mattkime mattkime added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed backport:prev-major Backport to (8.x, 8.17, 8.16) the previous major branch and other branches in development labels Sep 25, 2024
kibanamachine added a commit that referenced this pull request Sep 30, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Data View Mgmt] Implement state service
(#193660)](#193660)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-25T14:37:17Z","message":"[Data
View Mgmt] Implement state service (#193660)\n\n##
Summary\r\n\r\nIntermediate step in converting Data View Management to
DataViewLazy.\r\nMoved `useCallback` functionality into central service
so much of the\r\nstate functionality is in one place and easier to
understand and\r\nrefactor.\r\n\r\nPart of
https://github.com/elastic/kibana/issues/178926\r\n\r\nBroken out from
#190292 which\r\ntried to do
everything in one go and became too
messy.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Julia Rechkunova
<[email protected]>","sha":"d772a11c74af1efd05242516900f06cbeb00dd6f","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Data
Views","Feature:Kibana
Management","release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-major"],"title":"[Data
View Mgmt] Implement state
service","number":193660,"url":"https://github.com/elastic/kibana/pull/193660","mergeCommit":{"message":"[Data
View Mgmt] Implement state service (#193660)\n\n##
Summary\r\n\r\nIntermediate step in converting Data View Management to
DataViewLazy.\r\nMoved `useCallback` functionality into central service
so much of the\r\nstate functionality is in one place and easier to
understand and\r\nrefactor.\r\n\r\nPart of
https://github.com/elastic/kibana/issues/178926\r\n\r\nBroken out from
#190292 which\r\ntried to do
everything in one go and became too
messy.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Julia Rechkunova
<[email protected]>","sha":"d772a11c74af1efd05242516900f06cbeb00dd6f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193660","number":193660,"mergeCommit":{"message":"[Data
View Mgmt] Implement state service (#193660)\n\n##
Summary\r\n\r\nIntermediate step in converting Data View Management to
DataViewLazy.\r\nMoved `useCallback` functionality into central service
so much of the\r\nstate functionality is in one place and easier to
understand and\r\nrefactor.\r\n\r\nPart of
https://github.com/elastic/kibana/issues/178926\r\n\r\nBroken out from
#190292 which\r\ntried to do
everything in one go and became too
messy.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Julia Rechkunova
<[email protected]>","sha":"d772a11c74af1efd05242516900f06cbeb00dd6f"}}]}]
BACKPORT-->

Co-authored-by: Matthew Kime <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants