-
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
Add savedObjects mappings API to core #55825
Conversation
Pinging @elastic/kibana-platform (Team:Platform) |
version: kibanaVersion, | ||
savedObjectSchemas: new SavedObjectsSchema(uiExports.savedObjectSchemas), | ||
savedObjectMappings: uiExports.savedObjectMappings, | ||
savedObjectMappings: convertLegacyMappings(uiExports.savedObjectMappings), | ||
savedObjectMigrations: uiExports.savedObjectMigrations, | ||
savedObjectValidations: uiExports.savedObjectValidations, | ||
callCluster: (path, ...args) => _.get(client, path).call(client, ...args), |
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 a missed blocker regarding saved object migration to new platform: ATM the es-archiver
has no way to be informed about mappings defined from NP (and it will be the same when we migrate schemas, migrations and validations).However I don't want to handle it in this PR (and I don't have a solution ATM) Created #55860 to discuss the issue.
pluginId: string; | ||
type: string; | ||
fields?: { |
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'm using a string instead of the OpaquePluginId
here because the only usage of this field is to add details about the plugin name when two plugins are registering the same type, and using the String(pluginOpaqueId) outputs Symbol(myId)
...
|
||
this.mappings = convertLegacyMappings(legacyMappings || []); |
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.
Even if it should never be undefined
, there were some integration tests starting the kibana server where the mappings were undefined. As the uiExport
gathering/reducing code is an unreadable thing, doing this || []
here was the pragmatic solution (and will be deleted post 8.0 anyway)
properties: { | ||
name: { type: 'keyword' }, | ||
}, | ||
type: 'nsAgnosticType', | ||
definition: { |
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.
Internal structure changed, had to adapt the test data to the new structure
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Closing, obsolete due to #55857 |
Summary
Fix #50309
PR does the following:
registerMappings
API tosavedObjects
setup contractmappings
typesChecklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
Dev Docs
Added API to register savedObjects mapping from the new platform