Skip to content

Commit 8402596

Browse files
committed
Use Apollo Router 2.x by default
1 parent bac49f5 commit 8402596

File tree

8 files changed

+86
-22
lines changed

8 files changed

+86
-22
lines changed

.github/workflows/run-smokes-on-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
working-directory: ".github/scripts"
2828
run: |
2929
ls -al
30-
JSON=$(source get_latest_x_versions.sh 1 apollographql router router latest-1 1)
30+
JSON=$(source get_latest_x_versions.sh 1 apollographql router router latest-2 2)
3131
echo "router_versions=$JSON" >> "$GITHUB_OUTPUT"
3232
- name: "Get latest Supergraph Plugin versions"
3333
id: "supergraph-versions"

.github/workflows/run-smokes-scheduled.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
name: "Install `semver` cli"
1919
- run: |
2020
ls -al
21-
JSON=$(source get_latest_x_versions.sh 3 apollographql router router latest-1 1)
21+
ROUTER1_VERSIONS=$(source get_latest_x_versions.sh 3 apollographql router router latest-1 1)
22+
ROUTER2_VERSIONS=$(source get_latest_x_versions.sh 3 apollographql router router latest-2 2)
23+
JSON=$(echo "$ROUTER1_VERSIONS $ROUTER2_VERSIONS" | jq -cs 'add')
2224
echo "router_versions=$JSON" >> "$GITHUB_OUTPUT"
2325
id: "router-versions"
2426
working-directory: ".github/scripts"

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
2020

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

23+
## 🚀 Features
24+
25+
- **Default to Apollo Router 2.x for `rover dev` - @pubmodmatt PR #XXXX**
26+
27+
The default version of Apollo Router used by `rover dev` is now 2.x instead of 1.x. The default can be overridden by
28+
setting `APOLLO_ROVER_DEV_ROUTER_VERSION`, for example `APOLLO_ROVER_DEV_ROUTER_VERSION=1.61.0`.
29+
2330
## 🐛 Fixes
2431

2532
- **Fix formatting of table output by `rover config whoami` - @pubmodmatt PR #2413**

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ apollo-parser = "0.8"
6969
apollo-encoder = "0.8"
7070

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

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

