Skip to content

Conversation

@dwsutherland
Copy link
Member

@dwsutherland dwsutherland commented Nov 14, 2024

partially addresses cylc/cylc-uiserver#333

sibling to
cylc/cylc-uiserver#672
cylc/cylc-ui#2091

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.

Note:
There are some incompatibilities (i.e. with Enums) on the first version (3.0.0):
https://github.com/graphql-python/graphene/wiki/v3-release-notes
(and perhaps beyond)

The coverage will be lower due to some items only being used at the UIS (at present).

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 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 dwsutherland force-pushed the graphql-core-v3 branch 2 times, most recently from e3431c6 to 3c36e56 Compare November 15, 2024 10:59
@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, 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
Copy link
Member

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.

@oliver-sanders oliver-sanders modified the milestones: 8.x, 8.5.0 Nov 21, 2024
@hjoliver hjoliver added the BLOCKED This can't happen until something else does label Nov 22, 2024
@hjoliver

This comment was marked as resolved.

@oliver-sanders

This comment was marked as resolved.

@dwsutherland

This comment was marked as resolved.

@dwsutherland dwsutherland force-pushed the graphql-core-v3 branch 2 times, most recently from b0775d4 to 97220c8 Compare December 3, 2024 02:09
@wxtim

This comment was marked as resolved.

@oliver-sanders
Copy link
Member

oliver-sanders commented Jun 13, 2025

Have tested out the stop flow arg change, all good.

@dwsutherland
Copy link
Member Author

Glad I spent a little more time on this (thanks @MetRonnie ); I've significantly simplified the CylcVisitor argument search, and fixed associated tests:
3e2769b

@MetRonnie
Copy link
Member

MetRonnie commented Jun 18, 2025

So close now! Just one snag with the test still: #6478 (comment)

Edit: pushed a change

🎉

- Remove duplicate param from one test
- Reinstate possibly-mistaken deleted param from another
@MetRonnie MetRonnie merged commit 92f0e70 into cylc:master Jun 18, 2025
39 checks passed
@oliver-sanders
Copy link
Member

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants