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

Use Apollo Router 2.x by default #2433

Merged
merged 1 commit into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/run-smokes-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
working-directory: ".github/scripts"
run: |
ls -al
JSON=$(source get_latest_x_versions.sh 1 apollographql router router latest-1 1)
JSON=$(source get_latest_x_versions.sh 1 apollographql router router latest-2 2)
echo "router_versions=$JSON" >> "$GITHUB_OUTPUT"
- name: "Get latest Supergraph Plugin versions"
id: "supergraph-versions"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/run-smokes-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
name: "Install `semver` cli"
- run: |
ls -al
JSON=$(source get_latest_x_versions.sh 3 apollographql router router latest-1 1)
ROUTER1_VERSIONS=$(source get_latest_x_versions.sh 3 apollographql router router latest-1 1)
ROUTER2_VERSIONS=$(source get_latest_x_versions.sh 3 apollographql router router latest-2 2)
JSON=$(echo "$ROUTER1_VERSIONS $ROUTER2_VERSIONS" | jq -cs 'add')
echo "router_versions=$JSON" >> "$GITHUB_OUTPUT"
id: "router-versions"
working-directory: ".github/scripts"
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

# [0.28.0] (unreleased) - 2025-mm-dd

## 🚀 Features

- **Default to Apollo Router 2.x for `rover dev` - @pubmodmatt PR #2433**

The default version of Apollo Router used by `rover dev` is now 2.x instead of 1.x. The default can be overridden by
setting `APOLLO_ROVER_DEV_ROUTER_VERSION`, for example `APOLLO_ROVER_DEV_ROUTER_VERSION=1.61.0`.

## 🐛 Fixes

- **Fix formatting of table output by `rover config whoami` - @pubmodmatt PR #2413**
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ apollo-parser = "0.8"
apollo-encoder = "0.8"

# https://github.com/apollographql/federation-rs
apollo-federation-types = { version = "0.15.2", features = ["json_schema"] }
apollo-federation-types = { version = "0.15.3", features = ["json_schema"] }

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

