-
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
[Threat Hunting Investigations][OpenAPI] Use timeline's generated enums #189410
[Threat Hunting Investigations][OpenAPI] Use timeline's generated enums #189410
Conversation
@@ -717,11 +664,6 @@ export interface SortTimeline { | |||
sortOrder: Direction; | |||
} | |||
|
|||
export interface ExportTimelineNotFoundError { |
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.
This type was duplicated in this file, so I removed one of them
export interface KueryFilterQueryResult { | ||
kind?: Maybe<string>; | ||
expression?: Maybe<string>; | ||
} | ||
|
||
export interface SerializedKueryQueryResult { |
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.
This one I moved around to match the dependency flow of these types
zeek = 'zeek', | ||
} | ||
export const RowRendererCount = Object.keys(RowRendererIdEnum).length; | ||
export const RowRendererValues = Object.values(RowRendererId.Values); |
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.
Object.values(RowRendererId.Values)
was copied in a bunch of places, so I created this shared export
threat_match = 'threat_match', | ||
zeek = 'zeek', | ||
} | ||
export const RowRendererCount = Object.keys(RowRendererIdEnum).length; |
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.
Similar to the previous version, but uses RowRendererIdEnum
now.
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
type: DataProviderType.optional(), | ||
}); | ||
|
||
export type DataProviderResult = z.infer<typeof DataProviderResult>; |
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.
Ah, nice catch here. I'm pretty sure I based the original version of this type here, but that is slightly different from the validation schema. 👌🏾
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.
Looks good, did some click through testing around row renderers and timeline templates and those look good as well. Thanks!
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
Public APIs missing exports
History
To update your PR or re-run it, just comment with: cc @janmonschke |
Summary
Fixes https://github.com/elastic/security-team/issues/10132.
This PR is the first on in a series of PRs to adopt the newly generate OpenAPI types in the timeline server code base. As a first step, we're migrating to the newly generated enums only. This has almost no impact on the schemas and is mostly a one-to-one change.
Despite there being changes in more than 150 files, the review should be pretty straight-forward. The most changes come from the new distinction of enums and the actual type of an enum. Meaning a lot of imports and enum usages needed a simple change.
In some places I found duplicate or unused types and the OpenAPI types still had a couple of minor mistakes.