Repository navigation
Give a code to the tasks (process-bundle#91), class name as service id #52
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 @ 2559e44 (v3.2):
| Task | Current service id (private) | Proposed code |
|---|---|---|
RequestTask |
cleverage_rest_process.task.request |
rest_request |
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 v3.2): the deprecations below are introduced in 3.3 and the deprecated code is removed in 4.0.
- Codes: tag each task
{ name: cleverage.task, code: <code> }with the codes above, prefixed by the bridge name (rest_) 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/rest-process-bundle, version: '3.3' }): fetching the tasks directly from the service container is deprecated since 3.3, they become private in 4.0. - Current ids (
cleverage_rest_process.task.*, released since v2.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/rest-process-bundle', '3.3', ...): deprecated since 3.3), removed in 4.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**:rest_(task: rest_)), 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_rest_process.task.* ids and the public access to the tasks are only deprecated (3.3); their removal is for 4.0.
Activity
Merge pull request #53 from cleverage/52