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

Cylc VR: Validate should not change options #6316

Merged
merged 4 commits into from
Oct 8, 2024
Merged

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Aug 22, 2024

Closes #6262

Validate may alter the content of options objects passed to it: In this case by replacing icp = now with icp = <actual time> which is an invalid restart option.

Fix

Pass validate a copy of the options object to prevent changes made to the options by validate affecting subsequent steps.

Whilst in principle we probably shouldn't let the options object be mutated by the cylc validate this shouldn't affect us anywhere except in cylc vr.

Check List

  • Check whether this is a problem in cylc vip.
  • 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 both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@wxtim wxtim changed the title Cylc VR: Pass validate a copy of the options object to Cylc VR: Validate should not change options Aug 22, 2024
@wxtim wxtim self-assigned this Aug 22, 2024
@wxtim wxtim force-pushed the fix.6262 branch 2 times, most recently from d97e9f5 to febc787 Compare August 22, 2024 09:55
@wxtim wxtim marked this pull request as draft August 22, 2024 13:31
@wxtim wxtim force-pushed the fix.6262 branch 2 times, most recently from 0b927a6 to 1fcacc5 Compare August 22, 2024 15:19
@wxtim wxtim changed the base branch from master to 8.3.x August 22, 2024 15:20
@wxtim wxtim closed this Aug 22, 2024
@wxtim wxtim reopened this Aug 22, 2024
@wxtim wxtim requested a review from oliver-sanders August 22, 2024 15:28
@wxtim wxtim marked this pull request as ready for review August 22, 2024 15:28
@oliver-sanders oliver-sanders requested review from MetRonnie and removed request for oliver-sanders August 22, 2024 16:11
cylc/flow/config.py Outdated Show resolved Hide resolved
cylc/flow/config.py Outdated Show resolved Hide resolved
@oliver-sanders oliver-sanders added this to the 8.3.4 milestone Aug 27, 2024
@oliver-sanders oliver-sanders added the bug Something is wrong :( label Aug 27, 2024
@oliver-sanders
Copy link
Member

Partially closes #6262 (we should check for other places where the options object might be changed unwisely.)

Please remove the "partially" or create a follow-on issue to cover this.

@oliver-sanders oliver-sanders removed their request for review August 28, 2024 09:30
changes.d/6316.fix.md Outdated Show resolved Hide resolved
tests/unit/test_config.py Outdated Show resolved Hide resolved
@MetRonnie

This comment was marked as resolved.

@oliver-sanders oliver-sanders modified the milestones: 8.3.4, 8.3.5 Sep 11, 2024
prevent changes made to the options by validate affecting
subsequent steps.

Response to review
- Variable name suggestions.
- Test speedup.
@MetRonnie

This comment was marked as resolved.

Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

Got a functional test failure

tests/f/restart/10-pre-initial-2.t

changes.d/6316.fix.md Outdated Show resolved Hide resolved
Co-authored-by: Ronnie Dutta <[email protected]>
@wxtim wxtim marked this pull request as draft September 26, 2024 11:34
@wxtim wxtim requested a review from MetRonnie September 26, 2024 12:44
@wxtim wxtim marked this pull request as ready for review October 4, 2024 10:47
@oliver-sanders oliver-sanders removed their request for review October 4, 2024 11:48
@MetRonnie MetRonnie merged commit e7742b1 into cylc:8.3.x Oct 8, 2024
26 of 27 checks passed
@wxtim wxtim deleted the fix.6262 branch October 9, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :(
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cylc vr bug with initial cycle point = now
3 participants