Skip to content

[Entity Store] Do not require full entity definition to execute enrich policy (remove magic number)#195961

Merged
hop-dev merged 2 commits intoelastic:mainfrom
hop-dev:remove-magic-number
Oct 14, 2024
Merged

[Entity Store] Do not require full entity definition to execute enrich policy (remove magic number)#195961
hop-dev merged 2 commits intoelastic:mainfrom
hop-dev:remove-magic-number

Conversation

@hop-dev
Copy link
Copy Markdown
Contributor

@hop-dev hop-dev commented Oct 11, 2024

Summary

@machadoum pointed out some weirdness in the task code where we have to provide the fieldHistoryLength, I have changed the executeEnrichPolicy method signature to only require the 3 fields it needs, one of those fields is the entity definition version, I have added a method to just get the version of an entity defintion so the task can provide it.

@hop-dev hop-dev added release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. backport:prev-minor Team:Entity Analytics Security Entity Analytics Team labels Oct 11, 2024
@hop-dev hop-dev self-assigned this Oct 11, 2024
@hop-dev hop-dev requested a review from a team as a code owner October 11, 2024 16:05
@hop-dev hop-dev requested a review from machadoum October 11, 2024 16:05
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

const unitedDefinition = getUnitedEntityDefinition({
namespace,
entityType,
fieldHistoryLength: 10, // we are not using this value so it can be anything
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

getting rid of this magic number is the motivation of the changes

@hop-dev hop-dev changed the title do not require full entity definition for executing enrich policy [Entity Store] Do not require full entity definition to execute enrich policy (remove magic number) Oct 11, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @hop-dev

@hop-dev hop-dev enabled auto-merge (squash) October 11, 2024 18:26
Copy link
Copy Markdown
Member

@machadoum machadoum left a comment

Choose a reason for hiding this comment

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

LGTM!

@hop-dev hop-dev merged commit 0c5a94b into elastic:main Oct 14, 2024
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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 Oct 14, 2024
… enrich policy (remove magic number) (#195961) (#196094)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Entity Store] Do not require full entity definition to execute
enrich policy (remove magic number)
(#195961)](#195961)

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

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

<!--BACKPORT [{"author":{"name":"Mark
Hopkin","email":"mark.hopkin@elastic.co"},"sourceCommit":{"committedDate":"2024-10-14T10:32:45Z","message":"[Entity
Store] Do not require full entity definition to execute enrich policy
(remove magic number)
(#195961)","sha":"0c5a94bb5738db01a08285dfdb589593bc81988e","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:
SecuritySolution","backport:prev-minor","Team:Entity
Analytics"],"title":"[Entity Store] Do not require full entity
definition to execute enrich policy (remove magic
number)","number":195961,"url":"https://github.com/elastic/kibana/pull/195961","mergeCommit":{"message":"[Entity
Store] Do not require full entity definition to execute enrich policy
(remove magic number)
(#195961)","sha":"0c5a94bb5738db01a08285dfdb589593bc81988e"}},"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/195961","number":195961,"mergeCommit":{"message":"[Entity
Store] Do not require full entity definition to execute enrich policy
(remove magic number)
(#195961)","sha":"0c5a94bb5738db01a08285dfdb589593bc81988e"}}]}]
BACKPORT-->

Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants