-
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
Remove id attribute from canvas attributes #30736
Conversation
Jenkins, test this |
💚 Build Succeeded |
Jenkins, test this |
Pinging @elastic/kibana-canvas |
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.
LGTM
💔 Build Failed |
💚 Build Succeeded |
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.
Pulled this down and everything still works the same. I also confirmed that the mapping is updated and that the id property is removed. All of the existing workpad documents also no longer have the id property.
LGTM!
@mikecote actually, one small thing for you to add to this PR. All the sample workpads still have an id property on the workpad, and those need to be removed as well. See the JSON files in x-pack/plugins/canvas/server/sample_data |
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.
Please update the sample data JSON
@@ -4,10 +4,11 @@ | |||
"type": "canvas-workpad", | |||
"updated_at": "2018-10-22T15:19:02.081Z", | |||
"version": 1, | |||
"migrationVersion": {}, | |||
"migrationVersion": { |
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.
Since I don't know what this is used for, I might as well ask... what is this used for?
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 is to indicate to the migrator what version the data is migrated up to. Having {}
indicates that the system needs to run all the canvas-workpad
migrations when creating the record. Having 7.0.0
value here indicates to the migrator that the record is migrated up to version 7.0.0.
In this scenario the migrator won't need to run any migrations since the id
field is already removed.
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, but it allows us to have, for example, an 8.0.0 migration in the future, and it would only run that since it knows it's already on 7.0.0. That's neat, thanks for the explanation!
💔 Build Failed |
💔 Build Failed |
Sorry, you'll need to merge master to get rid of those OOM errors |
💚 Build Succeeded |
* Remove id attribute from canvas attributes * Fix create and update API * Add migration tests * Use constants * Add API tests * Cleanup tests * Apply PR feedback
* Remove id attribute from canvas attributes * Fix create and update API * Add migration tests * Use constants * Add API tests * Cleanup tests * Apply PR feedback
This PR removes the
id
attribute from canvas mappings and uses the rootid
attribute from saved objects (solves canvas portion of #30455). The reason ids need to be removed fromattributes
is to facilitate new import / export feature (development in progress) that may change the ids when conflicts exist. See #27203.