-
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 reinstall --dry-run #4964
cylc reinstall --dry-run #4964
Conversation
source=Path(source), | ||
named_run=workflow_id, | ||
rundir=run_dir, | ||
dry_run=False # TODO: ready for dry run implementation |
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.
Thanks @datamel, nice future-proofing!
(currently in draft whilst I add the interactive mode stuff...) |
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.
Quick premature review. Looks good. Thanks @oliver-sanders (and @datamel for laying the groundwork) - this will ease the pain a little!
Can we explicitly warn, in cylc reinstall
command help, that it will delete any non-source-dir files installed or generated at run time, that aren't in share
etc. or protected by .cylcignore
.
I was just quickly adding the |
@hjoliver Have added interactive mode and some, hopefully helpful messages. Need to straighten out the tests with this change.
WDYT? |
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.
(Premature review: all good so far 👍 )
Excellent, thanks. |
Maybe don't prompt if there are no changes at all. (And then don't bother reinstalling). |
Done (interactive mode only). I'm trying not to lean on rsync output too much as I'm not sure how stable it is between implementations so it's only a crude check but should be good enough for most cases. |
cylc/flow/scripts/cylc.py
Outdated
commands = [ | ||
'clean', | ||
'hold', | ||
'install', |
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.
Is reinstall important enough to be added here?
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.
Fair point, subjective, I didn't add reload
which was silly, if we are having reinstall
we need reload
too.
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.
Hillary is making changes to this on another branch so I've reverted these changes.
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.
(That change has been merged)
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've had a really good play around with this. One thing I have noticed is that in "--debug" mode, the rsync command is printed to the terminal but not the log. I think (if it is desirable for the command to be printed to the log, which I think it is) the log level of the log needs dropping to debug, when --debug in cli opts, and the command is currently written to LOG
, which would need to be changed to reinstall_log
? It looks a bit like a conscious choice so happy to be overruled if you think otherwise, I am possibly not thinking of a reason for this.
Really nice cli interface, with the tip.
The reason I added the rsync command to debug mode was to make it a little clearer what was going on under the surface for users in I think it's less important for the log, but then again, why not put it in? Might be helpful later on. |
@datamel Were you suggesting logging the (The LOG.debug I added doesn't go to either ATM, only to stderr) |
I was suggesting the reinstall log. Just somewhere for us to be able to check the command in the case of debugging problems. |
* Shorten/simplify the first line of a couple of command descriptions. * Add `cylc clean` and `cylc gui` to the list of "selected sub-commands" which are listed by default in the `cylc help` page. * Ensure there is one newline after each description (fixes spacing issue with the auto-added ID help).
* Makes the CLI --help easier to skim by making section headings more obvious.
* New behaviour: * In interactive mode: * Perform dry run. * Display proposed changes to the user. * Prompt for permission to continue. * Provide explanatory docs in the --help. * In non-interactive mode (unlikely use case for reinstall): * Just do it. * Misc changes: * Use the globalcfg configured rsync command for `cylc install` (was using hardcoded `rsync`). * Improved reinstall docs.
reinstall=True, | ||
dry_run=dry_run, | ||
) | ||
reinstall_log.info(cli_format(rsync_cmd)) |
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 was suggesting the reinstall log. Just somewhere for us to be able to check the command in the case of debugging problems.
Now done here.
(Pushed a style fix to allow tests to pass, because I thought @datamel had approved this already ... but it seems not, so not merging just yet). |
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.
All good. Just a small change I think to make on the help docs.
Closes #4960
Not 8.0.0 blocking but an easy win.
Add a
--dry-run
option forcylc reinstall
.Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
andconda-environment.yml
.