Add multiple index support to saved objects#35747
Add multiple index support to saved objects#35747mattapperson merged 15 commits intoelastic:masterfrom
Conversation
…ations on all indexes
💔 Build Failed |
💔 Build Failed |
|
I don't see any issues with the approach in general preventing Spaces/Security from functioning properly. |
💔 Build Failed |
💚 Build Succeeded |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
|
Jenkins test this |
💚 Build Succeeded |
mikecote
left a comment
There was a problem hiding this comment.
Few comments but looking forward to the feature! 👍
|
@mattapperson Can you flesh out the details in this PR description about how this is to be used from a plugin's perspective? Sample code would be great. |
|
@epixa will do |
💔 Build Failed |
💔 Build Failed |
|
Jenkins test this |
💔 Build Failed |
💚 Build Succeeded |
|
|
||
| const esOptions = { | ||
| index: this._index, | ||
| index: this._getIndexForType(type), |
There was a problem hiding this comment.
type could be a string | string[] but you're only handling the string case.
| } | ||
| } | ||
|
|
||
| async _readFromCluster(method, params) { |
There was a problem hiding this comment.
This seems to be unused, is the idea to take advantage of it in future work?
| return ( | ||
| (this._schema.definition && | ||
| this._schema.definition[type] && | ||
| this._schema.definition[type].indexPattern) || |
There was a problem hiding this comment.
Although JS will let you get away with it, you're accessing private properties of a Typescript class
|
Because of the interdependence of these PR's I'll address this in #36829 |
Address post-merge review comments on elastic#35747
* Fixed jest race condition. Map queries to the correct index. Run migrations on all indexes * fix linting * fix linting * build index map after plugin initalization * wait for ES to get config I guess * add more index mapping * update some tests * fix one more test * Add multi-index support to deleteByNamespace * remove uneeded comments * update types * fix yarn lock and add empty object
* Fixed jest race condition. Map queries to the correct index. Run migrations on all indexes * fix linting * fix linting * build index map after plugin initalization * wait for ES to get config I guess * add more index mapping * update some tests * fix one more test * Add multi-index support to deleteByNamespace * remove uneeded comments * update types * fix yarn lock and add empty object
|
@mattapperson, can you add tagging for the versions which this was added in? Also, there are TODO's which were not checked off regarding testing. Was that testing completed? |
|
Yes testing was completed, I was lazy in checking the boxes. |
💔 Build Failed |
This PR is a WIP from a code standpoint, but am requesting a functional review. Items still needed:
Summary
This is an initial pass at adding support to Saved Objects to allow document schema definitions to define a custom index name for something other
.kibanaNote: schema prop name of indexPattern is used even though a "pattern" is not yet supported as a future/followup PR should add support for a pattern
API
To make use of this new feature all you must do is define the index in the
savedObjectSchemasvalues of your plugins init like so:Testing
This PR is small, but affects a LOT of surface area so I am breaking down areas that need special attention. (please comment if I missed something)
While much if not all of this is covered by automated testing, the fact that SOs is critical to Kibana function I think demands a little extra special attention