[Automatic migrations] Dashboard v/s Rule Migration generic logic#232526
[Automatic migrations] Dashboard v/s Rule Migration generic logic#232526logeekal merged 37 commits intoelastic:mainfrom
Conversation
...solutions/security/plugins/security_solution/common/siem_migrations/model/common.schema.yaml
Show resolved
Hide resolved
x-pack/solutions/security/plugins/security_solution/common/siem_migrations/resources/types.ts
Outdated
Show resolved
Hide resolved
...ons/security/plugins/security_solution/server/lib/siem_migrations/common/data/dsl_queries.ts
Show resolved
Hide resolved
| } | ||
| export const nullifyMissingProperties = <T extends object = object>( | ||
| params: NullifyMissingProperties<T> | ||
| ): T => { |
There was a problem hiding this comment.
| ): T => { | |
| ): Nullable<T> => { |
| */ | ||
|
|
||
| interface NullifyMissingProperties<T> { | ||
| source?: T; |
There was a problem hiding this comment.
Probably needs some explanation about source and target
| export const SIEM_MIGRATIONS_PATH = '/internal/siem_migrations' as const; | ||
|
|
||
| // TODO: Move `SIEM_RULE_MIGRATIONS_PATH` and composed paths to rules/constants.ts | ||
| export const SIEM_RULE_MIGRATIONS_PATH = `${SIEM_MIGRATIONS_PATH}/rules` as const; |
There was a problem hiding this comment.
Will be done in separate PR. A sub folder of rules/ will be good but will unncessary increases the number of files in this PR.
| import type { SiemMigrationsDataResourcesClient } from '../siem_migrations_data_resources_client'; | ||
| import type { SiemMigrationsDataItemClient } from '../siem_migrations_data_item_client'; | ||
|
|
||
| // Rule migrations data items client |
There was a problem hiding this comment.
Need to remove this.
...ions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/dsl_queries.ts
Outdated
Show resolved
Hide resolved
...ons/security/plugins/security_solution/server/lib/siem_migrations/common/data/dsl_queries.ts
Outdated
Show resolved
Hide resolved
...plugins/security_solution/server/lib/siem_migrations/common/task/util/actions_client_chat.ts
Outdated
Show resolved
Hide resolved
x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/common/types.ts
Outdated
Show resolved
Hide resolved
...olution/server/lib/siem_migrations/dashboards/data/dashboard_migrations_dashboards_client.ts
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,2626 @@ | |||
| /* | |||
There was a problem hiding this comment.
This file was relocated as part of #233112
We are removing x-pack/test directory quite soon.
There was a problem hiding this comment.
Thanks. yes I saw that. At least for this PR , there was no impact since we're not using auto generated client in integration tests.
There was a problem hiding this comment.
Sorry, i just realized that i added it by mistake. Let me remove it.
| /** | ||
| * Utility type for making all properties of an object nullable. | ||
| */ | ||
| export type Nullable<T extends object> = { [K in keyof T]: T[K] | null }; |
There was a problem hiding this comment.
nit: Can we use a different name? Nullable sounds like the opposite of NonNullable, but they are not directly the opposite.
Maybe something like NullableProps?
There was a problem hiding this comment.
I agree with your suggestion but It looks like we had removed its usages and so i have for now removed the type. I will add it in further PRs.
💚 Build Succeeded
Metrics [docs]Async chunks
Saved Objects .kibana field count
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
…astic#232526) ## Summary This PR refactors complete Automatic Migrations current data clients and services for Dashboards and Rules Migrations. Only objective of this PR is share logic between rules and dashboards migrations. ### Impact This PR is intended to keep the functionality exactly the same. ### Code Owners Summary #### elastic/kibana-core * src/platform/packages/shared/kbn-utility-types/index.ts #### elastic/security-threat-hunting-investigations * x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.test.tsx </details> --------- Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…astic#232526) ## Summary This PR refactors complete Automatic Migrations current data clients and services for Dashboards and Rules Migrations. Only objective of this PR is share logic between rules and dashboards migrations. ### Impact This PR is intended to keep the functionality exactly the same. ### Code Owners Summary #### elastic/kibana-core * src/platform/packages/shared/kbn-utility-types/index.ts #### elastic/security-threat-hunting-investigations * x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.test.tsx </details> --------- Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR refactors complete Automatic Migrations current data clients and services for Dashboards and Rules Migrations.
Only objective of this PR is share logic between rules and dashboards migrations.
Impact
This PR is intended to keep the functionality exactly the same.
Code Owners Summary
elastic/kibana-core
elastic/security-threat-hunting-investigations