-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: rover dev
#1190
feat: rover dev
#1190
Conversation
fwiw - i cannot reproduce when i just run |
relevant code is in ./src/command/subgraph/dev.rs and if you wanna know what all the saucer stuff is about, src is here. all it's really doing is wrapping the user-provided |
fixes #1260 by sending a version check at the start of each `rover dev` session that ensures the two are the same. this should prevent protocol bugs if we make changes to it down the line since everything will use the same version.
fixes #1311 by updating to the latest `interprocess` commit, we can be sure we aren't using too many file descriptors per process since they are cleaned up, even on M1 machines.
fixes #1315 by using a `crossbeam_channel` to handle all subgraph updates in the main `rover dev` session. this should significantly reduce the overhead of running a single `rover dev` session, and make router shutdowns on ctrl+c much more durable. additionally, if the unix socket is broken, it shouldn't crash the main `rover dev` session, it will log the error and continue gracefully, while the attached session shuts down.
router logs are no longer printed by default when running `rover dev`. they can be printed with `--log info` or `--log debug` and they will be printed in the same format as `rover` logs are. additionally this PR renames `--port` to `--supergraph-port` and adds `--supergraph-address` which allows you to bind the router to a specific ip.
## 🚀 Features - **`rover template` command suite - @dbanty, @michael-watson, @EverlastingBugstopper, #1287** Two new commands have made their way to Rover: `rover template list` and `rover template use`. These commands provide a similar experience to `create-react-app`, and allow you to extract GraphQL project templates to your local machine. Check out [the docs](https://www.apollographql.com/docs/rover/commands/template/) for more on this new functionality. - **`rover dev` to facilitate developing a supergraph on your local machine - @EverlastingBugstopper, #1190** `rover dev` allows you to join multiple running subgraph servers together into a local supergraph, providing the ability to run queries and inspect query plans with Apollo Sandbox. Check out [the docs](https://www.apollographql.com/docs/rover/commands/dev) for more on this new functionality. - **If E013 is thrown and `$APOLLO_KEY` is set, give a more helpful suggestion - @ptondereau, #1284, #1285** If Studio fails to recognize an API key and `APOLLO_KEY` is set, recommend unsetting the environment variable to use `--profile default` instead. ## 🐛 Fixes - **Remove useless stdout line for composition results - @ptondereau, #1124, #1291** ## 🛠 Maintenance - **Link directly to API Keys page in Studio - @abernix, #1202** The `rover config auth` command will now provide a link that takes you directly to the "API Keys" page where you can create a Personal API Key, rather than a page that requires you to click through to another page. - **Prefer "supergraph schema" terminology to "gateway" - @EverlastingBugstopper, #1239, #1332** `rover subgraph publish` now refers to updating the "supergraph schema" as opposed to updating the "gateway," since supergraph schema consumers can be routers and/or gateways now.
Test it out
pre-built release
we are actively publishing alphas from this branch. please see the release notes for testing instructions.
bleeding edge
if you want to test the very latest changes made to this branch, follow these instructions:
git clone https://github.com/apollographql/rover.git
)git checkout avery/alt-subgraph-dev
)cargo rover install --force
to build rover and install it locallyrover dev
in each subgraph project directory to run through the auto-setupexamples
directory. there are two examples set up to work withrover dev
-dev
(which is like a hello world for 4 different subgraphs, each with one field, nothing fancy) andsupergraph-demo
, which takes the JS subgraphs from supergraph-demo-fed2 and provides you with a live-reloading supergraph dev server (see the README for more info)Usage
this is the output of the help command (minus global options that already exist in other rover commands)
🚧 Outstanding work
🐞Bugs
According to the issue tracker there are no bugs in
rover dev
. This is highly unlikely. If you encounter a bug, please submit an issue.🎉Features
No new planned features.
💅Polish
No planned polish.
📚 Docs
No planned docs.
Completed items
rover dev
session #1223rover graph introspect
in parallel withrover subgraph introspect
#1222 and print success message when introspection succeeds #1224rover dev
help text #1232rover dev
has a hard time cleaning up spawned processes #1230rover dev
should provide a confirmation prompt to accept a.graphql
/.gql
file if it finds one #1226rover dev
hangs on new sessions #1255rover dev
session doesn't kill attachedrover dev
sessions #1228rover dev
#1271 fixes the router spun up byrover dev
should enable query plans #1272--port
argument torover dev
#1275 fixes add--port
torover dev
#1231 and feat: better error message inrover dev
when a subgraph url is the same as the router url #1266rover dev
errors out after 5 sec on license agreement #1265rover dev
processes #1257 and secondaryrover dev
crashes inv0.9.0.alpha.6
#1277rover dev
should pin the composition version to the same federation version as the router #1278rover dev
is killed #1294 and sometimes the leaderrover dev
session thinks it's a follower #1295rover dev
is introspecting #1297 and Refactor to prevent missed responses #1301rover dev
fails because there are too many open files #1311rover dev
sessions to be the same version #1314 fixesrover dev
should require other sessions to be the same version of rover #1260rover dev
session #1319 fixes the mainrover dev
should use a channel instead of a socket to talk to itself #1315rover dev
session prints composition errors twice. #1324, 502/404 bad gateway errors during introspection should not suggest submitting a bug #1217, androver supergraph compose
androver {sub}graph check
should print a different suggestion when there is only one subgraph #1237rover dev
#1256🙅 Things we won't do for the initial release
rover dev
with a--command
#1220rover dev
should provide an endpoint to fetch subgraph SDLs #1269rover dev
#1225Before releasing
This is a long-running feature branch
this one is a doozy with lots of commits. i'm trying my best to keep this branch as stable as possible, and will be making individual pull requests against it before merging them in as of commit ae3f337.
background
this pr lays the ground work for an opinionated federated workflow. see the below for an approximate workflow (log messages were just typed by me in figma and don't reflect the state of this PR)
currently this PR does almost everything in the screenshot except
rover new
.rover new
work can be found in #1287