-
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
Fixed 3 related parsec/template var issues #4462
Conversation
cylc/flow/parsec/fileparse.py
Outdated
>>> merge_template_vars(a, b) | ||
{'FOO': 42, 'BAR': 'Hello World', 'ROSE_SUITE_VARIABLES': {}} | ||
|
||
Templating hasn't been detected by a plugin, so we don't do anything: |
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.
This seems like an obvs test case I'd previously missed.
cylc/flow/parsec/fileparse.py
Outdated
""" | ||
fpath = Path(fpath) |
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.
Not strictly necessary, but I like pathlib, and feel that this is safer in the long run.
cylc/flow/parsec/fileparse.py
Outdated
if plugin_result['templating_detected'] is not None: | ||
if ( | ||
plugin_result['templating_detected'] is not None | ||
and 'ROSE_SUITE_VARIABLES' not in native_tvars |
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 this not a bug in cylc-rose?
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 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'm not sure why I thought otherwise, although there may be a reason - Will investigate
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 that this needs to be here because the plugin is not given any knowledge of template variables already in Cylc, so the plugin knows not whether it has been run before.
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.
Hmmm, had a look at cylc-rose, couldn't find any way for it to set ROSE_SUITE_VARIABLES
twice for one pre_configure
call.
Jammed some print statements into cylc-flow, seems the pre_configure
plugins are being called twice, once in cylc.flow.parsec.fileparse
and once in cylc.flow.templatevars
which means we would hit this issue with any plugin that sets templatevars.
I'm not sure why we do this in two places, perhaps there's some odd functionality relying on it being done in templatevars?
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.
Jammed some print statements into cylc-flow, seems the
pre_configure
plugins are being called twice, once incylc.flow.parsec.fileparse
and once incylc.flow.templatevars
which means we would hit this issue with any plugin that sets templatevars.
Sorry, I could have told you this without you having to investigate.
I think that I made this happen when I enabled Cylc (conf/view/list/..) work on uninstalled workflows at #4293 : The correct answer is probably to differentiate between installed and uninstalled workflows in the scripts, and only call it in the script if the workflow isn't installed.
What do you think?
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 converted this PR back into a draft until I've actually fixed the main problem.
3f4bf93
to
7740c46
Compare
This is a small change with no associated Issue.
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.