-
Notifications
You must be signed in to change notification settings - Fork 123
Decisions #3549
Conversation
It should be clear from my comments, which decision still need work IMO. But just in case:
|
doc/decisions/ensure.md
Outdated
`elektraNotificationOpen` needs to be removed and instead we need a new API: | ||
|
||
```c | ||
KeySet * contract = ksNew (0, KS_END); | ||
elektraNotificationGetContract (contract); | ||
KDB * kdb = kdbOpen (key, contract); // contract contains notification config | ||
elektraIoSetBinding (kdb, binding); | ||
``` | ||
|
||
Similar contract getters need to be introduced for other functionality, like gopts: | ||
|
||
```c | ||
KeySet * contract = ksNew (0, KS_END); | ||
elektraGOptsGetContract (contract, argc, argv, environ); | ||
KDB * kdb = kdbOpen (key, contract); | ||
``` | ||
|
||
The high-level API can make this more pretty, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure this is the best possible API, but yes something like this is what I thought of.
The proposal is a bit inconsistent. AFAICT elektraIoSetBinding
is a separate function to avoid having a Key
whose value is a ElektraIoInterface *
. But then there is elektraGOptsGetContract
which needs to store char **
, which has the same problems.
So either, both cases use a separate setter function called after kdbOpen
that directly manipulates the relevant Plugin
struct, or they both just use a *GetContract
function that creates binary keys.
Personally, I think a separate getter makes more sense. The whole point of having a contract
KeySet is that the API/ABI doesn't have to change if additional config options are added. A elektraNotificationGetContract
function would have to change, if e.g. notifications get some new config option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure this is the best possible API,
Also not yet sure, here is an improvement: 581c6bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the new API looks a lot better. However, I would prefer, if either kdbOpen
took ownership of the KeySet * contract
or at least copied what is needed, so that ksDel (contract)
can be called right after kdbOpen
. Otherwise there is too much potential for memory leaks IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, of course it will copy, so ksDel afterwards is safe: a6429dc
Taking ownership can easily lead to misunderstandings, especially because KeySet is different to Key (which is ref-counted, so the ownership can be shared even if "taken" like in ksNew). In elektraPluginOpen we have such an API and I actually think we should change it there (if we decide to make this API public).
I like were the decision on metadata is going, but I think we might need another more in depth discussion and should maybe move it to a separate PR. What I got from your proposal are these key points ("store" means "write into storage file"):
AFAICT it we are basically going in the direction of separating the two uses of metadata: specification, and inferred meta-information. IMO the best solution would be, if plugins like The next best thing would be, if the { "mykey": 4 } produces a key Assuming that applications don't need direct access to the [1] |
9105333
to
bd21584
Compare
098ecd2
to
581c6bf
Compare
Ok, as you saw I reworked it completely. 581c6bf
Yes, true, I renamed the sections so that it is clear that there is still a lot to be decided about the API. 788d273 |
834d890
to
4e894a3
Compare
(showing up on my system)
Co-authored-by: kodebach <23529132+kodebach@users.noreply.github.com>
Co-authored-by: kodebach <23529132+kodebach@users.noreply.github.com>
Co-authored-by: kodebach <23529132+kodebach@users.noreply.github.com>
Co-authored-by: kodebach <23529132+kodebach@users.noreply.github.com>
Thank you for updating the decisions from the meeting! |
Thank you for all your great and valuable input at the meeting 💖 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, I only found some typos.
Co-authored-by: Mihael Pranjić <mpranj@limun.org>
Thank you so much! |
Finally, the outcomes from the last meeting. Not perfect yet but we can continue our discussions.
Basics
These points need to be fulfilled for every PR:
(added as entry in
doc/news/_preparation_next_release.md
whichcontains
_(my name)_
)Please always add something to the release notes.
(first line should have
module: short statement
syntax)close #X
, are in the commit messages.If you have any troubles fulfilling these criteria, please write
about the trouble as comment in the PR. We will help you.
But we cannot accept PRs that do not fulfill the basics.
Checklist
Check relevant points but please do not remove entries.
For docu fixes, spell checking, and similar none of these points below
need to be checked.
(not in the PR description)
Review
Reviewers will usually check the following:
Labels
If you are already Elektra developer:
say that everything is ready to be merged.