Skip to content
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

Pre configure not handling -S variables properly. #122

Closed
wxtim opened this issue Mar 22, 2022 · 2 comments
Closed

Pre configure not handling -S variables properly. #122

wxtim opened this issue Mar 22, 2022 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@wxtim
Copy link
Member

wxtim commented Mar 22, 2022

Describe the bug

-S 'Variable="something"' doesn't get passed to the rose config loader in the pre_configure entry point, so all Cylc commands which rely on that entry point will not load it into the rose configuration.

This has not affected the cylc install workflow; cylc play workflow recipe because the contents of -S are stored in opt/rose-suite-cylc-install.conf.

Release version(s) and/or repository branch(es) affected?

Steps to reproduce the bug

With a blank rose-suite.conf and flow.cylc thus:

[scheduling]
    initial cycle point = 1066
    [[dependencies]]
        R1 = foo

[runtime]
    [[foo]]
        script = echo {{ GREETING }}

run

> cylc validate . -S 'GREETING="Hello"'
Jinja2Error: 'GREETING' is undefined
Context lines:
    [[root]]
        script = """
            echo {{ GREETING }}	<-- UndefinedError

Expected behavior

The test above should validate.

Additional context

  • A quick inspection of the code of rose/metomi/rose/config_tree.ConfigTreeLoader.load suggests that -D and -S must be merged before being passed to load(). (Double check this)
  • You will probably want to change the handling of opts.rose_template_variables at around line 240 of cylc-rose/cylc/rose/utilities.py

Pull requests welcome!
This is an Open Source project - please consider contributing a bug fix
yourself (please read CONTRIBUTING.md before starting any work though).

@oliver-sanders
Copy link
Member

oliver-sanders commented Apr 7, 2022

FYI: The origin of this bug was as a consequence of cylc/cylc-flow#4288, cylc/cylc-flow#4293

@wxtim
Copy link
Member Author

wxtim commented Apr 8, 2022

Fixed by #132

@wxtim wxtim closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants