-
Notifications
You must be signed in to change notification settings - Fork 94
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
cylc play
(restart): fix bug affecting run host reinvocation after interactive upgrade
#6267
Conversation
807cf3f
to
dd3a5ce
Compare
Test failures just macos functional issues and flaky integration test fixed by #6257 |
db822fe
to
4b84735
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.
👍🏼
options.upgrade, | ||
options.downgrade, | ||
): | ||
if not _version_check(db_file, options): |
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.
FYI, I purposefully did not propagate the options
object down the call chain. IMO it's a good idea to abstract out the CLI interfaces higher up in the call chain to keep the underlying code more abstract. The more you propagate CLI logic down the call stack, the harder it is to, for example, open a Python API later, or create a wrapper command, you also need to mock more in order to test and typing is less effective too (we know we're getting a Values
object, but we don't know whether it has an upgrade
option.
Not a blocker, but better before IMO.
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.
I think ideally we want to only alter options.upgrade
in the case of an interactive upgrade, so the simplest way of doing this is passing in the options
object to _version_check
.
It is a shame about the type-looseness of it, but at least it is relatively easy to test these functions by importing and using RunOptions
(no need for mocking).
cylc-flow/cylc/flow/option_parsers.py
Lines 569 to 570 in 6eb8f61
class Options: | |
"""Wrapper to allow Python API access to optparse CLI functionality. |
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.
options.update = _version_check(db_file, options.upgrade, options.downgrade)
would have done it?
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.
There are pathways it returns True
without interactive upgrade
Fixes a bug not recorded in an issue. I think this bug has been present since the introduction of the interactive upgrade mechanism (#5074)
TL;DR - remote reinvocation would not work after interactively upgrading a workflow to a new Cylc version on the CLI.
Steps to reproduce
With
run hosts
configured inglobal.cylc
Start a workflow and stop it, then fiddle the workflow DB to make it look like it was run with an older version:
Now restart it with
cylc play
, and type 'y' at the interactive upgrade prompt. When it re-invokes on the run host, you should see an errorCheck List
CONTRIBUTING.md
and added my name as a Code Contributor.?.?.x
branch.