-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add attributes types in SavedObjects migration #64748
Comments
@pgayvallet @rudolf I've found some issues with the typings that exist that actually prevent us from making these changes in migrations like Lens. I've created a typescript sandbox link which shows why this is currently not possible. Here are the issues:
|
@wylieconlon your link to the sandbox is incorrect, it's just pointing to |
Sorry, here is the correct link. |
I forgot to change the The type should be: SavedObjectMigrationMap {
[version: string]: SavedObjectMigrationFn<any, any>;
} Created #65569 |
No longer relevant - closing |
In #63943 we added generic types for
SavedObjectMigrationFn
input and output doc attributes. As these attributes were previously typed asany
, some explicit<any, any>
were added in existing plugins migrations as a temporary measure.Now that
SavedObjectMigrationFn
allows type checking, the existing migrations should leverage it to ensure that migrated docs are correctly typed.The initial PR introduced
<any, any>
changes in the following files:@elastic/kibana-app
src/plugins/vis_type_timeseries/server/saved_objects/tsvb_telemetry.ts
x-pack/plugins/graph/server/saved_objects/migrations.ts
x-pack/plugins/lens/server/migrations.ts
@elastic/kibana-presentation
src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts
src/plugins/dashboard/server/saved_objects/migrate_match_all_query.ts
@elastic/kibana-app-arch
src/plugins/visualizations/server/saved_objects/visualization_migrations.ts
src/plugins/data/server/saved_objects/index_pattern_migrations.ts
src/plugins/data/server/saved_objects/search_migrations.ts
@elastic/kibana-security
x-pack/plugins/spaces/server/saved_objects/migrations/migrate_6x.ts
The text was updated successfully, but these errors were encountered: