[Discover sessions as Code] Remove internal references array#252786
Conversation
…f github.com:lukasolson/kibana into discover_sessions_as_code/remove_internal_references
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
History
cc @lukasolson |
davismcphee
left a comment
There was a problem hiding this comment.
LGTM, thanks!
Tested locally using a dashboard from main as well as a new dashboard, both with a by ref and by val panel. Opened both in dashboard, inspected SO JSON and API shape, resaved, and checked again. All looked good to me 👍
| const { state: extractedState, references } = extract({ | ||
| type: SavedSearchType, | ||
| attributes: storedState.attributes, | ||
| const tabReferences: SavedObjectReference[] = []; |
There was a problem hiding this comment.
Could it contain duplicates if e.g. multiple tabs reference the same data view? Doesn't seem like an issue for now since we only support one tab for by val, but mentioning since it doesn't seem like refs are namespaced by tab ID or anything.
There was a problem hiding this comment.
Yeah, currently we're not adding a prefix for the tab, but we could definitely add this later.
…oard save (#256997) ## Summary Resolves #256943. Fixes by-value Classic mode Discover Session panels failing to load after saving and reloading a dashboard (error: `Could not find reference for kibanaSavedObjectMeta.searchSourceJSON.index`). This was a bug introduced in #252786. ### How to verify This problem really only surfaces in the UX after the changes in #256293. 1. Create a new dashboard → Add panel → Discover Session. 2. Save a default Classic mode session and return to the dashboard. 3. Save the dashboard and reload the page. 4. The Discover session panel should load without the "Could not find reference" error. Co-authored-by: Gonçalo Rica Pais da Silva <goncalo.rica@elastic.co>
…oard save (#256997) ## Summary Resolves #256943. Fixes by-value Classic mode Discover Session panels failing to load after saving and reloading a dashboard (error: `Could not find reference for kibanaSavedObjectMeta.searchSourceJSON.index`). This was a bug introduced in #252786. ### How to verify This problem really only surfaces in the UX after the changes in #256293. 1. Create a new dashboard → Add panel → Discover Session. 2. Save a default Classic mode session and return to the dashboard. 3. Save the dashboard and reload the page. 4. The Discover session panel should load without the "Could not find reference" error. Co-authored-by: Gonçalo Rica Pais da Silva <goncalo.rica@elastic.co>
…oard save (elastic#256997) ## Summary Resolves elastic#256943. Fixes by-value Classic mode Discover Session panels failing to load after saving and reloading a dashboard (error: `Could not find reference for kibanaSavedObjectMeta.searchSourceJSON.index`). This was a bug introduced in elastic#252786. ### How to verify This problem really only surfaces in the UX after the changes in elastic#256293. 1. Create a new dashboard → Add panel → Discover Session. 2. Save a default Classic mode session and return to the dashboard. 3. Save the dashboard and reload the page. 4. The Discover session panel should load without the "Could not find reference" error. Co-authored-by: Gonçalo Rica Pais da Silva <goncalo.rica@elastic.co>
Summary
Closes #239970.
Stored panel state no longer has
attributes.references. Search source refs (data view, filter indices) are in the dashboard’s top-levelreferencesand are extracted intransformInand injected intransformOutusing the same logic as inextract_references.ts/inject_references.ts