Link tasks to their restarts
https://redmine.teklia.com/issues/6515
Follow-up of #1709 (closed): to make it easier to keep track of which task was a restart of another, similarly to how GitLab marks retries in CI jobs, we need to link those tasks.
Please add a new Task.original_task
nullable foreign key, and make RestartTask
set the original_task
to the task that just got restarted.
This may require some considerations on corpus deletion, process deletion, etc., so please at least update the unit tests on those to add a task that got restarted by another task, so we can make sure we aren't getting any IntegrityError
.
The task serializers will need to be updated to expose the new original_task_id
, so that it can be used by the frontend. You do not need to use a child serializer here, the ID is enough. Since both tasks are in the same process, the frontend will already have retrieved the original task among all the tasks of the process.