-
Notifications
You must be signed in to change notification settings - Fork 123
type: make default booleans work #2723
Comments
Just to clarify the issue, it is neither specific to the boolean values, nor to the value AFAIK default values are only resolved via I see 3 solutions here:
IMO the first to are really more of a workaround than a solution (also a lot of work) and the third option is clearly out of scope. So I think the best way forward for now, is to just set the |
Thank you for the clarification. For me the option 1 sounds ok: that plugins (like type) also transform the "default" value in the spec namespace (outside the spec namespace, "default" does not have a meaning anyway). I have doubts that this will have a significant performance impact: In the spec namespace we would simply transform the meta-value of default instead of the value itself (the value is currently never used in the spec namespace). Another way would be that we store defaults simply in the "spec" keys as values. Then:
On the negative side we would:
To mitigate the negative side, we could copy the value from "default" to the value (in spec). It would introduce some additional complexity in the spec plugin, though (which is already complex as you know). |
I think this is the best solution. |
Okay new problem....
|
I did not know about the feature. Where is it implemented?
Yes, but it is not in the spec namespace but a cascading key. And no plugin is executed for cascading keys.
This does not need to be the case like this and actually we already want to introduce further positions for global plugins. postgetstorage/before/once (but before the non-global plugins) should work? (see doc/decisions/global_plugins.md) (@mpranj any status here?) @mpranj I accidentally pushed b07ea95 which reverts "cache: temporary disable from default config". Should I revert it again or will we soon get a fix? |
libelektra/src/plugins/spec/spec.c Lines 761 to 769 in f6b1662
The plugins wouldn't be executed for the spec namespace either, because normally you wouldn't mount your spec mountpoint with e.g. the |
This creates a cascading key, not a spec key.
I think we should start to mount the "type" plugin per default because it implements essential semantics (in particular the booleans). So the big question is if we can fix the problem with the global positions (see also #1499) or do we need to improve the kdbGet logic ( see also #1291) and bring some order in which the different namespaces are executed (first get spec, then the other namespaces). |
I won't have any time today. It might be that the bugs are only related to multiresolver. Maybe we can leave the cache enabled but I can disable it only for the multifile resolver. That I can do today. |
It is best to revert again then (I already did so now). Thank you for the quick response. |
Good idea, but doesn't solve the problem. Mounting the |
Good objection. We could only add it by default to mountpoints outside of spec. Using spec-mount, the type plugin will be there anyway (writing a spec without using "type" would be challenging). I created #2733.
Yes, but we should use this change as opportunity to introduce a "default" namespace. Btw. is the type plugin called for the proc namespace? (If not it would make sense to fix this together.) |
A default namespace would make sense, but would represent quite a big challenge and might conflict with the
That is a good question, I am not sure. I believe it would be called for keys comming from a |
Yes, it is a big change. We could call it "def" or similar.
Would be good to have some tests of command-line options that violate the specs. |
I close this issue for 2.0 and created a new docu issue for now: #3397 |
As written in ElektraInitiative/lcdproc#7
The text was updated successfully, but these errors were encountered: