Details
-
Suggestion
-
Resolution: Done
Description
When <repository-hook/> modules are used any settings they create, as well as whether they're enabled/disabled, is attached to their "complete key", which is formed by taking the key for the plugin they're declared in and combining it with the key attribute set on the <repository-hook/> descriptor. If the plugin key or the module key ever change, all settings for the hook are "lost". This is both unexpected and undesirable.
Worse, with the current RepositoryHookService API, there is almost no possible way to recover from this situation. RepositoryHook details can only be retrieved for hooks whose modules are still installed, and their Settings can only be retrieved repository-by-repository. Trying to build an upgrade task that does that per-repository copy is slow and error-prone.
RepositoryHookService should provide a migration API, to allow app developers to provide their old and new "complete keys" and automatically migrate all settings between the keys in a single shot. This can be done efficiently in the database, where it can't be with the existing public API.