Skip to content

[Automatic migrations] Dashboard v/s Rule Migration generic logic#232526

Merged
logeekal merged 37 commits intoelastic:mainfrom
logeekal:automatic_migrations_generic_task
Aug 29, 2025
Merged

[Automatic migrations] Dashboard v/s Rule Migration generic logic#232526
logeekal merged 37 commits intoelastic:mainfrom
logeekal:automatic_migrations_generic_task

Conversation

@logeekal
Copy link
Contributor

@logeekal logeekal commented Aug 21, 2025

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

}
export const nullifyMissingProperties = <T extends object = object>(
params: NullifyMissingProperties<T>
): T => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
): T => {
): Nullable<T> => {

*/

interface NullifyMissingProperties<T> {
source?: T;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs some explanation about source and target

@logeekal logeekal changed the title Automatic migrations generic task [Automatic migrations] Dashboard v/s Rule Migration generic logic Aug 25, 2025
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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@logeekal
Copy link
Contributor Author

@semd Here are the Evaluator changes.

3d91676

@logeekal logeekal added ci:cloud-deploy Create or update a Cloud deployment ci:cloud-persist-deployment Persist cloud deployment indefinitely and removed ci:project-deploy-security Create a Security Serverless Project ci:project-persist-deployment Persist project deployment indefinitely labels Aug 28, 2025
Copy link
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀🚀🚀

@logeekal logeekal added ci:project-deploy-security Create a Security Serverless Project ci:project-persist-deployment Persist project deployment indefinitely labels Aug 29, 2025
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner August 29, 2025 11:51
@@ -0,0 +1,2626 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was relocated as part of #233112

We are removing x-pack/test directory quite soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, i just realized that i added it by mistake. Let me remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmlemeshko , I have removed it now.

/**
* Utility type for making all properties of an object nullable.
*/
export type Nullable<T extends object> = { [K in keyof T]: T[K] | null };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@logeekal logeekal enabled auto-merge (squash) August 29, 2025 14:41
@elasticmachine
Copy link
Contributor

elasticmachine commented Aug 29, 2025

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 10.2MB 10.2MB -839.0B

Saved Objects .kibana field count

Every field in each saved object type adds overhead to Elasticsearch. Kibana needs to keep the total field count below Elasticsearch's default limit of 1000 fields. Only specify field mappings for the fields you wish to search on or query. See https://www.elastic.co/guide/en/kibana/master/saved-objects-service.html#_mappings

id before after diff
_data_stream_timestamp 1 - -1
_doc_count 1 - -1
_ignored_source 1 - -1
_index_mode 1 - -1
_inference_fields 1 - -1
_tier 1 - -1
apm-custom-dashboards 5 - -5
apm-server-schema 2 - -2
apm-service-group 5 - -5
application_usage_daily 2 - -2
config 2 - -2
config-global 2 - -2
coreMigrationVersion 1 - -1
created_at 1 - -1
created_by 1 - -1
entity-definition 9 - -9
entity-discovery-api-key 2 - -2
event_loop_delays_daily 2 - -2
favorites 4 - -4
file 11 - -11
file-upload-usage-collection-telemetry 3 - -3
fileShare 5 - -5
infra-custom-dashboards 4 - -4
infrastructure-monitoring-log-view 2 - -2
intercept_trigger_record 5 - -5
legacy-url-alias 7 - -7
managed 1 - -1
ml-job 6 - -6
ml-module 13 - -13
ml-trained-model 7 - -7
monitoring-telemetry 2 - -2
namespace 1 - -1
namespaces 1 - -1
observability-onboarding-state 2 - -2
originId 1 - -1
product-doc-install-status 7 - -7
references 4 - -4
sample-data-telemetry 3 - -3
security-ai-prompt 8 - -8
slo 11 - -11
space 5 - -5
synthetics-monitor 34 - -34
synthetics-monitor-multi-space 34 - -34
tag 4 - -4
type 1 - -1
typeMigrationVersion 1 - -1
ui-metric 2 - -2
updated_at 1 - -1
updated_by 1 - -1
upgrade-assistant-ml-upgrade-operation 3 - -3
upgrade-assistant-reindex-operation 3 - -3
uptime-synthetics-api-key 2 - -2
url 5 - -5
usage-counters 2 - -2
total -246
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 679 681 +2

Total ESLint disabled count

id before after diff
securitySolution 779 781 +2

History

@logeekal logeekal merged commit 0e2a3bd into elastic:main Aug 29, 2025
12 checks passed
ymao1 pushed a commit to ymao1/kibana that referenced this pull request Aug 29, 2025
…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>
jkelas pushed a commit to jkelas/kibana that referenced this pull request Sep 2, 2025
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting ci:cloud-deploy Create or update a Cloud deployment ci:cloud-persist-deployment Persist cloud deployment indefinitely ci:project-deploy-security Create a Security Serverless Project ci:project-persist-deployment Persist project deployment indefinitely release_note:skip Skip the PR/issue when compiling release notes v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants