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

graphene/graphql-core v3 upgrade #6478

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dwsutherland
Copy link
Member

@dwsutherland dwsutherland commented Nov 14, 2024

partially addresses cylc/cylc-uiserver#333

This is the first part described here:
cylc/cylc-uiserver#333 (comment)

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

  • 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 altered and added to cover.
  • Changelog entry included if this is a change that can affect users

@dwsutherland dwsutherland added dependencies schema change Change to the Cylc GraphQL schema labels Nov 14, 2024
@dwsutherland dwsutherland added this to the 8.x milestone Nov 14, 2024
@dwsutherland dwsutherland self-assigned this Nov 14, 2024
@dwsutherland dwsutherland force-pushed the graphql-core-v3 branch 2 times, most recently from 6258587 to 234a4df Compare November 14, 2024 07:50
@dwsutherland dwsutherland added the Breaking Breaking change label Nov 14, 2024
@dwsutherland dwsutherland force-pushed the graphql-core-v3 branch 2 times, most recently from b4ee741 to dc47ded Compare November 14, 2024 08:10
@dwsutherland
Copy link
Member Author

dwsutherland commented Nov 14, 2024

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.

@dwsutherland dwsutherland force-pushed the graphql-core-v3 branch 4 times, most recently from 990d9dc to 5acb256 Compare November 15, 2024 03:59
@oliver-sanders
Copy link
Member

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
Copy link
Member Author

dwsutherland commented Nov 15, 2024

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, they 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Breaking change dependencies schema change Change to the Cylc GraphQL schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants