Geo containment alert sparsity handling: preserve active status for non-updated alerts#85364
Merged
kindsun merged 8 commits intoelastic:masterfrom Dec 10, 2020
Conversation
Contributor
|
Pinging @elastic/kibana-gis (Team:Geo) |
thomasneirynck
approved these changes
Dec 9, 2020
Contributor
thomasneirynck
left a comment
There was a problem hiding this comment.
thx for the additions and offline explanations.
For the test coverage, I would actually test that the appropriate calls to scheduleActions are being made for a given alertInstance.
You could do that by creating a new alertInstanceFactory in each test. Something like:
const alerts = []
const alertInstanceFactory = (instance: string) => (
return {
scheduleActions: (alert) => {
alerts.push({instance, alert});
};
});
const newmap = getActiveEntriesAndGenerateAlerts(..., alertInstanceFactory,...);
expect(alerts).toEqual(...);
^. something like that, details tbd ;)
The reason for this is that this method does two things:
- create the new "previous state"
- generate the alerts
We're testing the first, but not the latter.
Otherwise, good to go, imho
Contributor
Author
|
@thomasneirynck To follow up on a few items discussed offline:
Thanks for the feedback! |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededMetrics [docs]Distributable file count
History
To update your PR or re-run it, just comment with: |
This was referenced Dec 10, 2020
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.
Carries through active status for geo containment alerts that don't receive updates. To test, likely requires the faketracks script with the feature omitting capabilities added in this PR.
To test:
trueNote: I would recommend using a boundary dataset with greater shape density than the one shown, otherwise you might find yourself waiting a while before a non-updated feature falls within a shape