-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix workflow-state command and xtrigger. #5809
base: master
Are you sure you want to change the base?
Conversation
ab469a6
to
c5ede84
Compare
Note also: #6030 |
0274a3e
to
178c3d1
Compare
113942b
to
697681f
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable; Given the amount on your plate I will start drafting tests for this so that we can ram it through.
I've added the following:hjoliver#50 - It's not a complete set of tests, but I've covered some of this. I'll do more tomorrow. If you want to get them in feel free to merge though.
I ran a workflow on master, stopped it and restarted on your branch - the DB looks like this: Is that OK?
|
Yes, on master the DB stores task messages as "outputs". And in Cylc 7, only custom outputs were stored. We are now to say the trigger name is the "output", not the corresponding task message. For maximum flexibility and back compat we need to store both (trigger name and task message). |
a13b697
to
0a9db30
Compare
$ cylc workflow-state gimli --output 'and my axe'
InputError: Please give a single ID Not an especially clear error message for someone using the old CLI syntax. Also: $ cylc workflow-state gimli/
Traceback (most recent call last):
File "~/.conda/envs/cylc8/bin/cylc", line 8, in <module>
sys.exit(main())
^^^^^^
File "~/github/cylc-flow/cylc/flow/scripts/cylc.py", line 703, in main
execute_cmd(command, *cmd_args)
File "~/github/cylc-flow/cylc/flow/scripts/cylc.py", line 334, in execute_cmd
entry_point.load()(*args)
File "~/github/cylc-flow/cylc/flow/terminal.py", line 282, in wrapper
wrapped_function(*wrapped_args, **wrapped_kwargs)
File "~/github/cylc-flow/cylc/flow/scripts/workflow_state.py", line 307, in main
poller = WorkflowPoller(
^^^^^^^^^^^^^^^
File "~/github/cylc-flow/cylc/flow/scripts/workflow_state.py", line 158, in __init__
tokens = Tokens(self.id_)
^^^^^^^^^^^^^^^^
File "~/github/cylc-flow/cylc/flow/id.py", line 111, in __init__
kwargs = tokenise(args[0], relative)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/github/cylc-flow/cylc/flow/id.py", line 673, in tokenise
raise ValueError(f'Invalid Cylc identifier: {identifier}')
ValueError: Invalid Cylc identifier: gimli/ Lost the stripping of the trailing slash that comes from bash standard autocomplete |
28717e4
to
77c44bd
Compare
77c44bd
to
960fb61
Compare
That's because the option has become a flag, to interpret the task ID selector as an output (trigger) as opposed to a status or a task message. I suppose I could change the names of these flags to |
You mentioned transient statueses in the videoconf today. This currently does not work once the task status is suceeded:
For a Cylc 7 DB we have no way around this other than the user adding But for Cylc 8 DBs we can just query the |
For consistency with previous usage, and with the command name "workflow-state", I've stuck with interpreting standard names ("submitted" etc.) as statuses by default, but now you can choose to query the corresponding output instead (with In an earlier iteration of this branch I did in fact automatically translate transient states to outputs, but bailed out of that for the reasons above, and because it could potentially be confusing in the case of Is that what you're asking? |
Ah right, I forgot that statuses include "running", "waiting" etc. Never mind. Btw, I've checked that |
Refactor `workflow_state` xtrig pre-8.3.0-back-compat
91edf62
to
c20726e
Compare
Tests all passing again, this time with manual output completion recorded in the DB. There's still a bit more to do though:
|
--status
and--output
queries the same, with respect to polling vs one-off queries--flow
optionretain--message
option (task message) as well as--output
(trigger name) to avoid breaking existing polling workflowsMinor db changeChange to the workflow database structure
: Format of
outputs
column intask_outputs
table has changed from Cylc 8.0.0 where it was a stringified list of task messages, to a stringified dictionary of the format{<output label>: <task message>}
(like how it was in Cylc 7).The command and xtrigger now take
WORKFLOW//CYCLE/TASK:SELECTOR
as an arg.SELECTOR
can be a status or an output. With--output
, or if not a valid status, it is taken as an output; otherwise a status.Any query will be polled for if no matching result is found.
A good test case:
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.