Review how execution events are fetched
For now, the fetching of execution events is done as so:
- When mounting
WorkflowList
, all execution events are fetched and cached with rest-hooks. - When receiving a new execution event though the socket, this cache is invalidated meaning that all executions events are refetched.
While this worked for a prototype version, this is far from being optimized. For this, it is important to note that events are fetched as an array of lists, each list being associated to a single job:
[
[{job_id: 1, type: start}, ..., {job_id: 1, type: end}],
[{job_id: 2, type: start}, ..., {job_id: 2, type: end}],
...
[{job_id: N, type: start}, ..., {job_id: N, type: end}],
]
WorkflowList
renders a WorkflowItem
per job_id
. WorkflowItem
takes care of parsing the list of job events to display the appropriate info.
Ideally I would like to:
- Fetch all execution events when mounting
WorkflowList
and cache them. - Rerender
WorkflowList
when receiving a new execution event though the socket that has a newjob_id
. This is to create the newWorkflowItem
component associated to the newjob_id
- Rerender only the associated
WorkflowItem
when receiving a new execution event though the socket with an exisitingjob_id
.