Repository navigation
Give a code to the tasks (process-bundle#91), class name as service id #43
Description
Description
Propagate cleverage/process-bundle#91 (PR cleverage/process-bundle#294) to this bridge: a task is now referenced in the process configurations by its code (task: <code>, cleverage.task tag with a code attribute, or #[AsTask]), and referencing it by its service is deprecated since process-bundle 5.4 (removed in v6.0). The tasks of this bridge have no code yet: once process-bundle 5.4 is released, their users get the deprecation without being able to switch to task:. To do before releasing process-bundle 5.4.
Checked on main @ fe9ded1 (v2.2):
| Task | Current service id (private) | Proposed code |
|---|---|---|
GetTask |
cleverage_cache_process.task.get |
cache_get |
SetTask |
cleverage_cache_process.task.set |
cache_set |
Each task also has a public alias named after its class, the reference used by the documentation and the configurations (service: '@CleverAge\…\…Task').
Proposed fix
Versions of this bridge (latest release v2.2): the deprecations below are introduced in 2.3 and the deprecated code is removed in 3.0.
- Codes: tag each task
{ name: cleverage.task, code: <code> }with the codes above, prefixed by the bridge name (cache_) to avoid collisions with the process-bundle codes (unprefixed) and the other bridges. - Service ids: as in process-bundle, use the class name as service id (definition public, the codes being the short reference), and add the
container.privatetag ({ name: container.private, package: cleverage/cache-process-bundle, version: '2.3' }): fetching the tasks directly from the service container is deprecated since 2.3, they become private in 3.0. - Current ids (
cleverage_cache_process.task.*, released since v1.0.0): they are private and, until process-bundle 5.3, could not be used as a taskservice(ProcessManagerfetched the tasks with$container->get(), which fails on private services); only an application injecting or decorating them by id could use them. Keep them as deprecated aliases of the class names (setDeprecated('cleverage/cache-process-bundle', '2.3', ...): deprecated since 2.3), removed in 3.0. - Requirement:
cleverage/process-bundle^5.4(the release shipping Reference the tasks by a code in the process configurations (task key, #[AsTask]) process-bundle#91; it also fixes the lowest dependencies of this bridge, see CI: test the lowest dependencies process-bundle#274). - Tests: every task has its code (unique, prefixed), the
container.privatetag, the extension tests updated for the new ids. - Documentation: the code on the reference page of each task (
* **Code**:cache_(task: cache_)), all the examples switched fromservice:totask: <code>, README / index.
Requirements
- Documentation updates
- Reference
- Cookbooks
- Changelog
- Unit tests
Breaking changes
None for the documented usages (service: '@<class>' keeps working, deprecated by process-bundle). The cleverage_cache_process.task.* ids and the public access to the tasks are only deprecated (2.3); their removal is for 3.0.
Activity
Merge pull request #44 from cleverage/43