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

Refactor rover dev for use with rover lsp #2170

Draft
wants to merge 60 commits into
base: language-server
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
7d1628e
add run composition tests (#2171)
loshz Sep 24, 2024
64b0272
add subgraph watcher handle tests (#2172)
loshz Sep 24, 2024
dfc0d25
Fix integration tests against the [supergraph-demo (#2175)
dotdat Sep 25, 2024
d911423
add tests for subgraph watchers parsing (#2177)
loshz Sep 26, 2024
baf6827
PoC of LSP in Rover
dylan-apollo Jun 5, 2024
34b9d37
update als
trevor-scheer Sep 16, 2024
ac3933c
release: v0.27.0-alpha.0
trevor-scheer Sep 16, 2024
5e79607
only build lsp mod with composition-js enabled
trevor-scheer Sep 16, 2024
e7d219e
security + openssl fixes
trevor-scheer Sep 16, 2024
558743f
Fix federation version from `supergraph.yaml`
dylan-apollo Sep 22, 2024
853ece1
Remove multi-terminal session support
dylan-apollo Sep 22, 2024
84c08bb
Remove ipc & more multi-terminal leftovers
dylan-apollo Sep 22, 2024
bf20d84
Clean up more ipc residue
dylan-apollo Sep 22, 2024
a2a9859
More renaming, remove shutdown event / ctrl-c handling since the stan…
dylan-apollo Sep 22, 2024
6409205
Remove more leader/follower terminology, ditch now-useless leader mes…
dylan-apollo Sep 22, 2024
9ff1a56
Refactor supergraph resolution to make it more type-safe.
dylan-apollo Sep 23, 2024
37188a8
Start moving some fields into `Composer`
dylan-apollo Sep 23, 2024
1267370
Extract the composition logic from `do_compose` into `Composer`
dylan-apollo Sep 23, 2024
5614e22
Simplify subgraph messages, use Tokio channels, finish getting rid of…
dylan-apollo Sep 23, 2024
ef18924
Don't exit early if first composition fails
dylan-apollo Sep 23, 2024
6fc355e
Move all subgraph watching logic into new `Watcher` struct
dylan-apollo Sep 23, 2024
9f03068
Convert LSP to use new `Watcher` struct
dylan-apollo Sep 23, 2024
7ab0c9e
Fix test compilation
dylan-apollo Sep 23, 2024
0835025
Set root URI for LSP
dylan-apollo Sep 24, 2024
52d1f2d
Reduce file watcher debounce to speed up LSP feedback
dylan-apollo Sep 24, 2024
a9802d9
Recompose when `supergraph.yaml` changes (doesn't _use_ the changes y…
dylan-apollo Sep 24, 2024
ce8d7ac
Unbound the notification sender, so that lots of subgraphs don't bloc…
dylan-apollo Sep 24, 2024
6dd2b30
Compose with a new version, when updated in `supergraph.yaml`
dylan-apollo Sep 24, 2024
42f3ebe
Use clap option for composition override instead of manual check
dylan-apollo Sep 24, 2024
6962831
Fix some tests
dylan-apollo Sep 24, 2024
ea3c387
Get rid of pluralization specialization for composition errors, since…
dylan-apollo Sep 24, 2024
3d67be8
Removed federation version from _sometimes_ being included in _succes…
dylan-apollo Sep 24, 2024
95bcd05
Use a helper function to update subgraphs in `Composer`
dylan-apollo Sep 24, 2024
38b4361
Break watcher event handling into its own function
dylan-apollo Sep 24, 2024
7409c9d
Move subgraph resolution into its own function for reuse later
dylan-apollo Sep 24, 2024
b08e9b0
Simplify `resolve_subgraph` error handling
dylan-apollo Sep 24, 2024
2186485
Move `routing_url` check into `resolve_subgraph`
dylan-apollo Sep 24, 2024
e1b6ced
Finish `resolve_subgraph` refactor
dylan-apollo Sep 24, 2024
a5fee2f
Add/remove subgraphs from composition when `supergraph.yaml` changes.…
dylan-apollo Sep 24, 2024
cf28427
Update watchers (and LSP) when adding/removing subgraphs
dylan-apollo Sep 24, 2024
ca8c960
Use published version of `apollo-language-server`
dylan-apollo Sep 24, 2024
0bb2414
Turn off `federation` module when `composition-js` is disabled
dylan-apollo Sep 24, 2024
acc4c6b
Report more errors up through events, reduce verbosity of `rover dev`…
dylan-apollo Sep 25, 2024
b6c62bb
Add a TODO about not failing on startup in LSP
dylan-apollo Sep 25, 2024
181e5fa
Hide `rover lsp` from `rover --help`
dylan-apollo Sep 25, 2024
2fe4da6
release: v0.27.0-alpha.1
dylan-apollo Sep 25, 2024
7a30b10
fix(openssl): downgrade `openssl-src` (#2174)
aaronArinder Sep 26, 2024
483ce42
Default fed version to 1 (#2175)
dylan-apollo Sep 26, 2024
a4cde15
Remove noisy log when watchers stop & add extra debugging around comp…
dylan-apollo Sep 26, 2024
bbc5e51
Support relative paths to `supergraph.yaml` in lsp
dylan-apollo Sep 26, 2024
93a2580
Fix remote + local federation version overrides
dylan-apollo Sep 26, 2024
ee5b0d0
Clear diagnostics on `supergraph.yaml` when composition completes.
dylan-apollo Sep 26, 2024
8a3e7ce
Remove some TODOs that are TODONE
dylan-apollo Sep 26, 2024
6d89246
Fix infinite CPU when rover dev restarts router
dylan-apollo Sep 26, 2024
a827162
Update to latest published `apollo-language-server`
dylan-apollo Sep 27, 2024
38d8992
Remove some to-done todos
dylan-apollo Sep 30, 2024
7787673
Revert macos kqueue to fsevent to solve watcher bug
dylan-apollo Sep 30, 2024
d48b621
Update apollo-language-server
dylan-apollo Sep 30, 2024
c657c4a
release: v0.27.0-preview.0
dylan-apollo Oct 1, 2024
a79a647
Downgrade OpenSSL again
dylan-apollo Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
848 changes: 636 additions & 212 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license-file = "./LICENSE"
name = "rover"
readme = "README.md"
repository = "https://github.com/apollographql/rover/"
version = "0.26.2"
version = "0.27.0-preview.0"
default-run = "rover"

publish = false
Expand Down Expand Up @@ -71,6 +71,8 @@ apollo-encoder = "0.8"
# https://github.com/apollographql/federation-rs
apollo-federation-types = "0.14.1"

apollo-language-server = { version = "0.3.0", default-features = false, features = ["tokio"] }

# crates.io dependencies
anyhow = "1"
ariadne = "0.4"
Expand All @@ -92,7 +94,6 @@ chrono = "0.4"
ci_info = "0.14"
console = "0.15"
crossbeam-channel = "0.5"
ctrlc = "3"
derive-getters = "0.5.0"
dialoguer = "0.11"
directories-next = "2.0"
Expand All @@ -108,13 +109,12 @@ http-body = "1.0.1"
http-body-util = "0.1.2"
httpmock = "0.7"
hyper = "1.0"
interprocess = { version = "2", default-features = false }
indoc = "2"
itertools = "0.13.0"
lazycell = "1"
lazy_static = "1.4"
notify = { version = "6", default-features = false, features = [
"macos_kqueue",
"macos_fsevent",
] }
notify-debouncer-full = "0.3.1"
opener = "0.7"
Expand Down Expand Up @@ -165,10 +165,11 @@ zip = "2.0"
### rover specific dependencies
[dependencies]
anyhow = { workspace = true }
assert_fs = { workspace = true }
async-trait = { workspace = true }
apollo-federation-types = { workspace = true }
apollo-language-server = { workspace = true }
apollo-parser = { workspace = true }
assert_fs = { workspace = true }
async-trait = { workspace = true }
billboard = { workspace = true }
binstall = { workspace = true }
buildstructor = { workspace = true }
Expand All @@ -178,7 +179,6 @@ clap = { workspace = true, features = ["color", "derive", "env"] }
chrono = { workspace = true }
console = { workspace = true }
crossbeam-channel = { workspace = true }
ctrlc = { workspace = true }
derive-getters = { workspace = true }
dialoguer = { workspace = true }
flate2 = { workspace = true }
Expand All @@ -187,7 +187,6 @@ graphql_client = { workspace = true }
heck = { workspace = true }
http = { workspace = true }
houston = { workspace = true }
interprocess = { workspace = true }
itertools = { workspace = true }
prettytable-rs = { workspace = true }
lazycell = { workspace = true }
Expand Down Expand Up @@ -217,6 +216,7 @@ tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros", "proc
tokio-stream = { workspace = true }
toml = { workspace = true }
tower = { workspace = true }
tower-lsp = { version = "0.20.0" }
tracing = { workspace = true }
which = { workspace = true }
uuid = { workspace = true }
Expand Down
64 changes: 32 additions & 32 deletions crates/rover-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions crates/rover-client/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ pub enum RoverClientError {
},

#[error("Encountered {} while trying to build a supergraph.", .source.length_string())]
BuildErrors {
source: BuildErrors,
num_subgraphs: usize,
},
BuildErrors { source: BuildErrors },

#[error("Encountered {} while trying to build subgraph \"{subgraph}\" into supergraph \"{graph_ref}\".", .source.length_string())]
SubgraphBuildErrors {
Expand Down
11 changes: 2 additions & 9 deletions crates/rover-std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
time::Duration,
};

use crate::{errln, infoln, RoverStdError};
use crate::{errln, RoverStdError};
use anyhow::{anyhow, Context};
use camino::{ReadDirUtf8, Utf8Path, Utf8PathBuf};
use notify::event::ModifyKind;
Expand Down Expand Up @@ -258,13 +258,12 @@ impl Fs {
{
let path = path.as_ref().to_path_buf();
tokio::task::spawn_blocking(move || {
infoln!("Watching {} for changes", path.as_std_path().display());
let path = path.as_std_path();
let (fs_tx, fs_rx) = channel();
// Spawn a debouncer so we don't detect single rather than multiple writes in quick succession,
// use the None parameter to allow it to calculate the tick_rate, in line with previous
// notify implementations.
let mut debouncer = match new_debouncer(Duration::from_secs(1), None, fs_tx) {
let mut debouncer = match new_debouncer(Duration::from_millis(100), None, fs_tx) {
Ok(debouncer) => debouncer,
Err(err) => {
handle_notify_error(&tx, path, err);
Expand Down Expand Up @@ -328,12 +327,6 @@ fn handle_notify_error(tx: &WatchSender, path: &Path, err: notify::Error) {
path.display()
),
}

tracing::debug!(
"an unexpected error occured while watching {} for changes: {err:?}",
path.display()
);

tx.send(Err(err.into())).ok();
}

Expand Down
18 changes: 18 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ version = "*"
expression = "(Apache-2.0 OR MIT) AND BSD-3-Clause"
license-files = [{ path = "COPYRIGHT", hash = 0x39f8ad31 }]

[[licenses.clarify]]
name = "apollo-language-server"
version = "*"
expression = "Elastic-2.0"
license-files = [{ path = "LICENSE.md", hash = 0x5fc4a573 }]

[[licenses.exceptions]]
name = "apollo-language-server"
allow = ["Elastic-2.0"]

[[licenses.exceptions]]
name = "apollo-federation"
allow = ["Elastic-2.0"]

[[licenses.exceptions]]
name = "apollo-composition"
allow = ["Elastic-2.0"]

# This section is considered when running `cargo deny check bans`.
# More documentation about the 'bans' section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
Expand Down
2 changes: 1 addition & 1 deletion installers/binstall/scripts/nix/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BINARY_DOWNLOAD_PREFIX="https://github.com/apollographql/rover/releases/download
# Rover version defined in root cargo.toml
# Note: this line is built automatically
# in build.rs. Don't touch it!
PACKAGE_VERSION="v0.26.2"
PACKAGE_VERSION="v0.27.0-preview.0"

download_binary_and_run_installer() {
downloader --check
Expand Down
2 changes: 1 addition & 1 deletion installers/binstall/scripts/windows/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# version found in Rover's Cargo.toml
# Note: this line is built automatically
# in build.rs. Don't touch it!
$package_version = 'v0.26.2'
$package_version = 'v0.27.0-preview.0'

function Install-Binary($rover_install_args) {
$old_erroractionpreference = $ErrorActionPreference
Expand Down
Loading
Loading