feat: allow multiple local plugins #1980
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 allows for multiple local plugins to be loaded.
Description
The plugins are usually loaded by their name and added to an object, with their name as key. Local plugins do not have a name so they were previously saved as 'local' in the same object. If you loaded multiple local plugins the value was overwritten.
This PR saves all local plugins on a unique key. They are called
local-0
,local-1
, etc.Motivation and Context
First of all you can have multiple local plugins. This means that you can export and import them without having to merge them. This also means that you can include multiple shareable plugins that include local plugins, without them overwriting each other.
Usage examples
Self-explanatory.
How Has This Been Tested?
I have added a test for multiple plugins, and they are correctly loaded.
I have not tested how it works when you include multiple shared configurations with plugins or a mix of local plugins in your config and from a shared config. This is because currently, the master branch does not support plugins from shared configs in any way. When that is fixed we can add tests for this.
Types of changes
Checklist: