Repository navigation
Conversation
feb91ec to
9d7c5f8
Compare
|
Requested a review from Copilot to try this out for the first time... |
There was a problem hiding this comment.
Pull request overview
Switches the UI Server’s WebSocket GraphQL subscriptions to the graphql-transport-ws subprotocol and updates the server-side message handling to follow the newer protocol semantics.
Changes:
- Updated subscription WebSocket protocol constant and message handling (
graphql-transport-ws, new message types, ping/pong, subscribe/next/complete). - Simplified subscription handler state management by making
sub_statuseshandler-local and updated resolvers context wiring accordingly. - Updated tests and added a changelog entry for the protocol change.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| cylc/uiserver/tests/test_handlers.py | Updates the subprotocol selection test to the new protocol. |
| cylc/uiserver/handlers.py | Switches the selected WebSocket subprotocol constant and adjusts subscription handler initialization/state. |
| cylc/uiserver/graphql/tornado_ws.py | Implements graphql-transport-ws message types and updates subscription server message processing logic. |
| cylc/uiserver/authorise.py | Tightens typing for AuthorizationMiddleware.auth. |
| cylc/uiserver/app.py | Removes app-level sub_statuses plumbing now that subscription status is handler-local. |
| changes.d/821.feat.md | Documents the protocol change in the changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def select_subprotocol(self, subprotocols): | ||
| return GRAPHQL_WS | ||
| return WS_PROTOCOL |
There was a problem hiding this comment.
We are simultaneously upgrading the client (cylc/cylc-ui#2548) so this is not a problem (apart from the awkwardness of running development UI/UIS for a while when different branches have different subprotocols)
7e7f23f to
ffd0d7b
Compare
d87a94c to
029fd70
Compare
d840246 to
a5cab4d
Compare
This allows for choosing the right UI build for graphql-transport-ws
a5cab4d to
ab309e8
Compare
dwsutherland
left a comment
There was a problem hiding this comment.
Looks good to me 👍
Obviously you'll need the sibling in at the same time:
[E 2026-09-16 14:06:07.712 ServerApp] Uncaught exception GET /cylc/subscriptions (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/cylc/subscriptions', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
.
.
.
Will post review there, seems like just something with GraphiQL to fix.
| case OperationType.PONG.value: | ||
| pass |
There was a problem hiding this comment.
Reviewers: Worth performing a functional test of websocket_ping_interval/timeout.
Changes here shouldn't impact it (implemented at the tornado layer), but worth checking.
There was a problem hiding this comment.
If you mean
cylc-uiserver/cylc/uiserver/jupyter_config.py
Lines 56 to 59 in b07ec62
Then I believe that is ping/pong at the websocket layer: https://www.rfc-editor.org/info/rfc6455/#section-5.5.2
Whereas the ping/pong here is the at the subprotocol layer, so is completely separate
There was a problem hiding this comment.
Yes, I don't think this would interact, but might be worth testing.
Closes #690
Implements the
graphql-transport-wssubprotocol as defined in https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.mdSibling: cylc/cylc-ui#2548
Check List
CONTRIBUTING.mdand added my name as a Code Contributor.?.?.xbranch.