Expand Down
2 changes: 1 addition & 1 deletion src/command/dev/do_dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl Dev {

let router_version = match &*OVERRIDE_DEV_ROUTER_VERSION {
Some(version) => RouterVersion::Exact(Version::parse(version)?),
None => RouterVersion::Latest,
None => RouterVersion::LatestTwo,
};

let api_key_override = match std::env::var(RoverEnvKey::Key.to_string()) {
Expand Down
2 changes: 1 addition & 1 deletion src/command/dev/router/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ mod tests {

#[fixture]
fn router_version() -> RouterVersion {
RouterVersion::Latest
RouterVersion::LatestTwo
}

#[fixture]
Expand Down
85 changes: 70 additions & 15 deletions src/command/install/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl Plugin {
Err(no_prebuilt_binaries)
}
}
RouterVersion::Latest => Ok("aarch64-unknown-linux-gnu")
RouterVersion::LatestOne | RouterVersion::LatestTwo => Ok("aarch64-unknown-linux-gnu")
}
}
}
Expand Down Expand Up @@ -248,7 +248,7 @@ impl PluginInstaller {
.ok_or_else(|| could_not_install_plugin(&plugin.get_name(), &version))
}
}
RouterVersion::Latest => {
RouterVersion::LatestOne => {
let major_version = 1;
if skip_update {
self.find_existing_latest_major(plugin, major_version)?
Expand All @@ -267,6 +267,25 @@ impl PluginInstaller {
})
}
}
RouterVersion::LatestTwo => {
let major_version = 2;
if skip_update {
self.find_existing_latest_major(plugin, major_version)?
.ok_or_else(|| {
skip_update_err(
&plugin.get_name(),
major_version.to_string().as_str(),
)
})
} else {
self.install_latest_major(plugin).await?.ok_or_else(|| {
could_not_install_plugin(
&plugin.get_name(),
major_version.to_string().as_str(),
)
})
}
}
},
Plugin::Supergraph(version) => match version {
FederationVersion::ExactFedOne(version)
Expand Down Expand Up @@ -500,8 +519,14 @@ mod tests {
#[rstest]
// #### macOS, x86_64 ####
// # Router #
#[case::macos_x86_64_router_latest(
Plugin::Router(RouterVersion::Latest),
#[case::macos_x86_64_router_latest_one(
Plugin::Router(RouterVersion::LatestOne),
"macos",
"x86_64",
Some("x86_64-apple-darwin")
)]
#[case::macos_x86_64_router_latest_two(
Plugin::Router(RouterVersion::LatestTwo),
"macos",
"x86_64",
Some("x86_64-apple-darwin")
Expand Down Expand Up @@ -546,8 +571,14 @@ mod tests {
)]
// ### macOS, aarch64 ###
// # Router #
#[case::macos_aarch64_router_latest(
Plugin::Router(RouterVersion::Latest),
#[case::macos_aarch64_router_latest_one(
Plugin::Router(RouterVersion::LatestOne),
"macos",
"aarch64",
Some("aarch64-apple-darwin")
)]
#[case::macos_aarch64_router_latest_two(
Plugin::Router(RouterVersion::LatestTwo),
"macos",
"aarch64",
Some("aarch64-apple-darwin")
Expand Down Expand Up @@ -613,8 +644,14 @@ mod tests {
)]
// ### macOS, "" ###
// # Router #
#[case::macos_empty_router_latest(
Plugin::Router(RouterVersion::Latest),
#[case::macos_empty_router_latest_one(
Plugin::Router(RouterVersion::LatestOne),
"macos",
"",
Some("x86_64-apple-darwin")
)]
#[case::macos_empty_router_latest_two(
Plugin::Router(RouterVersion::LatestTwo),
"macos",
"",
Some("x86_64-apple-darwin")
Expand Down Expand Up @@ -653,8 +690,14 @@ mod tests {
)]
// ### Windows, "" ###
// # Router #
#[case::windows_empty_router_latest(
Plugin::Router(RouterVersion::Latest),
#[case::windows_empty_router_latest_one(
Plugin::Router(RouterVersion::LatestOne),
"windows",
"",
Some("x86_64-pc-windows-msvc")
)]
#[case::windows_empty_router_latest_two(
Plugin::Router(RouterVersion::LatestTwo),
"windows",
"",
Some("x86_64-pc-windows-msvc")
Expand All @@ -668,8 +711,14 @@ mod tests {
)]
// ### Linux, x86_64 ###
// # Router #
#[case::linux_x86_64_router_latest(
Plugin::Router(RouterVersion::Latest),
#[case::linux_x86_64_router_latest_one(
Plugin::Router(RouterVersion::LatestOne),
"linux",
"x86_64",
Some("x86_64-unknown-linux-gnu")
)]
#[case::linux_x86_64_router_latest_two(
Plugin::Router(RouterVersion::LatestTwo),
"linux",
"x86_64",
Some("x86_64-unknown-linux-gnu")
Expand All @@ -683,8 +732,14 @@ mod tests {
)]
// ### Linux, aarch64 ###
// # Router #
#[case::linux_aarch64_router_latest(
Plugin::Router(RouterVersion::Latest),
#[case::linux_aarch64_router_latest_one(
Plugin::Router(RouterVersion::LatestOne),
"linux",
"aarch64",
Some("aarch64-unknown-linux-gnu")
)]
#[case::linux_aarch64_router_latest_two(
Plugin::Router(RouterVersion::LatestTwo),
"linux",
"aarch64",
Some("aarch64-unknown-linux-gnu")
Expand Down Expand Up @@ -757,7 +812,7 @@ mod tests {
#[test]
#[cfg(target_env = "musl")]
fn test_plugin_version_should_fail() {
Plugin::Router(RouterVersion::Latest)
Plugin::Router(RouterVersion::LatestTwo)
.get_arch_for_env("", "")
.unwrap_err();
}
Expand Down