Project

Profile

Help

Story #6282

Updated by bmbouter almost 2 years ago

A use case for pulp_ansible came up recently whereby tasks need to dispatch subtasks. It would be useful for them to see and filter on `parent_task` and `child_tasks` `child_task` fields in the Task model.

### Deliverables

1. `parent_task` and `child_task` fields added to the [Task model[(https://github.com/pulp/pulpcore/blob/b94abcea602712c7610595078a3d26a2029725e1/pulpcore/app/models/task.py#L310).
2. Having these viewable on the [TaskSerializer](https://github.com/pulp/pulpcore/blob/d00ea1e069af00bae94dfa218fffabc2a9fd4197/pulpcore/app/serializers/task.py#L48)
3. Having them filterable on [TaskFilter](https://github.com/pulp/pulpcore/blob/2a788ad779544856b6db9bad38c7af1419e306fc/pulpcore/app/viewsets/task.py#L29)
4. Have the `enqueue_with_reservation` method automatically set the 'parent/child' relationship.

### Background

We used to have this, so we need to bring it back and add tests for it with this work. Here are some PRs to reference:

* This was what we had setting 'parent' but it's incomplete https://github.com/pulp/pulpcore/pull/569
* When we removed it from the serializers before: https://github.com/pulp/pulpcore/commit/3e3ea72ac2bf0abab82a642a987122660cabc124#diff-012d87c176cc670b2ae1f9b498f8b930

Back