-
Notifications
You must be signed in to change notification settings - Fork 122
Classification of storage plugins #3504
Comments
Thank you, this is a very good idea! I fully agree with the goal but I didn't have a good idea how to do such a classification. In #666 there are some ideas but in the end I needed to drop them all as they over-complicate My original idea was that storage plugins describe their structure via configuration for the
It is not at the top of the README but something like this can be found in the section |
The best idea is probably to either add a new
It's fine for the Limitations section to be at the bottom, as long as there is a visible reference to it at the top. At least for bigger limitations in storage plugins (e.g. if there was a JSON plugin that doesn't understand arrays). Otherwise #3472 will happen all over again... |
Any suggestions for the categories? I think @sanssecours always did a very good job in describing the limitations (also in the beginning), e.g. www.libelektra.org/plugins/mini |
Not really. I am also starting to think that (named) categories may be the wrong approach. Maybe we should define a standard list of features that storage plugins may support and recommend/require a description of supported features in the README. These features could include:
Then we could also determine which of these features are needed for a default storage plugin
Yes, |
Yes, this is along the lines we already tried with What about having a
Yes, this is already in
Maybe also the version of the standard?
This is a huge topic and only formal approaches (like Augeas) have any chance to really do this without exceptions. I think for now following is useful:
This is also a huge topic, including some of the other things mentioned below.
I think that intuitively it is quite clear what is meant by nesting. Of course there are some underlying formats that do not support it but also the ones who do, can always be serialized in a flat way. So it is a feature if we serialize nested (opposed to flat).
Also a huge topic. There is already
😉
The question for me is: is this a limitation or only a missing feature? E.g. in #3472 there were no expectations that metadata is seralized. The other question is: should we separate limitations and features in the classification? I listed what we have now in the top post, to be further edited. |
I also added "type" at the end. If plugins do not have this, they would serialize everything as string and ignore the meta-data @sanssecours any further input? Would you do this classification for your plugins? Is it too elaborate? Any ideas for simplification? (One goal of this issue is for me to simplify #666.) |
A separate I was thinking more a long the lines of a section of questions in the storage plugin tutorial, similar to the checklists in the PR template. These questions should then be answered near the top of the README. Whether it is incorporated into the text:
Or is some sort of checklist that even a newcomer would understand doesn't really matter, IMO. In my mind the main goal was to give a quick idea of what the plugin does to a human user, who can investigate further if something is unclear, and not to give a precise specification for automated use.
Again, I think you interpreted my idea far to formal. I had thought of a very informal description of features. If the description of a plugin says "preserves file structure" most people wouldn't be mad if there is tiny change (hopefully they'd file a bug report). The README could even just say "tries to preserve file structure". Also in some cases, it is actually possible to guarantee file structure is preserved without a lot of formal proofs. A simple example is
Yes, I meant "this plugins can store the metadata associated with keys". How its done or whether it is interpreted or not is irrelevant, as long as
That's exactly the point of this issue. Currently there is no standard set of features and therefore nobody mentions if a feature is missing.
In a formal specification we can only have features. Because a limitation to me, means that the plugin supports part of a feature.
This also not very human-friendly. Just seeing |
The main use case is the test suite. Furthermore, in the longer run But the main feature of such flags is that they would have identical semantics across plugins and thus make plugins comparable for someone searching for the best plugin. (Even when done manually!)
I agree that the rendering of the
In binary formats where everything is fixed it is of course trivial to preserve formatting 😉
I also thought so. E.g. we tried very hard in the hosts plugin to preserve the formatting but e.g. the whitespaces between the aliases are still not preserved. In mini you have similar problems around the =. There are so many sneaky little places that a formal approach simply makes more sense if you really want to completely preserve the formatting. So probably we should simply not make it as goal to preserve whitespace in general but only indentation.
Thank you for stepping forward 💖 As clarification to others: To simply improve the documentation (e.g. better describe limitations) no proposal is needed. Anyone can go ahead, nobody will object. So this discussion here can only be about something we want for all plugins (like a minimum standard). |
Good point. See my new proposal below.
Please don't. I find the solution for manpages absolutely horrible, because it involves committing auto-generated files into the git repository. I can't remember how often I had to revert the manpage files, because new versions where generated that only changed the date.
I see... You have a different understanding of "preserves file structure". I didn't think about whitespace (outside of comments or strings). I was thinking more on a syntactical level than on a byte level. In a sense you could say I meant "preserves the abstract syntax tree". Preserving the file on a byte level would be useful for committing files into git or forms of diffing. For humans editing the file "preserving the AST" would probably be enough most of the time. To sum up this discussion, I think we should add a new In addition, there should be a human-readable description for each of the flags listed in central place (e.g. storage plugin tutorial). This human-readable list can also include additional plugin features that have no automated test-suites and therefore no flags. Both the features with flags an those without should also be described in the prose part of the README, so that new users don't have to look up the definitions of the flags. For current plugins, with unknown feature sets, we could leave the |
I started now documenting all the decisions relevant for 1.0 in #3514. |
Not really. I like the proposal by Klemens (the part below the horizontal ruler), since it allows automatic assignment based on tests.
If the classification is easy and I have time to do it, then sure. |
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. |
I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. |
I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. |
I think we need some classification of storage plugins. At the very least we need to distinguish between "general purpose" (e.g. TOML, quickdump, yamlcpp) and "special purpose" (e.g. hosts, fstab, passwd) plugins. A "general purpose" plugin should be able to store any
KeySet
, while a "special purpose" plugin only needs to storeKeySet
s that originally came from the plugin itself or have a compatible structure.In general, a storage plugin should be able to read all possible files of the underlying format into some sort of
KeySet
and then turn thatKeySet
back into the same file. For "general purpose" plugins, this might be relaxed, if it conflicts with the goal of serialising all possibleKeySet
s. Although such a deviation from the format spec, must be stated clearly near the top of the storage plugin's README.Possible classification:
infos/features/storage
with following tags:The text was updated successfully, but these errors were encountered: