Make config id independent of Kibana version #19298
Closed
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.
This PR introduces a
version
field to theconfig
Saved Object. This is used to store the version of Kibana for which that configuration is valid. Previously, this information was stored in theconfig
document's ID.Motivation
Having the Kibana version stored as the document id prevents us from having multiple configuration objects for the same version of Kibana. While this historically hasn't been a limitation, the upcoming Spaces project will need to be able to store a separate config object for each Space users create.
Implementation
The default behavior is very similar to how it currently works: the config id will be the Kibana Version.
The Spaces plugin (or potentially another consumer) can choose to augment the ID by calling
request.setUiSettingsIdSuffix()
. When an ID Suffix is set, the UI Settings Service will append the suffix to the default identifier.While the ID will still contain the Kibana version (for readability), it will no longer be the authoritive source for this information. The new
version
field is instead used to determine this.example:
Default ID:
7.0.0
ID after calling request.setUiSettingsIdSuffix('my-suffix'):
7.0.0:my-suffix
This is a rather naive approach, so I'm more than open to suggestions here.
I also want to make sure the approach we take here can translate easily enough to the new platform.