simpleflow icon indicating copy to clipboard operation
simpleflow copied to clipboard

Simpleflow CLI: Some love

Open ybastide opened this issue 1 year ago • 4 comments

Having recently had to use the simpleflow CLI, I felt the need to fix some long-standing issues:

  • filtering on a given period, for a given final status (in addition to the name, tags, etc.)
  • displaying the history
  • forgetting every damn time that the default output format is useless for further processing

So let's:

  • improve workflow.filter
  • add workflow.history
  • add a SIMPLEFLOW_FORMAT environment variable

ybastide avatar Dec 03 '24 18:12 ybastide

Great initative! There are many different things that could be done if you want to spend more time on this:

  • In many subcommands, we need to pass the domain even if the envvar is present. If the domain was passed through a flag rather than a positional arg, we could set its default value to the envvar value.
  • workflow.filter & workflow.list are redundant
  • -h is not accepted as an alias of --help
  • workflow.filter: we can't filter on success / error / terminated / ... (can we?)
  • We're missing the ability to add columns, and sort by a column
  • the json view is not very usable: elements are arrays instead of objects, so we don't know what's what.
  • tags should be exported as objects (key: value) rather than lists (assuming tags always have a = ? )
  • It would feel much more natural to expose subcommands as workflow list rather than workflow.list
  • It would feel more natural to distinguish between pure SWF things (workflow.list et al) and Simpleflow-specific things (such as activity.rerun)
  • For some reason, simpleflow info doesn't list SWF_DOMAIN ?
  • binaries.download is really obscure ?
  • workflow.filter could (should?) accept a much wider variety of time filters (or alternatively, we could embrace that any post-processing that isn't linked to API query should be done with jq)
  • when displaying version number, I think we treat them as floats. workflow.filter displays 3.70 for BLA 3.7.

Of course, this is my christmas list, but you don't have to do any of this, just suggestions :)

ewjoachim avatar Dec 04 '24 13:12 ewjoachim

  • workflow.tasks should show the task id so that we can use task.info

ewjoachim avatar Dec 11 '24 17:12 ewjoachim

I agree 🙂 And I think the best way to do this will be adding a brand-new CLI, reverting to the legacy one to handle the current commands. What's your opinion?

ybastide avatar Dec 13 '24 18:12 ybastide

It makes sense. This way, we don't break existing workflow.

ewjoachim avatar Dec 14 '24 20:12 ewjoachim