Project

Profile

Help

Story #6858

Updated by ipanova@redhat.com almost 4 years ago

GroupProgressReport will be a similar model as ProgressReport. 

 Each group progress report will have a message, code, done, total, and relation to the TaskGroup. 
 Plugin writers will create these objects to show progress    of work that is expected to be completed by the tasks in the group. 

 Tasks that belong to the TaskGroup will update the progress report. All group progress reports needs to be created in advance so a Task can find the appropriate one, by code or message and update it. ot. 
 Tasks will need to handle logic and figure out what exactly they need to update in the group progress report. For example a task in the migration plugin called `complex repo migration` will create a repo version, publication and distribution. That means, the task will update 3 group progress reports. 
 F() assignments will be used to avoid race condition, operations will be performed directly on th database https://docs.djangoproject.com/en/3.0/ref/models/expressions/#f-expressions 

 Question: How do we figure out 'total' per each group report? 

 ===================== 

 Alternative Solution: 
 on the TaskGroup serializer add another field called `progress_report` 
 It will query the db and look for tasks that belong to the group and aggregare the results by task 'code' 

 For example group will have 4 syncing tasks, each task has code 'sync', in the aggregated report there will be total of 4 syncing repos and based on the each tasks status the done will be calculated.

Back