-
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
Resolving unused settings bug when plugin is disabled #10246
Conversation
This is definitely something I want to avoid... Do you have any ideas about how this could be solved without removing the unset logic? |
If we could potentially determine the list of disabled plugins, we could concatenate their config prefix with the list of active settings and diff against this. This would require the config's complete step to know about disabled plugins, which isn't ideal. Or when we disabled a plugin, we could overwrite the config schema and values with a simple schema/value that only had 'enabled: false'. We could also try to use the config defaults, and set enabled to false, but that seems like it has the same issue as not removing them. There might be others, but those are the first two that I thought of. |
We could also reintroduce the mutable 'pendingSets' approach to keep track of unused settings. |
I actually like that a lot. It still prevents access to config entries like |
I will make it so! Thanks @spalger |
This reverts commit c829139.
… enabled set to false
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
Backports PR #10246 **Commit 1:** Resolving unused settings bug when plugin is disabled * Original sha: c829139 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-06T14:33:24Z **Commit 2:** Revert "Resolving unused settings bug when plugin is disabled" This reverts commit c829139. * Original sha: 81538f4 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-08T22:16:45Z **Commit 3:** Replacing a disabled plugin's config with a simple schema/config with enabled set to false * Original sha: 7e66762 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-08T22:28:41Z
Backports PR #10246 **Commit 1:** Resolving unused settings bug when plugin is disabled * Original sha: c829139 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-06T14:33:24Z **Commit 2:** Revert "Resolving unused settings bug when plugin is disabled" This reverts commit c829139. * Original sha: 81538f4 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-08T22:16:45Z **Commit 3:** Replacing a disabled plugin's config with a simple schema/config with enabled set to false * Original sha: 7e66762 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-08T22:28:41Z
Backports PR #10246 **Commit 1:** Resolving unused settings bug when plugin is disabled * Original sha: c829139 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-06T14:33:24Z **Commit 2:** Revert "Resolving unused settings bug when plugin is disabled" This reverts commit c829139. * Original sha: 81538f4 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-08T22:16:45Z **Commit 3:** Replacing a disabled plugin's config with a simple schema/config with enabled set to false * Original sha: 7e66762 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-08T22:28:41Z
Backports PR #10246 **Commit 1:** Resolving unused settings bug when plugin is disabled * Original sha: c829139 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-06T14:33:24Z **Commit 2:** Revert "Resolving unused settings bug when plugin is disabled" This reverts commit c829139. * Original sha: 81538f4 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-08T22:16:45Z **Commit 3:** Replacing a disabled plugin's config with a simple schema/config with enabled set to false * Original sha: 7e66762 * Authored by kobelb <brandon.kobel@elastic.co> on 2017-02-08T22:28:41Z
When a plugin is disabled, we were previously removing the plugin's schema and all the settings. This was causing as issue when trying to determine which settings were specified in the .yml but are unused in the following code:
I was struggling to think of a scenario where leaving the settings in the config when a plugin is disabled would cause an issue, because the plugin itself shouldn't be loaded and using these settings. The only thing that I could come up with was if a plugin was disabled, and another plugin was somehow using the settings without checking to see if it was 'enabled' this could potentially cause an issue.