cylc-flow icon indicating copy to clipboard operation
cylc-flow copied to clipboard

remove: update data store after task removal

Open oliver-sanders opened this issue 1 year ago • 5 comments

If multiple flows are present in the graph and a task is cylc remove'd, it is possible that the flow numbers on projected future tasks (aka ghost tasks) may require recomputation.

E.g:

  1. Trigger a task in flow 2 whilst the workflow is paused.
  2. The downstream tasks should appear in the datastore in flow 2.
  3. Remove the task that you triggered.
  4. The downstream tasks will stay in flow 2.
  5. Reload the workflow.
  6. The downstream tasks will go back to flow 1 because the datastore has been rebuilt.

There was some suggestion on https://github.com/cylc/cylc-ui/pull/2016 about not showing flow numbers for future tasks which might provide an alternative workaround.

oliver-sanders avatar Jan 07 '25 10:01 oliver-sanders

There was some suggestion on https://github.com/cylc/cylc-ui/pull/2016 about not showing flow numbers for future tasks which might provide an alternative workaround

Presumably that is much easier, and (IMO) it is sensible. Flow numbers are assigned to future tasks when they are spawned in a flow (and IMO that is maps to the conceptual model, not merely implementation).

hjoliver avatar Jan 07 '25 22:01 hjoliver

The n-window is expanded around active flow(s) so this projection of flows into the future is perfectly valid and could be useful information (e.g. to answer the question why is this task in the workflow). The only thing that can meddle with this is flow-merging which is runtime bound so cannot be predicted in advance. It might also be awkward to omit the flow field as the UI will need to be able to tell the difference between flow=none and flow=undefined for presentation purposes.

I haven't picked a side yet myself, but both have merits.

oliver-sanders avatar Jan 08 '25 11:01 oliver-sanders

flow=none in the GraphQL JSON format is flowNums: '[]', compared to undefined if they would be omitted from the data store

MetRonnie avatar Jan 08 '25 21:01 MetRonnie

The only thing that can meddle with this is flow-merging which is runtime bound so cannot be predicted in advance

And (these also can't be predicted in advance):

  • manual triggering
  • optional branching

It also helps to clearly delineate the future graph from the past: no flow numbers because no flows have traversed the graph here yet.

hjoliver avatar Jan 08 '25 21:01 hjoliver

Linking in https://github.com/cylc/cylc-ui/issues/2179 which covers differentiating n>0 tasks in the GUI.

A suggestion there is to wipe flow numbers for n>0 tasks which would cause them to be displayed the same as removed tasks.

There would be no need for changes to cylc-ui or cylc tui as these both already respect no-flow tasks.

oliver-sanders avatar Jun 11 '25 12:06 oliver-sanders

Closed by https://github.com/cylc/cylc-flow/pull/6852

oliver-sanders avatar Aug 18 '25 13:08 oliver-sanders