-
Notifications
You must be signed in to change notification settings - Fork 123
Get all variants of a plugin with different contract #1006
Comments
Would it be possible to have multiple configurable variables (e.g. |
Yes, it is possible, but none of the current plugins has this issue. If augeas adds some paths it would not matter, because paths do not influence the contract. (Or what do you mean with relpath?) The proposal is basically about extensional vs. intensional. And declarativ vs. imperativ. If we already had a language to describe non-trivial configuration problems and a full toolset to do such things as yielding possible configurations, we clearly would use the specification, unfortunately it is still a work-in-progress (i.e. a moving target). |
The example was meant to be a boolean, sorry if it wasn't clear enough. So if But my concern was more about what happens when there are too many options generated, e.g. three variables à eight options would already yield 512 options, or not? Only because we currently don't have such plugins doesn't mean we shouldn't consider it. I think there are many useful configuration options that could be implemented. |
Augeas only supports relative paths. Plugins which currently use absolute paths, are going to be changed (see #51).
Yes, the concern is valid and for the long term a specification is more powerful and generic. The main consideration of
But let us discuss it tomorrow. My idea is to reduce effort on issues of the configuration problem the plugins have and focus on configuration problems applications have. |
I totally agree with you! The simpler the solution, the better in the end. I also doubt we will get huge problems in near future, but it may be a problem to change such a system later on if it gets necessary. So I just wanted to throw my concerns in. For my purpose, |
Does the decision cover everything needed? |
I think your proposal looks very promising and covers everything we discussed so far. But wouldn't it be better to use an array instead of named keys here? E.g. instead of
use
Or did you have some special use case in mind for it? |
Yes, with arrays the overwrite feature (user defined plugin variants) would not work well, thus the name. I clarified that a bit in 8348e4c. (There are still corner cases open for implementation). The decision does not prohibit arrays though, so if the array entries are stable (e.g. not dependent on file system content) they might be useful. |
Because it is at the moment the last open task for the rest-backend: Am I supposed to implement the decision or are you going to do it? By the way: after reading the decision again, I noticed that the proposed function |
Sorry that I did not have time to answer, I am still at a conference. Could you fix this issue please? Yes, the argument order should be like in |
So you mean changing existing usages of |
Thanks for this consideration! But as @petermax2 Did you have a specific reason for this order of arguments? It sounds more convincing to me to have the relevant data as first argument and the error information as second argument. Another signature I consider is: We should definitely write a decision about genconf/checkconf, there are quite a view design considerations involved which we seemingly already have forgotten. |
Ok, didn't notice that. In this case I think a change is fine.
Absolutely. Error information is also output, whereas I would always put input arguments first in the list.
What exactly do you have in mind here? Btw. I agree with you that checking the configuration in |
No, we may change it as you see fit. |
I had in mind that the PluginDatabase keeps all plugins in an open state (currently it reopens them for every query, which is really expensive) and then the plugin handle can easily passed as first argument. Then plugins like the python plugin can initialize the python interpreter in If you see a way to make this improvement for the PluginDatabase, we should also pass the handle in all functions.
Then we certainly should swap the parameters, even if we do not introduce the plugin handle. |
Thanks to @petermax2 in #559 Elektra plugins got a way to validate their configuration.
What is missing is a way to query/specify every possible configuration of plugin's configuration as needed for #994. For example if you specify lenses for augeas (see #977) augeas supports different configuration file formats.
The PluginDatabase (src/libs/tools/include/plugindatabase.hpp) should be able to list every possible plugin configuration (with different contract). To not hardcode the list of plugins+configs, we need a way to query plugins to tell us about it.
Different proposals:
Specification
Allow to specify plugin configuration with Elektra's types (e.g. enum), then mark configuration parts that will change the contract (e.g. use different configuration file formats when the config is changed).
For example, augeas could specify:
(the list after check/enum would be a directory listing of /usr/share/augeas/lenses/dist)
Query
Add a function similar to
checkconf
(#559), for examplegenconf
, that returns every configuration where the plugin's contract would change.E.g. augeas's
genconf
would simply return a keyset based on /usr/share/augeas/lenses/dist:where
#0
,#1
, .. is an array with every possible configuration with different contracts.The text was updated successfully, but these errors were encountered: