Skip to content

AOTF: Do not send non-required mutation args when they have the default value #2230

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

Merged
merged 2 commits into from
Jul 11, 2025

Conversation

MetRonnie
Copy link
Member

@MetRonnie MetRonnie commented Jun 30, 2025

As mentioned in cylc/cylc-flow#6820, the reload command in the GUI currently will be broken for workflows running in Cylc < 8.5.0.

This is because cylc/cylc-flow#6509 added a new argument in the schema. However we can work around this by not sending that arg when it is the default value.

This workaround can be removed when #1225 is addressed.

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).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry not needed as the problem will not be released until 8.5.0
  • No docs needed
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@MetRonnie MetRonnie added this to the 2.8.0 milestone Jun 30, 2025
@MetRonnie MetRonnie requested a review from oliver-sanders June 30, 2025 12:01
@MetRonnie MetRonnie self-assigned this Jun 30, 2025
@MetRonnie MetRonnie added the bug Something isn't working label Jun 30, 2025
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.

Makes sense, but you've got some tests to fix.

…lt value

This workaround helps avoid back-compat issues when we make changes to the schema
Comment on lines +521 to +525
let pointer = arg.type
let multiple = false
let cylcObject = null
let cylcType = null
const required = arg.type?.kind === 'NON_NULL'
Copy link
Member

Choose a reason for hiding this comment

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

Jslint used to tell us not to declare variables within loops like this. More performant to declare once and reuse?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't find much info on that and perhaps that dated back to when var was used to declare variables?

I prefer this way because a) it reduces duplication and makes the code more readable, b) it is less likely to lead to the value from one iteration accidentally leaking into the next iteration - the scope is only within a single iteration.

Copy link
Member

Choose a reason for hiding this comment

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

dated back to when var was used to declare variables?

That's probably it. Using var within a loop would re-declare the variable over and over.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually the opposite I think var declarations were hoisted 😬

@oliver-sanders oliver-sanders merged commit 8e1c778 into cylc:master Jul 11, 2025
5 checks passed
@MetRonnie MetRonnie deleted the mutation-compat branch July 11, 2025 10:48
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.

2 participants