stash icon indicating copy to clipboard operation
stash copied to clipboard

[Bug Report] configurePlugin mutation unloads plugin settings

Open 7dJx1qP opened this issue 2 years ago • 0 comments

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:

  1. 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
  1. Load the plugins and give the plugin settings values. image

  2. Restart stash The bug doesn't reproduce without a restart

  3. 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"
  }
}
  1. Refresh the plugin settings page and observe that the test2 "B" setting no longer has a value image However, the value is still in the config.yml. It just seems like Stash won't reload the setting until it's restarted image
  2. Run the following GQL query:
query Configuration {
                        configuration {
                          plugins
                        }
                      }
  1. 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

7dJx1qP avatar Apr 02 '24 15:04 7dJx1qP