-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SIEM][Detection Engine] Fixes TypeScript types and adds format to time range query #62714
Conversation
alertThrottle: string | null; | ||
} => ({ | ||
ruleThrottle: throttle ?? 'no_actions', | ||
alertThrottle: ['no_actions', 'rule'].includes(throttle ?? 'no_actions') ? null : throttle, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patrykkopycinski look here to make sure this is correct. After I made it so the tests were able to pass down null
by changing the non-null type assertions it looked like everywhere the null
could be sent down and I had to change all of these to accept null.
This made it to where I had to change this function slightly to work with both null
and undefined
x-pack/legacy/plugins/siem/server/lib/detection_engine/types.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @FrankHassanabad 💪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the extra work on typings and the refactors. LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment about snake case/camel case as I think we're inconsistent here. Not a blocker, but we should follow up after the next BC.
...gacy/plugins/siem/public/pages/detection_engine/rules/components/step_rule_actions/index.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/helpers.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments on variable casing. It's confusing!
...acy/plugins/siem/public/pages/detection_engine/rules/components/step_rule_actions/schema.tsx
Outdated
Show resolved
Hide resolved
callCluster: services.callCluster, | ||
}); | ||
|
||
const resultsLink = getNotificationResultsLink({ | ||
from: fromInMs, | ||
to: toInMs, | ||
id: ruleAlertSavedObject.id, | ||
kibanaSiemAppUrl: ruleAlertParams.meta?.kibanaSiemAppUrl as string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RuleAlertParams
were all camelcase, previously (falsePositives
, maxSignals
, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but meta is something coming from the ui and the backend doesn't have much of an opinion about it other than to try to keep it snake case.
I am fine for now keeping this one inconsistency but over REST having snake case consistency. The others are transformed to snake case at least exiting. It might make things easier to use more snake case in spots like alerting params?
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Summary
Checklist