-
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
[uiSettings] upgrade old config on read #24108
Merged
spalger
merged 9 commits into
elastic:master
from
spalger:fix/upgrade-ui-settings-on-get
Oct 20, 2018
Merged
[uiSettings] upgrade old config on read #24108
spalger
merged 9 commits into
elastic:master
from
spalger:fix/upgrade-ui-settings-on-get
Oct 20, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spalger
added
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
release_note:fix
labels
Oct 16, 2018
This comment has been minimized.
This comment has been minimized.
spalger
force-pushed
the
fix/upgrade-ui-settings-on-get
branch
from
October 17, 2018 03:35
7aae593
to
b68a9bf
Compare
This comment has been minimized.
This comment has been minimized.
spalger
force-pushed
the
fix/upgrade-ui-settings-on-get
branch
from
October 17, 2018 04:02
b68a9bf
to
007dc93
Compare
💚 Build Succeeded |
legrego
approved these changes
Oct 18, 2018
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 with optional nit. Great test coverage too ❤️
I focused mostly on the code changes, and I smoke tested locally with and w/o spaces
💚 Build Succeeded |
spalger
pushed a commit
to spalger/kibana
that referenced
this pull request
Oct 22, 2018
* doing config migration during config get if necessary * fixing issue with writing new config when user does not have write privilege * [uiSettings] only log about config upgrade on success * [uiSettings/createOrUpgradeSavedConfig] add onWriteError option * [uiSettings] return the upgradeAttributes if reader is unable to write upgrade * [uiSettings] update route tests to cover upgrade on get * [spaces/integration-tests] add config doc to expected objects * [uiSettings] avoid shadowed variable name
spalger
pushed a commit
that referenced
this pull request
Oct 23, 2018
* doing config migration during config get if necessary * fixing issue with writing new config when user does not have write privilege * [uiSettings] only log about config upgrade on success * [uiSettings/createOrUpgradeSavedConfig] add onWriteError option * [uiSettings] return the upgradeAttributes if reader is unable to write upgrade * [uiSettings] update route tests to cover upgrade on get * [spaces/integration-tests] add config doc to expected objects * [uiSettings] avoid shadowed variable name
6.x/6.5: 437f1e3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
release_note:fix
review
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
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.
Fixes #22541
Introduced by #14164
Kibana's uiSettings are stored in a saved object with an ID based on the version number so that each Kibana version installed has its own config document. When a new version of Kibana is installed it looks for the most recent config document (from a non-snapshot/beta version) and uses it as the basis for its own uiSettings. Before #14164 the config document was being upgraded in the elasticsearch plugin health check, which meant that in nearly every case the old settings would be preserved, but since then settings were only migrated when uiSettings were written.
This PR updates the
uiSettings#get()
method (and therefore the API that exposes it) to attempt a config document upgrade if the config document is not found. This upgrade does the same procedure as we have been doing on write except that it does not fail if the write fails due to either user permissions or the saved object index being read only. In these situations the unwritten config upgrade is returned.todo:
@elastic/kibana-platform now that we have migrations, do we still need to keep a different config document for each Kibana version? We're migrating all document to a new index on each upgrade right? Seems like that should supersede this version-specific-config stuff.
release note:
We've fixed a bug introduced in Kibana 6.1 that prevented "advanced config" settings like default index pattern from being migrated from older Kibana installations until the first advanced config update was made.