debusine workflow start could set parameters using some kind of --key=value syntax
@evilcica pointed out that the interface provided by debusine workflow create (formerly debusine create-workflow) is rather unfriendly: one sets task data parameters via YAML on stdin or in a file passed using --data, which is acceptable for an administrative interface but not so much for something user-facing. They suggested instead having command-line options be parsed as task data keys and their values as task data values.
This seems worth pursuing. There are some problems that we'd need to work out:
- Where do we get the task data models to introspect?
python3-debusineprovides data models for worker tasks, but not for workflows (since those are indebusine.server.workflows.models). We could move them to somewhere client-accessible, but we'd still have the problem that they could be out of sync with the server. It might be better to come up with an API endpoint to provide JSON schemas (v1, v2) to the client, which the client could cache and use to autogenerate options. - We'd need to be careful that keys found via task data model introspection don't clash with options provided by the command itself. This could be via a prefix, or we could just arrange to ban names that would collide with those options (neither
workspacenordatais used at the top level of any task data models at the moment). - Workflow data models tend to avoid much in the way of nesting for other reasons, but there are some instances of it. We'd need to work out how to represent that.
- All parameter values would need to be representable as flat strings. Pydantic already handles most of that, but there are likely some awkward edge cases such as multiple lookups.