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

ROVER-286 Removing routing_url gives correct error message #2360

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jonathanrainer
Copy link
Contributor

As per title, due to some particularly inconvenient handling of federation resolution subgraphs losing a routing_url while the LSP was running, or not having one to start with were causing us many problems. This is now resolved and I've run over the test suite we have and all tests are passing (with the exception of the --profile ones, which are a known issue).

Some comments are added throughout to explain the decisions taken.

@jonathanrainer jonathanrainer requested a review from a team as a code owner January 17, 2025 14:22
@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Jan 17, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: f74d9e135f1afc5fe8d93c81

Copy link
Contributor Author

@jonathanrainer jonathanrainer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments to explain the more obscure parts

src/composition/supergraph/config/full/subgraph/file.rs Outdated Show resolved Hide resolved
src/composition/supergraph/config/full/supergraph.rs Outdated Show resolved Hide resolved
src/composition/watchers/composition.rs Outdated Show resolved Hide resolved
src/composition/watchers/subgraphs.rs Outdated Show resolved Hide resolved
src/composition/watchers/watcher/supergraph_config.rs Outdated Show resolved Hide resolved
Base automatically changed from jr/task/ROVER-280 to main January 21, 2025 09:56
There seems to have been a thought that a subgraph should be considered
added and removed if the `routing_url` changes. That is not a good idea
and is now reverted.
In the past we considered a FullyResolvedSupergraphConfig to be forced
to have a routing_url for each subgraph. While this is technically a
reasonable assumption, from the POV of the LSP it's actually better
to enable it to be an Option<String> instead. This means we can more
accurately funnel errors from the `supergraph` binary rather than
having to do a lot of error handling ourselves.
Now that we've allowed `routing_url` to be an Option, we can address
the crux of the issue by updating a routing_url midstream.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that at some point I thought that the pair of name and routing_url should uniquely identify a subgraph but that's nonsense and changing this doesn't break anything so I'm planning on reverting this and leaving it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants