qri-io / qri

you're invited to a data party!
https://qri.io
GNU General Public License v3.0
1.11k stars 66 forks source link

Return initID and workflowID in run events #1887

Closed chriswhong closed 3 years ago

chriswhong commented 3 years ago

On the frontend we have a need to show "live" run statuses in the collection view. At present we don't have an easy way to connect workflow events coming in over websockets to their corresponding dataset in the collection.

Events coming in via websockets currently only include the ID of the current run, so we need to do additional work to determine if they are of interest for displaying in the frontend (right now this means storing the runID in state when the workflow is triggered, and then looking for events associated with that runID to derive the run status)

Events should include workflowID and the initID of the dataset they are associated with, making it really easy to update the collection store (which is keyed by initID) to reflect a running dataset.

ramfox commented 3 years ago

There are now InitIDs in the tf:start and tf:stopped events. Is that enough for coordination, or do they need to be in every transform event?

As for the workflowID, unfortunately until we can save datasets without bodies or structures, not all of the runs that happen will be associated with a workflow id at the time we "save" (only when they are "triggered" by a cron trigger).

Is it possible that InitID is enough to coordinate?

chriswhong commented 3 years ago

I believe InitID on tf:start and tf:stopped should be enough to know whether to show a "running" indicator next to a given row in the collection view.

ramfox commented 3 years ago

Fab!