cylc / cylc-flow

Cylc: a workflow engine for cycling systems.
https://cylc.github.io
GNU General Public License v3.0
335 stars 94 forks source link

cylc message: three or more outputs cause problems #5883

Open oliver-sanders opened 11 months ago

oliver-sanders commented 11 months ago

In a task script you can do this:

cylc message -- x
cylc message -- y

Or, for efficiency, you could do this:

cylc message -- x y

Which does the same thing with one less call. But for some reason this:

cylc message -- x y z

Does not work:

InputError: Workflow ID not found: x

Yet this usage appears to be supported:

Usage: cylc message [OPTIONS] -- [WORKFLOW] [JOB] [[SEVERITY:]MESSAGE ...]

No one has reported this, so this functionality probably isn't in use or any users of this functionality are still on Cylc 7.

Note, we have to be very careful not to create any breaking changes in the cylc message interface as these calls may be embedded in users scripts/executables where they are hard to change.

wxtim commented 10 months ago

The Python 7 and 8 Docstrings contain the following info:

For backward compatibility, if number of arguments is less than or equal to 2,
the command assumes the classic interface, where all arguments are messages.
Otherwise, the first 2 arguments are assumed to be the suite name and the task
job identifier.

So I think that this is working exactly as intended. It does look peculier if you don't spot this documentation.

@oliver-sanders - would you care to close this issue, or would you like me to generate some solutions warning users/documenting this better?

oliver-sanders commented 10 months ago

Note the command usage:

$ cylc message --help
Usage: cylc message [OPTIONS] -- [WORKFLOW] [JOB] [[SEVERITY:]MESSAGE ...] 
wxtim commented 10 months ago

Usage: cylc message [OPTIONS] -- [WORKFLOW JOB [[SEVERITY:]MESSAGE ...]]] Usage: cylc message [OPTIONS] -- [SEVERITY:]MESSAGE [[SEVERITY:]MESSAGE]

wxtim commented 1 month ago

@oliver-sanders - What is x in this case:

cylc message -- x y z

Because this works for me, but only if there is a workflow called x. Else it will fail, and I would expect it to.