-
Notifications
You must be signed in to change notification settings - Fork 92
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
ROVER-279 Funnels Errors from Supergraph Config Deserialisation to LSP #2345
Conversation
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 37742f44ef350d29f9e81f90 |
dcaa3a6
to
487336e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would have been a lot without your demo/walkthrough, so thanks; broadcastsubtask is pretty sweet!
src/command/lsp/mod.rs
Outdated
FsWriteFile::default(), | ||
client_config.service()?, | ||
fetch_remote_subgraph_factory.boxed_clone(), | ||
1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth being a const? what does this 1
represent, threads or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's the retry interval for introspection, but this is actually fixed in the ROVER-245 PR because it gets turned into a command line option, which is a lot clearer anyway!
487336e
to
15a3c47
Compare
In order to route errors properly to the LSP we need to introduce a new type of subtask which can broadcast out to multiple receivers. This we have done, and have thus had to implement a few changes to other underlying infrastructure, but not too much.
This probably needs renaming but the idea is that this is also watching events that come from watching the SupergraphConfig and will also react to them.
The handling is rudimentary at the minute, but it surfaces errors properly, which is the key
f61a812
to
ccc374d
Compare
THIS CANNOT BE MERGED UNTIL ROVER-245 HAS
So the key observation here is that the LSP needs to get back the details of errors that occur when we try and deserialise the Supergraph YAML and before this it didn't, those errors were simply printed into the DEBUG logs and then thrown away. In order to do this I've had to add a few more concepts into the work done on Subtasks etc. because in order to do this properly we need a Subtask that can send events across to multiple places (with broadcast semantics).
So the key changes in this PR follow the 3 commits:
.subscribe()
method, which copies the interface of atokio
BroadcastStream. This does have consequences for the kind of data you can send out of these subtasks (i.e. all the data has to be Cloneable) but as this is a specific use-case I see no issue with this.