[Entity Store] Do not require full entity definition to execute enrich policy (remove magic number)#195961
Merged
hop-dev merged 2 commits intoelastic:mainfrom Oct 14, 2024
Merged
Conversation
Contributor
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
hop-dev
commented
Oct 11, 2024
| const unitedDefinition = getUnitedEntityDefinition({ | ||
| namespace, | ||
| entityType, | ||
| fieldHistoryLength: 10, // we are not using this value so it can be anything |
Contributor
Author
There was a problem hiding this comment.
getting rid of this magic number is the motivation of the changes
Contributor
💚 Build Succeeded
Metrics [docs]
cc @hop-dev |
jaredburgettelastic
approved these changes
Oct 14, 2024
Contributor
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11325761700 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Oct 14, 2024
…h policy (remove magic number) (elastic#195961) (cherry picked from commit 0c5a94b)
Contributor
💚 All backports created successfully
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.