src/command/dev/do_dev.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl Dev {
146146

147147
let router_version = match &*OVERRIDE_DEV_ROUTER_VERSION {
148148
Some(version) => RouterVersion::Exact(Version::parse(version)?),
149-
None => RouterVersion::Latest,
149+
None => RouterVersion::LatestTwo,
150150
};
151151

152152
let api_key_override = match std::env::var(RoverEnvKey::Key.to_string()) {

src/command/dev/router/install.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ mod tests {
139139

140140
#[fixture]
141141
fn router_version() -> RouterVersion {
142-
RouterVersion::Latest
142+
RouterVersion::LatestTwo
143143
}
144144

145145
#[fixture]

src/command/install/plugin.rs

+70-15
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl Plugin {
127127
Err(no_prebuilt_binaries)
128128
}
129129
}
130-
RouterVersion::Latest => Ok("aarch64-unknown-linux-gnu")
130+
RouterVersion::LatestOne | RouterVersion::LatestTwo => Ok("aarch64-unknown-linux-gnu")
131131
}
132132
}
133133
}
@@ -248,7 +248,7 @@ impl PluginInstaller {
248248
.ok_or_else(|| could_not_install_plugin(&plugin.get_name(), &version))
249249
}
250250
}
251-
RouterVersion::Latest => {
251+
RouterVersion::LatestOne => {
252252
let major_version = 1;
253253
if skip_update {
254254
self.find_existing_latest_major(plugin, major_version)?
@@ -267,6 +267,25 @@ impl PluginInstaller {
267267
})
268268
}
269269
}
270+
RouterVersion::LatestTwo => {
271+
let major_version = 2;
272+
if skip_update {
273+
self.find_existing_latest_major(plugin, major_version)?
274+
.ok_or_else(|| {
275+
skip_update_err(
276+
&plugin.get_name(),
277+
major_version.to_string().as_str(),
278+
)
279+
})
280+
} else {
281+
self.install_latest_major(plugin).await?.ok_or_else(|| {
282+
could_not_install_plugin(
283+
&plugin.get_name(),
284+
major_version.to_string().as_str(),
285+
)
286+
})
287+
}
288+
}
270289
},
271290
Plugin::Supergraph(version) => match version {
272291
FederationVersion::ExactFedOne(version)
@@ -500,8 +519,14 @@ mod tests {
500519
#[rstest]
501520
// #### macOS, x86_64 ####
502521
// # Router #
503-
#[case::macos_x86_64_router_latest(
504-
Plugin::Router(RouterVersion::Latest),
522+
#[case::macos_x86_64_router_latest_one(
523+
Plugin::Router(RouterVersion::LatestOne),
524+
"macos",
525+
"x86_64",
526+
Some("x86_64-apple-darwin")
527+
)]
528+
#[case::macos_x86_64_router_latest_two(
529+
Plugin::Router(RouterVersion::LatestTwo),
505530
"macos",
506531
"x86_64",
507532
Some("x86_64-apple-darwin")
@@ -546,8 +571,14 @@ mod tests {
546571
)]
547572
// ### macOS, aarch64 ###
548573
// # Router #
549-
#[case::macos_aarch64_router_latest(
550-
Plugin::Router(RouterVersion::Latest),
574+
#[case::macos_aarch64_router_latest_one(
575+
Plugin::Router(RouterVersion::LatestOne),
576+
"macos",
577+
"aarch64",
578+
Some("aarch64-apple-darwin")
579+
)]
580+
#[case::macos_aarch64_router_latest_two(
581+
Plugin::Router(RouterVersion::LatestTwo),
551582
"macos",
552583
"aarch64",
553584
Some("aarch64-apple-darwin")
@@ -613,8 +644,14 @@ mod tests {
613644
)]
614645
// ### macOS, "" ###
615646
// # Router #
616-
#[case::macos_empty_router_latest(
617-
Plugin::Router(RouterVersion::Latest),
647+
#[case::macos_empty_router_latest_one(
648+
Plugin::Router(RouterVersion::LatestOne),
649+
"macos",
650+
"",
651+
Some("x86_64-apple-darwin")
652+
)]
653+
#[case::macos_empty_router_latest_two(
654+
Plugin::Router(RouterVersion::LatestTwo),
618655
"macos",
619656
"",
620657
Some("x86_64-apple-darwin")
@@ -653,8 +690,14 @@ mod tests {
653690
)]
654691
// ### Windows, "" ###
655692
// # Router #
656-
#[case::windows_empty_router_latest(
657-
Plugin::Router(RouterVersion::Latest),
693+
#[case::windows_empty_router_latest_one(
694+
Plugin::Router(RouterVersion::LatestOne),
695+
"windows",
696+
"",
697+
Some("x86_64-pc-windows-msvc")
698+
)]
699+
#[case::windows_empty_router_latest_two(
700+
Plugin::Router(RouterVersion::LatestTwo),
658701
"windows",
659702
"",
660703
Some("x86_64-pc-windows-msvc")
@@ -668,8 +711,14 @@ mod tests {
668711
)]
669712
// ### Linux, x86_64 ###
670713
// # Router #
671-
#[case::linux_x86_64_router_latest(
672-
Plugin::Router(RouterVersion::Latest),
714+
#[case::linux_x86_64_router_latest_one(
715+
Plugin::Router(RouterVersion::LatestOne),
716+
"linux",
717+
"x86_64",
718+
Some("x86_64-unknown-linux-gnu")
719+
)]
720+
#[case::linux_x86_64_router_latest_two(
721+
Plugin::Router(RouterVersion::LatestTwo),
673722
"linux",
674723
"x86_64",
675724
Some("x86_64-unknown-linux-gnu")
@@ -683,8 +732,14 @@ mod tests {
683732
)]
684733
// ### Linux, aarch64 ###
685734
// # Router #
686-
#[case::linux_aarch64_router_latest(
687-
Plugin::Router(RouterVersion::Latest),
735+
#[case::linux_aarch64_router_latest_one(
736+
Plugin::Router(RouterVersion::LatestOne),
737+
"linux",
738+
"aarch64",
739+
Some("aarch64-unknown-linux-gnu")
740+
)]
741+
#[case::linux_aarch64_router_latest_two(
742+
Plugin::Router(RouterVersion::LatestTwo),
688743
"linux",
689744
"aarch64",
690745
Some("aarch64-unknown-linux-gnu")
@@ -757,7 +812,7 @@ mod tests {
757812
#[test]
758813
#[cfg(target_env = "musl")]
759814
fn test_plugin_version_should_fail() {
760-
Plugin::Router(RouterVersion::Latest)
815+
Plugin::Router(RouterVersion::LatestTwo)
761816
.get_arch_for_env("", "")
762817
.unwrap_err();
763818
}

0 commit comments

Comments
 (0)