Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Migrate old style queries stored in filters array #38945
Migrate old style queries stored in filters array #38945
Changes from 5 commits
f586cfa
c592e92
0f51773
afccf88
3b40c2a
6f3ab7e
97575f4
147addf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Could these not just be the existing saved object types? (Same question for the other types.ts file under the dashboard directory)
kibana/src/core/server/saved_objects/service/saved_objects_client.ts
Lines 145 to 169 in 260d907
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.
I agree with you these types could all be refactored/improved. It's just not super straightforward. I started going down many typescript rabbit holes with this endeavor (started trying to type all of migrations.js), but they quickly grew out of scope.
For instance, we have
interface SavedObjectDashboard extends SavedObject
. That's actually not the SavedObject here though, that's actually the SavedObjectAttributes (but also with id... so maybe it's actually the saved object after a post processing step). Thisextends SavedObject type
is also different than the raw SavedObject.Another type that gets in the mix is the one before and after the
extractReferences
call. It actually changes the raw saved object type by injecting the panel ids into the panelsJSON and removing the outer references.So I think I'd prefer for this PR and just focus on the migration plus minimal typing support. Ideally we should typescript all of migrations and start a pattern of adding types for each iteration of saved object.