No spawn manual remove option - #7419
Conversation
a1c742e to
ca43e21
Compare
|
Thanks @dwsutherland. The command docs/warning look good, although I might think about making it even clearer. From @oliver-sanders earlier comments:
First point (flag) done 👍 still need the shim? |
62d7b21 to
c6689e8
Compare
|
Partly my bad for expanding the main CLI help paragraph (sorry), but on reflection I think we should move it all into the option help. As a low-level intervention, it does not really warrant so much space in the main command description. Instead just leave something like this: "If you need to stop parentless tasks from spawning into future cycles, see the |
c6689e8 to
ae1109a
Compare
Done (I think) |
|
Still need the back-compat shim @dwsutherland ?
|
Ah yes. |
Been trying to do this, little tricky because the UIS passes mutations straight to the scheduler.. Should have this up soon. |
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
Co-authored-by: Oliver Sanders <oliver.sanders@metoffice.gov.uk>
Co-authored-by: Oliver Sanders <oliver.sanders@metoffice.gov.uk>
451b8de to
d7e9404
Compare
|
We're good so long as:
FYI: I think this change is saving us: cylc/cylc-ui#2230 (Gotta feeling this wasn't in place when the |
Confirmed above, this works.
Still works.
Ah yes, nice, I assumed it was just constructing the doc from the ground up (from selected not defaults)... Glad! |
|
Could create a fake client as you say, I think something like this would do it: def test_whatever(monkeypath):
client = Mock()
client.cylc_version = ...
monkyepatch.setattr('cylc.flow.scripts.remove.get_client', lambda *a: client)
await remove(...)
assert client.call_async.called_with(args, kwargs)See also the (rather crude) way Tui amends its queries by The proper answer (not expecting this PR to implement it!) would probably be to do something similar to what we've done in the GUI and only specify the options that we are actually using. |
| if version_result["workflows"][0]["cylcVersion"] < '8.7.0': | ||
| mutation_kwargs['request_string'] = BCOMPAT_MUTATION |
There was a problem hiding this comment.
Basic string comparisons don't work right because versions are not lexigraphically sortable.
But there is an easy way of comparing versions reliably, see this example from Tui:
cylc-flow/cylc/flow/tui/data.py
Lines 126 to 136 in 4766137
There was a problem hiding this comment.
We should raise an error here if the user did try to specify the option rather than running the command without it (which would produce no error).
(note the Scheduler will respond with an error if unexpected args are provided, so I think we wouldn't need this compat loigic if the mutation was constructed dynamically, but double check this!)
There was a problem hiding this comment.
We should raise an error
We could do that if options.no_spawn is True, but even if it is False, that section is to make sure we don't have a GraphQL document that includes the argument for older versions.
hjoliver
left a comment
There was a problem hiding this comment.
Approving, with one minor CLI help text tweak suggested.
| help="""This only affects leading instances of parentless sequential | ||
| xtriggered tasks and parentless tasks waiting at the runahead-limit. | ||
| WARNING: this is a low-level intervention that cuts tasks from | ||
| the future graph; it could cause your workflow to shut down | ||
| prematurely as complete. |
There was a problem hiding this comment.
This now says what the option affects without saying exactly what it does. I'll just grab the salient sentence from the schema doc:
| help="""This only affects leading instances of parentless sequential | |
| xtriggered tasks and parentless tasks waiting at the runahead-limit. | |
| WARNING: this is a low-level intervention that cuts tasks from | |
| the future graph; it could cause your workflow to shut down | |
| prematurely as complete. | |
| help="""Remove the leading instance of a parentless task | |
| without spawning its next instance. This only affects leading instances | |
| of parentless sequential xtriggered tasks and parentless tasks waiting | |
| at the runahead-limit. WARNING: this is a low-level intervention that | |
| cuts tasks from the future graph; it could cause your workflow to shut | |
| down prematurely as complete. |





Partially addresses #7134, supersedes #7340
Closes #7340
This PR is essentially #7340, with the command option in #7134 added (easier then rebasing the latter).
CLI doc:
WUI:


Check List
CONTRIBUTING.mdand added my name as a Code Contributor.setup.cfg(andconda-environment.ymlif present).?.?.xbranch.