<div dir="ltr">TL;DR<div><br></div><div><div><div class="m_-3270273825973729823gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>In Pulp 3 do we want to return a single task or list of tasks for endpoints like sync, publish, etc?</div><div><br></div><div># Background</div><div><br></div><div><div style="font-size:12.800000190734863px">Currently all task responses are lists of tasks in Pulp 3. For example, if you call the sync endpoint, you get a list of one task back that tracks the progress of the sync. Allowing a list of tasks allows Pulp to return multiple user facing tasks with a single operation. Currently, all endpoints that produce tasks currently will produce exactly 1 task. So why add a list now if it only contains 1 item? With Pulp's REST API being semver governed from the 3.0 release, we couldn't ever return multiple tasks in Pulp < 4.0 because changing a single item to a list would be backwards incompatible in the REST API.</div></div><div><br></div><div># Going Forward</div><div><br></div><div><span style="font-size:12.800000190734863px">Returning a list of tasks creates a somewhat suboptimal user experience where users have to query multiple endpoints to know if their job is done. Maybe we should do this differently. Perhaps anytime an operation needs multiple tasks, we should have a single task tracking them because that is a better user experience. </span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px">This is effectively the "group tasks" concept we had in Pulp2 that we have left out of Pulp3 currently. The user would monitor a single task which shows counts of 'done' and 'not done' or something like that. With counts though, you wouldn't know which of the tasks are done and not done; maybe in addition to, or as a replacement of, 'spawned_tasks', the viewset could be split into 'finished_spawned_tasks' or 'unfinished_spawned_tasks'. I don't like these names, but you get the idea.</span><br></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px">Always returning a single task could paint us into a corner or it could force us to provide a better user experience. Thoughts?</span></div><div><br></div><div>David<br></div></div></div></div></div></div>
</div></div>