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

Allow change of templating language when reinstalling #192

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Oct 18, 2022

These changes close #191

in record_cylc_install_options the function identify_templating_section is used to check whether the user has set more than one templating section. This is done after the previous rose-suite-cylc-install.conf has been merged with the new one, so that if the user has changed the templating language both will be present in the merged config and the test will always fail.

Work done

  • Move checks for multiple templating sections to before old and new configs are merged
  • Algorithm merging previous and current config renames old template variables section if new install has changes it.
  • Update tests for merge algorithm.
  • Remove test that it's impossible to change templating languages on reinstall - it should not be.

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to setup.cfg.
  • Appropriate tests are included (unit and/or functional).
  • Appropriate change log entry included.
  • No documentation update required.

@wxtim wxtim added the bug Something isn't working label Oct 18, 2022
@wxtim wxtim added this to the 1.1.2 milestone Oct 18, 2022
@wxtim wxtim self-assigned this Oct 18, 2022
@wxtim wxtim force-pushed the 20221018T0943--1.1.x--template_variable_language_change_reinstall_bug branch from caedf2f to 111dfa2 Compare October 18, 2022 12:53
Comment on lines -255 to -258
def test_cylc_reinstall_fail_on_clashing_template_vars(tmp_path, request):
"""If you re-install with a different templating engine in suite.rc
reinstall should fail.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you replace jinja2:suite.rc with empy:suite.rc or vice versa? Is that meant to be allowed now?

Copy link
Member Author

@wxtim wxtim Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not recommended since both are deprecated. You will get a deprecation warning (from elsewhere in the code). However, I don't think that we should actively prevent people doing this - I think it's a legit, if strange, thing to do.

It might be reasonable to prevent people changing template variables to either, but I hadn't done that, because it was a side effect of the original feature not the intention.

(It'll also mess your workflow up without sig re-writing, but that's the user's problem IMO)

- Move checks for multiple templating sections
  to before old and new configs are merged
- Algorithm merging previous and current config
  renames old template variables section if
  new install has changes it.
- Update tests for merge algorithm.
- Remove test that it's impossible to change
  templating languages on reinstall - it
  should not be.
@wxtim wxtim force-pushed the 20221018T0943--1.1.x--template_variable_language_change_reinstall_bug branch from 1ba4456 to 1e8b09b Compare October 19, 2022 09:10
@wxtim wxtim requested a review from MetRonnie October 19, 2022 09:14
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, feel free to resolve/merge if happy.

@oliver-sanders
Copy link
Member

@wxtim

@wxtim
Copy link
Member Author

wxtim commented Oct 31, 2022

@wxtim

Will do once the tests have re-run

@wxtim wxtim merged commit c4b0a02 into cylc:1.1.x Oct 31, 2022
@wxtim wxtim deleted the 20221018T0943--1.1.x--template_variable_language_change_reinstall_bug branch December 1, 2022 13:09
@oliver-sanders oliver-sanders modified the milestones: 1.1.2, 1.2.0 Jan 12, 2023
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

Successfully merging this pull request may close these issues.

3 participants