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

cylc message: three or more outputs cause problems

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

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.

oliver-sanders avatar Dec 15 '23 16:12 oliver-sanders

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?

wxtim avatar Jan 11 '24 10:01 wxtim

Note the command usage:

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

oliver-sanders avatar Jan 11 '24 10:01 oliver-sanders

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

wxtim avatar Jan 11 '24 10:01 wxtim