[Bug Report] configurePlugin mutation unloads plugin settings
Describe the bug When using the configurePlugin mutation to update a plugin's settings config, all other plugins have their settings unloaded unless Stash is restarted.
To Reproduce Steps to reproduce the behavior:
- Create two plugins:
test1.yml
name: Test 1
description: Test 1
version: 0.0.0
settings:
a:
displayName: A
type: STRING
test2.yml
name: Test 2
description: Test 2
version: 0.0.0
settings:
b:
displayName: B
type: STRING
-
Load the plugins and give the plugin settings values.
-
Restart stash The bug doesn't reproduce without a restart
-
Execute the following GQL query in the playground:
mutation ConfigurePlugin($plugin_id: ID!, $input: Map!) {
configurePlugin(plugin_id: $plugin_id, input: $input)
}
variables:
{
"plugin_id": "test1",
"input": {
"a": "x"
}
}
- Refresh the plugin settings page and observe that the test2 "B" setting no longer has a value
However, the value is still in the
config.yml. It just seems like Stash won't reload the setting until it's restarted - Run the following GQL query:
query Configuration {
configuration {
plugins
}
}
- See that the test2 plugin with the "B" setting is no longer returned:
{
"data": {
"configuration": {
"plugins": {
"test1": {
"a": "x"
}
}
}
}
}
If you restart stash and rerun the query, the test2 plugin settings will be returned again:
{
"data": {
"configuration": {
"plugins": {
"test1": {
"a": "x"
},
"test2": {
"b": "b"
}
}
}
}
}
Expected behavior configurePlugin shouldn't affect the settings of plugins that aren't the given plugin_id. All plugin settings values should appear in the UI and be returned when querying the Stash configuration for plugins.
Stash Version: (from Settings -> About): v0.25.1 Build hash: bf7cb78d Build time: 2024-03-13 03:30:08
I first noticed the issue on the 0.24.3 build but have confirmed it happening on v0.25.1 as well v0.24.3 Build hash: aeb68a58 Build time: 2024-01-15 00:32:38
Desktop (please complete the following information):
- OS: Win10
- Browser: Brave
- Version [e.g. 22]
Additional context As noted in step 3 of the reproduction steps, a restart is required. If stash isn't restarted, then the other plugin settings are retained as expected and will get returned by the Configuration query