Skip to content

[Security Solution] remove newDataViewPickerEnabled feature flag#238549

Open
PhilippeOberti wants to merge 1 commit intoelastic:mainfrom
PhilippeOberti:remove-newDataViewPickerEnabled-ff
Open

[Security Solution] remove newDataViewPickerEnabled feature flag#238549
PhilippeOberti wants to merge 1 commit intoelastic:mainfrom
PhilippeOberti:remove-newDataViewPickerEnabled-ff

Conversation

@PhilippeOberti
Copy link
Copy Markdown
Contributor

@PhilippeOberti PhilippeOberti commented Oct 10, 2025

Warning

This PR changes a lot of files. This change will not make it within 9.3.
9.3.0 feature freeze is on December 16th 2025, so ideally we'd be merging this PR on December 17th. This should give plenty of time to all the teams involved to do their testing.

Summary

The newDataViewPickerEnabled feature flag has been turned on in this previous PR. We have not had any issues related to the usage of the data view picker over the old sourcerer code.

This PR removes the newDataViewPickerEnabled as well as all the code related to it and to the old sourcerer implementation. Some hooks are still being used, so a follow up PR will finalize the cleanup.

What's included in this PR

Here's a list of high level changes:

  • remove all sourcerer code related to the newDataViewPickerEnabled feature flag (some follow up cleanup will be required to fully delete the content of the sourcerer folder
  • rename all the experimentalDataView (and other experimental... names) with just dataView

What work will remains for follow up PRs

What will be coming after this PR is merged:

  • some more cleanup like rename all the remaining sourcererScope to pageScope
  • remove some of the duplicated useDataView and other hooks that are still living throughout Security Solution
  • move all the necessary hooks and functions left in the sourcerer folder into the new data_view_manager folder
  • finally, move the code that lives in the data_view_manager folder into a package and update all imports accordingly

Caution

While the PR should only removed unused code, please take your time looking at the code and testing the pages and feature you own, to make sure that no unwanted code was removed and functionality impacted!

How to test

  • pull down the branch
  • smoke test the application

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@PhilippeOberti PhilippeOberti added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team v9.3.0 labels Oct 10, 2025
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch 2 times, most recently from 2852474 to b1cca27 Compare October 11, 2025 03:03
@PhilippeOberti PhilippeOberti changed the title wip Remove sourcerer Oct 11, 2025
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from b1cca27 to 677e8b8 Compare October 11, 2025 04:32
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from 677e8b8 to 94ebf77 Compare October 21, 2025 03:33
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from 94ebf77 to 21f1137 Compare October 29, 2025 05:32
@PhilippeOberti PhilippeOberti changed the title Remove sourcerer [Security Solution] remove newDataViewPickerEnabled feature flag Oct 29, 2025
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch 8 times, most recently from 3504e7e to 3211e6d Compare November 5, 2025 22:37
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from 3211e6d to 96bfa41 Compare November 7, 2025 16:07
PhilippeOberti added a commit that referenced this pull request Nov 12, 2025
…separate props (#242490)

## Summary

This PR makes a small change to the SearchBar component used in many
pages in Security Solution.

### Context

In the previous version of the code, we were passing the dataView to the
component via the `sourcererDataView` prop. There was also some internal
logic to fetch the dataView using the `useDataView` hook, as well as
some logic to switch between the `sourcererDataView` and the new
`dataView` using the `dataViewPickerEnabled` feature flag.
The problem is this was not clear, as almost every page using the
SearchBar component was also fetching the `experimentalDataView` and the
`oldSourcererDataView` and pass only the correct one depending on the
value of the `dataViewPickerEnabled` feature flag.

That logic was done in so many places, it was very confusing.

Also, something that the previous code was not allowing us to do was to
pass a dataView for a specific scope. The `useDataView` hook within the
`SearchBar` component was using the default scope.
For the Attacks page we're currently creating (see skeleton PR
[here](#242384)), we need to
select the attacks data view (created in [this previous
PR](#238750)).

### Changes

This PR makes the following small changes:
- separate the previous `sourcererDataView` prop into 2 new ones:
- `dataView` for the dataView used when the `dataViewPickerEnabled` is
`true`
- `sourcererDataViewSpec` for the dataView used when the
`dataViewPickerEnabled` is `false`
- rename `oldSourcererDataView` to `oldSourcererDataViewSpec` to better
reflect the type of the variable (`DataViewSpec`)
- added TODOs everywhere as we will be removing all the old sourcerer
related code soon (most likely January, PR in draft
[here](#238549)).

> [!NOTE]
> This PR should not introduce any behavior or UI changes. A good sign
is other than name changes, none of the existing unit tests have been
changed 😄
> You'll also notice that the changes are very repetitive between all
the files.

### Checklist

- [x] [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from 96bfa41 to 42e15a4 Compare November 14, 2025 06:44
PhilippeOberti added a commit that referenced this pull request Nov 14, 2025
…pare the new attacks page (#242312)

## Summary

This PR renames the `SourcererScopeName` from `detections` to `alerts`.
We will soon need a new scope called `attacks` so we can easily retrieve
the new attack dataview (introduced in [this recent
PR](#238750)). This renaming will
avoid confusion.

> [!IMPORTANT]
> No UI changes should be introduced by this PR!

--------------------------------------------------------------

_Edit: after discussing with the team, I took this opportunity to do one
more cleanup: the `DataViewManagerScopeName` enum (which is basically
pointing to the `SourcererScopeName` enum are now one. I'm defining this
new enum within the `data_view_manager` folder as the sourcerer folder
will be soon removed (see this draft
[PR](#238549)), and is now named
`PageScope`. That way, it is much less confusing what this enum actually
does..._

> [!NOTE]
> `PageScope` points to the location of the picker (using
`useDataView(scope)` returns the current dataview selected in that
scope)

## Files by codeowner

<details>
<summary>Expand to see all files by codeowners</summary>

### elastic/contextual-security-apps

*
x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/index.tsx

### elastic/kibana-cases

*
x-pack/solutions/security/plugins/security_solution/public/cases/components/ease/table.tsx
*
x-pack/solutions/security/plugins/security_solution/public/cases/pages/use_fetch_alert_data.ts

### elastic/security-detection-engine

*
x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_histogram.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_table_cell_renderer.tsx

### elastic/security-detection-rule-management

*
x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx

### elastic/security-entity-analytics

*
x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions.ts
*
x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_management/alert_filters_kql_bar.tsx
*
x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_management/risk_score_preview_section.tsx
*
x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_analytics_privileged_user_monitoring_page.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/metric_embeddable.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/stat_items.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/hosts.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/index.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/embedded_map.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/point_tool_tip_content.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/network/components/field_renderers/field_renderers.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/network/components/field_renderers/field_renderers.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/dns_query_tab_body.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/network.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/authentications_query_tab_body.tsx
*
x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/users.tsx

### elastic/security-generative-ai

*
x-pack/solutions/security/plugins/security_solution/public/assistant/send_to_timeline/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/ease/table.tsx
*
x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/alert_selection/alert_selection_query/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/alert_selection/preview_tab/index.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/alert_selection/preview_tab/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/create_flyout/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/details_flyout/definition/filters.tsx
*
x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/details_flyout/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/alert_filtering_metric.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/alert_filtering_metric.tsx
*
x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/alert_processing_donut_lens.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/alert_processing_donut_lens.tsx
*
x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/cost_savings_metric.tsx
*
x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/cost_savings_trend.tsx
*
x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/time_saved_metric.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/time_saved_metric.tsx

### elastic/security-threat-hunting-investigations

*
x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/events_query_tab_body.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/modal.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_query.ts
*
x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/helpers.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/helpers.ts
*
x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/top_n.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/actions.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/actions.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.tsx
*
x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/types.ts
*
x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.tsx
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/components/data_view_picker/index.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/components/data_view_picker/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/constants.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_browser_fields.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_browser_fields.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_data_view.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_data_view.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_data_view_spec.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_data_view_spec.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_init_data_view_manager.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_select_data_view.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_select_data_view.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_selected_patterns.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_selected_patterns.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_sync_url_state.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_sync_url_state.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/redux/actions.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/redux/listeners/data_view_selected.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/redux/listeners/data_view_selected.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/redux/listeners/init_listener.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/redux/listeners/init_listener.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/redux/reducer.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/redux/selectors.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/redux/slices.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/data_view_manager/redux/slices.ts
*
x-pack/solutions/security/plugins/security_solution/public/detections/components/alert_summary/table/table.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts/wrapper.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/additional_toolbar_controls.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_sub_grouping.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_bulk_to_timeline.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/types.ts
*
x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/cell_value_context.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_bulk_actions.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_bulk_actions.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_cell_actions.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_trigger_actions_browser_fields_options.tsx
*
x-pack/solutions/security/plugins/security_solution/public/detections/hooks/use_rule_from_timeline.tsx
*
x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/analyze_graph.tsx
*
x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.tsx
*
x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/session_view.tsx
*
x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_threat_intelligence_details.ts
*
x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/session_view/tabs/alerts_tab.tsx
*
x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts
*
x-pack/solutions/security/plugins/security_solution/public/flyout/network_details/components/network_details.tsx
*
x-pack/solutions/security/plugins/security_solution/public/notes/components/open_flyout_button.tsx
*
x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx
*
x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx
*
x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx
*
x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx
*
x-pack/solutions/security/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/sourcerer_selection.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/alerts_sourcerer.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/index.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/misc.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/sourcerer_integration.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/timeline_sourcerer.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_pick_index_patterns.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/hooks.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/readme.md
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/sourcerer_paths.ts
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/use_init_sourcerer.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/use_signal_helpers.tsx
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/actions.ts
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/helpers.test.ts
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/helpers.ts
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/model.ts
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/readme.md
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/reducer.ts
*
x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/selectors.ts
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/more_container/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/index.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/header/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_update_timeline.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/kpi_container.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/eql/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/header/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/events_count.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/containers/use_timeline_data_filters.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/hooks/use_create_timeline.test.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/hooks/use_create_timeline.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/pages/timelines_page.tsx
*
x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_save.ts

</details>

### Checklist

- [x] [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

#232815
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch 4 times, most recently from d8911d6 to b4102c7 Compare November 17, 2025 16:43
Copy link
Copy Markdown
Contributor

@vitaliidm vitaliidm left a comment

Choose a reason for hiding this comment

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

Detection Engine area LGTM

Copy link
Copy Markdown
Contributor

@hop-dev hop-dev left a comment

Choose a reason for hiding this comment

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

Tested Entity Analytics screens all working fine 👍

Copy link
Copy Markdown
Contributor

@animehart animehart left a comment

Choose a reason for hiding this comment

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

Contextual Security area (K8S Dashboard) LGTM, tested locally

Copy link
Copy Markdown
Contributor

@NicholasPeretti NicholasPeretti left a comment

Choose a reason for hiding this comment

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

Great effort! 🚀

Thank you for this clean-up! It's really nice to see so much code disappear ☺️

I've left a few comments with some NITs but no blockers — up to you if you want address them ☺️

@NicholasPeretti
Copy link
Copy Markdown
Contributor

Great effort! 🚀

Thank you for this clean-up! It's really nice to see so much code disappear ☺️

I've left a few comments with some NITs but no blockers — up to you if you want address them ☺️

Ah, I just realised that my VSCode github integration didn't save the comments... great... 😡
Well don't worry, it was nothing big anyways 😄

Copy link
Copy Markdown
Contributor

@andrew-goldstein andrew-goldstein left a comment

Choose a reason for hiding this comment

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

Thanks @PhilippeOberti for removing this code throughout the solution!
Local desk testing of the files owned by elastic/security-generative-ai looked good, apart from one error here, though the changes to that file itself look OK.
LGTM 🚀

@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from 03b2385 to ce33aa4 Compare December 12, 2025 22:55
Copy link
Copy Markdown
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

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

@PhilippeOberti It's nice to see a PR removing a lot of lines 😄

I've tested the PR locally to make sure there are no issues. The testing went good.

@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch 3 times, most recently from c44bb71 to 42c111a Compare December 23, 2025 17:36
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch 2 times, most recently from cdb09da to f16f37d Compare January 3, 2026 17:39
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch 2 times, most recently from 1430fea to b780166 Compare January 16, 2026 21:25
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from b780166 to 26e7c1b Compare January 23, 2026 15:42
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from 26e7c1b to 93e6f19 Compare January 30, 2026 22:02
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from 93e6f19 to 4d639d9 Compare February 6, 2026 23:23
@PhilippeOberti PhilippeOberti force-pushed the remove-newDataViewPickerEnabled-ff branch from 4d639d9 to ac8ba3e Compare February 17, 2026 17:17
const { dataView: experimentalDataView } = useDataView(PageScope.alerts);

const sourcererDataView = newDataViewPickerEnabled ? experimentalDataView : oldSourcererDataView;
const { dataView } = useDataView(PageScope.alerts);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Low risk_score_management/risk_score_preview_section.tsx:172

RiskEnginePreview destructures only dataView from useDataView(PageScope.alerts) and ignores the status return value. When the dataView is still loading, dataView contains INITIAL_DV with a falsy title, so useRiskScorePreview receives an undefined data_view_id, disables its query, and isLoading becomes false. The component then renders the normal UI with empty data and no loading indicator, misleading users into thinking there are no results while the dataView is still being fetched. Consider checking status === 'ready' before rendering content that depends on dataView, similar to the pattern used in GraphVisualization.

Also found in 1 other location(s)

x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/events_count.tsx:97

The call to dataView.getRuntimeMappings() on line 97 does not use optional chaining, unlike other dataView accesses in this component (e.g., line 94 uses dataView?.id). Before useDataView has loaded (when status is &#39;pristine&#39; or &#39;loading&#39;), dataView is the initial placeholder value INITIAL_DV. If this placeholder doesn't properly implement getRuntimeMappings(), the component will crash on initial render. The previous code used experimentalDataView?.getRuntimeMappings() ?? {} with both optional chaining and a fallback, which protected against this.

🤖 Copy this AI Prompt to have your agent fix this:
In file x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_management/risk_score_preview_section.tsx around line 172:

`RiskEnginePreview` destructures only `dataView` from `useDataView(PageScope.alerts)` and ignores the `status` return value. When the dataView is still loading, `dataView` contains `INITIAL_DV` with a falsy `title`, so `useRiskScorePreview` receives an undefined `data_view_id`, disables its query, and `isLoading` becomes `false`. The component then renders the normal UI with empty data and no loading indicator, misleading users into thinking there are no results while the dataView is still being fetched. Consider checking `status === 'ready'` before rendering content that depends on `dataView`, similar to the pattern used in `GraphVisualization`.

Evidence trail:
x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_management/risk_score_preview_section.tsx:172 - `const { dataView } = useDataView(PageScope.alerts);` shows only dataView destructured, status ignored

x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_data_view.ts:17-20 - `INITIAL_DV = new DataView({ fieldFormats: {} })` has no title

x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_data_view.ts:42 - `useState<DataView>(INITIAL_DV)` initializes with empty DataView

x-pack/solutions/security/plugins/security_solution/public/data_view_manager/hooks/use_data_view.ts:72-73 - hook returns `{ dataView, status }`

x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_preview_risk_scores.ts:67 - `{ enabled: !!dataViewId }` disables query when dataViewId is falsy

x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_management/risk_score_preview_section.tsx:239 - `isLoading={isLoading}` passed without dataView status check

Also found in 1 other location(s):
- x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/events_count.tsx:97 -- The call to `dataView.getRuntimeMappings()` on line 97 does not use optional chaining, unlike other `dataView` accesses in this component (e.g., line 94 uses `dataView?.id`). Before `useDataView` has loaded (when `status` is `'pristine'` or `'loading'`), `dataView` is the initial placeholder value `INITIAL_DV`. If this placeholder doesn't properly implement `getRuntimeMappings()`, the component will crash on initial render. The previous code used `experimentalDataView?.getRuntimeMappings() ?? {}` with both optional chaining and a fallback, which protected against this.

@elasticmachine
Copy link
Copy Markdown
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #10 / GraphVisualization entity mode passes a rolling 30-day timeRange
  • [job] [logs] Jest Tests #10 / GraphVisualization entity mode passes a rolling 30-day timeRange
  • [job] [logs] Jest Tests #10 / GraphVisualization entity mode passes entityIds with isOrigin: true
  • [job] [logs] Jest Tests #10 / GraphVisualization entity mode passes entityIds with isOrigin: true
  • [job] [logs] Jest Tests #10 / GraphVisualization entity mode renders the wrapper and lazy-loads GraphInvestigation
  • [job] [logs] Jest Tests #10 / GraphVisualization entity mode renders the wrapper and lazy-loads GraphInvestigation
  • [job] [logs] Jest Tests #10 / GraphVisualization event mode passes a timestamp-anchored timeRange
  • [job] [logs] Jest Tests #10 / GraphVisualization event mode passes a timestamp-anchored timeRange
  • [job] [logs] Jest Tests #10 / GraphVisualization event mode passes onOpenEventPreview callback
  • [job] [logs] Jest Tests #10 / GraphVisualization event mode passes onOpenEventPreview callback
  • [job] [logs] Jest Tests #10 / GraphVisualization event mode passes originEventIds derived from eventIds and isAlert
  • [job] [logs] Jest Tests #10 / GraphVisualization event mode passes originEventIds derived from eventIds and isAlert
  • [job] [logs] Jest Tests #10 / GraphVisualization event mode renders the wrapper and lazy-loads GraphInvestigation
  • [job] [logs] Jest Tests #10 / GraphVisualization event mode renders the wrapper and lazy-loads GraphInvestigation
  • [job] [logs] Jest Tests #10 / GraphVisualization onInvestigateInTimeline calls investigateInTimeline with a valid time range
  • [job] [logs] Jest Tests #10 / GraphVisualization onInvestigateInTimeline calls investigateInTimeline with a valid time range
  • [job] [logs] Jest Tests #10 / GraphVisualization onInvestigateInTimeline shows a danger toast when time range cannot be parsed
  • [job] [logs] Jest Tests #10 / GraphVisualization onInvestigateInTimeline shows a danger toast when time range cannot be parsed

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.