cylc / cylc-flow

Cylc: a workflow engine for cycling systems.
https://cylc.github.io
GNU General Public License v3.0
335 stars 94 forks source link

graphene/graphql-core v3 upgrade #6478

Open dwsutherland opened 2 weeks ago

dwsutherland commented 2 weeks ago

partially addresses https://github.com/cylc/cylc-uiserver/issues/333

This is the first part described here: https://github.com/cylc/cylc-uiserver/issues/333#issuecomment-2463424670

The second, and arguably trickier, part will be the sibling at the UIS.

There were some breaking changes to contend with (mainly around more support for Enums): https://github.com/graphql-python/graphene/wiki/v3-release-notes

But the most involved part was re-implementing the null stripping, but some time reading the graphql-core I found some tools to help, simplifying the code.

Check List

dwsutherland commented 2 weeks ago

Another change I've found is with default_value with mutation arguments (or arguments in general).. In v3 this value isn't used unless the argument is absent.. So setting it to None/null in the request doc is honored, whereas previously it would have used the argument default_value defined in the schema, i.e. This will set mode: Clean as expected:

mutation {
  stop(
      workflows: ["foo/run1"]
    ) {
    result
  }
}"

whereas this will not:

mutation {
  stop(
      workflows: ["foo/run1"],
      mode: None
    ) {
    result
  }
}"

you'll get an error, the None/null is now carried.

And we have a lot of scripts that set args to None in the options.. Slowly working through them.. They'll need to be a valid default in the options.

oliver-sanders commented 2 weeks ago

LGTM 🚀

8.4.0 is hopefully imminent (remove + skip mode), so we're probably aiming for 8.5.0 (cylc-uiserver 1.7.0).

Will need to have a play with the cylc-ui forms to see what the impact of the enum changes are. Hopefully, we can keep cylc-uiserver compatible with older cylc-flow schedulers (perhaps using some back-compat shims in cylc-uiserver if needed).

Another change I've found is with default_value with mutation arguments

Good spot. Will need to make sure the UI does the right thing.

dwsutherland commented 2 weeks ago

Just made some more changes; covered more code, fixed a few issues..

Hopefully, we can keep cylc-uiserver compatible with older cylc-flow schedulers

Well, the sync is just protobuf.. And I haven't noticed anything other than those defaults from the GraphQL client end. It may come down to whether the mutations passed through to the UIS need to change (so far so good).. Definitely can't be in the same python environment... (haha)

oliver-sanders commented 1 week ago

Once we merge this, we're committed to releasing the uis/ui components in the same minor release.

Hopefully, we can target 8.5.0, created a milestone to assign this to. Note to reviewers, don't merge into master until 8.4.0 has been released.

hjoliver commented 1 week ago

BLOCKED till after 8.4.0 released

oliver-sanders commented 1 day ago

How's the UIS side coming on?