Skip to content

[Security Solution][Sourcerer] Fix timeline filters for DV manager#224834

Merged
lgestc merged 1 commit intoelastic:mainfrom
lgestc:fix_timeline_filters
Jun 24, 2025
Merged

[Security Solution][Sourcerer] Fix timeline filters for DV manager#224834
lgestc merged 1 commit intoelastic:mainfrom
lgestc:fix_timeline_filters

Conversation

@lgestc
Copy link
Contributor

@lgestc lgestc commented Jun 23, 2025

Summary

Filters we applied but no listed in the timeline, again - some mismatch in how the data view object was passed around.

Testing

Set the feature flag:

xpack.securitySolution.enableExperimental: ['newDataViewPickerEnabled']

Then, adding a filter via cell action should render the correct pill in the top level filters pane.

Checklist

Check the PR satisfies following conditions.

@lgestc lgestc requested a review from a team as a code owner June 23, 2025 10:38
@lgestc lgestc added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Jun 23, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations)

@elasticmachine
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
securitySolution 9.4MB 9.4MB -14.0B

cc @michaelolo24

Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

I actually do not understand what this fixes. I went back and forth between this branch and main and didn't really see any issues in timeline cell actions?


const { dataViewSpec: experimentalDataViewSpec } = useDataViewSpec(SourcererScopeName.timeline);
const { newDataViewPickerEnabled } = useEnableExperimental();
const { sourcererDataView: dataViewSpec } = useSourcererDataView(SourcererScopeName.timeline);
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason for renaming oldSourcererDataViewSpec to dataViewSpec?

Copy link
Contributor

Choose a reason for hiding this comment

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

No longer using the spec, just using the dataView, so it can have it's old name back 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Then why renaming it to dataViewSpec?
Why not renaming it oldDataView to show that it's different from experimentalDataView? 😛

() => (newDataViewPickerEnabled ? experimentalDataViewSpec : oldSourcererDataViewSpec),
[experimentalDataViewSpec, newDataViewPickerEnabled, oldSourcererDataViewSpec]
);
const { dataView: experimentalDataView } = useDataView(SourcererScopeName.timeline);
Copy link
Contributor

Choose a reason for hiding this comment

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

here also, any reason for renaming experimentalDataViewSpec to experimentalDataView?

Copy link
Contributor

Choose a reason for hiding this comment

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

No longer using the spec, using the dataview directly as the toSpec() can be expensive verses just relying on the dataView cache

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't your PR solving this issue though?

@PhilippeOberti
Copy link
Contributor

I actually do not understand what this fixes. I went back and forth between this branch and main and didn't really see any issues in timeline cell actions?

Ignore that comment, I must have done a full reset and the feature flag was not enabled when I checked out main. I see the issue now and see that this branch fixes it!
Sorry about that :)

Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

Left a couple of comments but none are blockers. Approving as this fixes the issue I saw in main.
Thanks!

@lgestc lgestc merged commit ba6b874 into elastic:main Jun 24, 2025
22 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15844606915

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 24, 2025
…lastic#224834)

## Summary

Filters we applied but no listed in the timeline, again - some mismatch
in how the data view object was passed around.

## Testing

Set the feature flag:

```
xpack.securitySolution.enableExperimental: ['newDataViewPickerEnabled']
```
Then, adding a filter via cell action should render the correct pill in
the top level filters pane.

### Checklist

Check the PR satisfies following conditions.
- [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

(cherry picked from commit ba6b874)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 24, 2025
…ager (#224834) (#225010)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Security Solution][Sourcerer] Fix timeline filters for DV manager
(#224834)](#224834)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Luke
Gmys","email":"11671118+lgestc@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-24T07:52:23Z","message":"[Security
Solution][Sourcerer] Fix timeline filters for DV manager (#224834)\n\n##
Summary\n\nFilters we applied but no listed in the timeline, again -
some mismatch\nin how the data view object was passed around.\n\n##
Testing\n\nSet the feature
flag:\n\n```\nxpack.securitySolution.enableExperimental:
['newDataViewPickerEnabled']\n```\nThen, adding a filter via cell action
should render the correct pill in\nthe top level filters pane.\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"ba6b87418178acaa89ec9e578b45161bc8944552","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting:Investigations","backport:version","v9.1.0","v8.19.0"],"title":"[Security
Solution][Sourcerer] Fix timeline filters for DV
manager","number":224834,"url":"https://github.com/elastic/kibana/pull/224834","mergeCommit":{"message":"[Security
Solution][Sourcerer] Fix timeline filters for DV manager (#224834)\n\n##
Summary\n\nFilters we applied but no listed in the timeline, again -
some mismatch\nin how the data view object was passed around.\n\n##
Testing\n\nSet the feature
flag:\n\n```\nxpack.securitySolution.enableExperimental:
['newDataViewPickerEnabled']\n```\nThen, adding a filter via cell action
should render the correct pill in\nthe top level filters pane.\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"ba6b87418178acaa89ec9e578b45161bc8944552"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224834","number":224834,"mergeCommit":{"message":"[Security
Solution][Sourcerer] Fix timeline filters for DV manager (#224834)\n\n##
Summary\n\nFilters we applied but no listed in the timeline, again -
some mismatch\nin how the data view object was passed around.\n\n##
Testing\n\nSet the feature
flag:\n\n```\nxpack.securitySolution.enableExperimental:
['newDataViewPickerEnabled']\n```\nThen, adding a filter via cell action
should render the correct pill in\nthe top level filters pane.\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"ba6b87418178acaa89ec9e578b45161bc8944552"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Luke Gmys <11671118+lgestc@users.noreply.github.com>
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request Jun 25, 2025
…lastic#224834)

## Summary

Filters we applied but no listed in the timeline, again - some mismatch
in how the data view object was passed around.

## Testing

Set the feature flag:

```
xpack.securitySolution.enableExperimental: ['newDataViewPickerEnabled']
```
Then, adding a filter via cell action should render the correct pill in
the top level filters pane.


### Checklist

Check the PR satisfies following conditions. 
- [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants