libelektra icon indicating copy to clipboard operation
libelektra copied to clipboard

Let plugins know about placement

Open kodebach opened this issue 6 years ago • 9 comments

We recently added the global KeySet that every plugin has access to. We could use this to pass additional information to plugins from kdGet and kdbSet. For example we could add system/elektra/placement to let plugins now, in which placement they are currently being called. This improves plugins that are mounted in multiple get/set placements (such as list), because they would know whether the current call is e.g. pregetstorage or postgetstorage.

This would also make it possible for a plugin to be a resolver and storage plugin simultaneously, which would e.g. be helpful for specload.

kodebach avatar Apr 08 '19 20:04 kodebach

Thank you for adding this proposal! @mpranj and I already discussed it (even how to do it efficiently by simply copying metadata instead of creating new keys for every plugin).

markus2330 avatar Apr 09 '19 08:04 markus2330

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. Thank you for your contributions :sparkling_heart:

stale[bot] avatar May 05 '20 14:05 stale[bot]

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. Thank you for your contributions :sparkling_heart:

stale[bot] avatar May 06 '21 04:05 stale[bot]

As it is only for global plugins, I moved it to 2.0.0.

markus2330 avatar May 06 '21 12:05 markus2330

I actually kept the issue open, because it is implemented as part of #3693. Specifically, the current version of the PR has this function that is used by backend plugins. This is solves the problems the original issue describes.

https://github.com/ElektraInitiative/libelektra/blob/898990819649541dafeca1b74717e4e1ba24e1e1/src/libs/plugin/plugin.c#L175-L179

kodebach avatar May 06 '21 12:05 kodebach

Ahh, ok, then you can link the pull request. I wouldn't see this issue as must-have requirement for #3693, though. If we manage to do it with acceptable performance, however, it would be fine.

markus2330 avatar May 06 '21 12:05 markus2330

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. Thank you for your contributions :sparkling_heart:

stale[bot] avatar Jul 30 '22 22:07 stale[bot]

This issue is still open, because it is unclear whether the current API of elektraPluginGetPhase is the best solution. Maybe this would be better

typedef enum {
 // ...
} ElektraPluginPhase;

ElektraPluginPhase elektraPluginGetPhase (Plugin * plugin);

Then plugins could use a switch instead of repeated if(strcmp(...)).

kodebach avatar Sep 27 '22 18:09 kodebach

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. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar Feb 13 '24 01:02 github-actions[bot]

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. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar Feb 28 '24 01:02 github-actions[bot]