Skip to content

Commit e257a8e

Browse files
fix(ci): pin to specific stable rust version (#287)
This commit pins the rust-toolchain to a specific rust version (1.89.0) for compatibility guarantees. Renovate will handle warning on outdated versions of stable rust. A minimal supported rust version was also added to the underlying crates to ensure compatibility guarantees as the stable verison increments in future updates.
1 parent 8c4e705 commit e257a8e

File tree

13 files changed

+143
-114
lines changed

13 files changed

+143
-114
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### ci: Pin stable rust version ([Issue #287](https://github.com/apollographql/apollo-mcp-server/issues/287))
2+
3+
Pins the stable version of Rust to the current latest version to ensure backwards compatibility with future versions.

.github/renovate.json5

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
11
{
2+
// Allow for intellisense in editors
3+
$schema: "https://docs.renovatebot.com/renovate-schema.json",
4+
5+
// List of rules to apply
26
extends: [
7+
// Recommended best practices from renovate itself
8+
// See: https://docs.renovatebot.com/upgrade-best-practices/#whats-in-the-configbest-practices-preset
9+
"config:best-practices",
10+
11+
// Apply our own internal best practices
12+
// See: https://github.com/apollographql/apollo-mcp-server/commits/main/.github/renovate.json5
313
"github>apollographql/renovate-config-apollo-open-source:default.json5",
14+
15+
// Update to the latest rust stable version as it releases.
16+
// See: https://github.com/Turbo87/renovate-config/blob/master/rust/updateToolchain.json
417
"github>Turbo87/renovate-config//rust/updateToolchain",
518
],
19+
20+
// Globally disable all automatic update PRs from renovate
621
packageRules: [
722
{
823
enabled: false,
924
matchPackageNames: ["*"],
1025
},
1126
],
27+
1228
// Automating Nix upgrades is currently in beta and opt-in only.
1329
// https://docs.renovatebot.com/modules/manager/nix/
1430
nix: {
1531
enabled: true,
1632
},
33+
34+
// Globally enable vulnerability alerts
35+
//
36+
// Note: This needs extra configuration at the repository level, which is described in the link
37+
// below.
38+
//
39+
// See: https://docs.renovatebot.com/configuration-options/#vulnerabilityalerts
1740
vulnerabilityAlerts: {
1841
enabled: true,
1942
},
43+
44+
// Disable automatically updating lock files to latest versions once a week.
45+
//
46+
// See: https://docs.renovatebot.com/configuration-options/#lockfilemaintenance
2047
lockFileMaintenance: {
2148
enabled: false,
2249
},

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ members = [
88

99
[workspace.package]
1010
authors = ["Apollo <[email protected]>"]
11+
edition = "2024"
12+
license-file = "LICENSE"
13+
repository = "https://github.com/apollographql/apollo-mcp-server"
14+
rust-version = "1.89.0"
1115
version = "0.7.5"
1216

1317
[workspace.dependencies]

crates/apollo-mcp-registry/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[package]
22
name = "apollo-mcp-registry"
3-
version.workspace = true
4-
edition = "2024"
53
authors.workspace = true
6-
license-file = "../LICENSE"
7-
repository = "https://github.com/apollographql/apollo-mcp-server"
4+
edition.workspace = true
5+
license-file.workspace = true
6+
repository.workspace = true
7+
rust-version.workspace = true
8+
version.workspace = true
9+
810
description = "Registry providing schema and operations to the MCP Server"
911

1012
[dependencies]

crates/apollo-mcp-registry/src/uplink.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,11 @@ where
402402
.send()
403403
.await
404404
.inspect_err(|e| {
405-
if let Some(hyper_err) = e.source() {
406-
if let Some(os_err) = hyper_err.source() {
407-
if os_err.to_string().contains("tcp connect error: Cannot assign requested address (os error 99)") {
408-
tracing::warn!("If your MCP server is executing within a kubernetes pod, this failure may be caused by istio-proxy injection. See https://github.com/apollographql/router/issues/3533 for more details about how to solve this");
409-
}
410-
}
405+
if let Some(hyper_err) = e.source() &&
406+
let Some(os_err) = hyper_err.source() &&
407+
os_err.to_string().contains("tcp connect error: Cannot assign requested address (os error 99)")
408+
{
409+
tracing::warn!("If your MCP server is executing within a kubernetes pod, this failure may be caused by istio-proxy injection. See https://github.com/apollographql/router/issues/3533 for more details about how to solve this");
411410
}
412411
})?;
413412
tracing::debug!("uplink response {:?}", res);

crates/apollo-mcp-registry/src/uplink/schema.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,6 @@ impl SchemaSource {
181181
}
182182
}
183183

184-
#[derive(thiserror::Error, Debug)]
185-
enum FetcherError {
186-
#[error("failed to build http client")]
187-
InitializationError(#[from] reqwest::Error),
188-
}
189-
190184
// Encapsulates fetching the schema from the first viable url.
191185
// It will try each url in order until it finds one that works.
192186
#[allow(clippy::unwrap_used)] // TODO - existing unwrap from router code

crates/apollo-mcp-server/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
[package]
22
name = "apollo-mcp-server"
3-
version.workspace = true
43
authors.workspace = true
5-
edition = "2024"
6-
license-file = "../LICENSE"
4+
edition.workspace = true
5+
license-file.workspace = true
6+
repository.workspace = true
7+
rust-version.workspace = true
8+
version.workspace = true
9+
710
default-run = "apollo-mcp-server"
811

912
[dependencies]

crates/apollo-mcp-server/src/operations.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,11 @@ pub fn variable_description_overrides(
490490
let comment = last_offset
491491
.map(|start_offset| &source_text[start_offset..source_span.offset()]);
492492

493-
if let Some(description) = comment.filter(|d| !d.is_empty() && d.contains('#')) {
494-
if let Some(description) =
493+
if let Some(description) = comment.filter(|d| !d.is_empty() && d.contains('#'))
494+
&& let Some(description) =
495495
extract_and_format_comments(Some(description.to_string()))
496-
{
497-
argument_overrides_map.insert(v.name.to_string(), description);
498-
}
496+
{
497+
argument_overrides_map.insert(v.name.to_string(), description);
499498
}
500499

501500
last_offset = Some(source_span.end_offset());
@@ -731,16 +730,15 @@ impl Operation {
731730
}
732731

733732
fn ensure_properties_exists(json_object: &mut Value) {
734-
if let Some(obj_type) = json_object.get("type") {
735-
if obj_type == "object" {
736-
if let Some(obj_map) = json_object.as_object_mut() {
737-
let props = obj_map
738-
.entry("properties")
739-
.or_insert_with(|| Value::Object(serde_json::Map::new()));
740-
if !props.is_object() {
741-
*props = Value::Object(serde_json::Map::new());
742-
}
743-
}
733+
if let Some(obj_type) = json_object.get("type")
734+
&& obj_type == "object"
735+
&& let Some(obj_map) = json_object.as_object_mut()
736+
{
737+
let props = obj_map
738+
.entry("properties")
739+
.or_insert_with(|| Value::Object(serde_json::Map::new()));
740+
if !props.is_object() {
741+
*props = Value::Object(serde_json::Map::new());
744742
}
745743
}
746744
}

crates/apollo-mcp-server/src/schema_tree_shake.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -532,16 +532,15 @@ fn retain_argument_descriptions(
532532
) {
533533
let operation_argument_name = operation_arguments.get(arg.name.as_str());
534534

535-
if let Some(op_arg_name) = operation_argument_name {
536-
if let Some(description) = arg.description.as_deref() {
537-
if !description.trim().is_empty() {
538-
let descriptions = tree_shaker
539-
.arguments_descriptions
540-
.entry(op_arg_name.to_string())
541-
.or_default();
542-
descriptions.push(description.trim().to_string())
543-
}
544-
}
535+
if let Some(op_arg_name) = operation_argument_name
536+
&& let Some(description) = arg.description.as_deref()
537+
&& !description.trim().is_empty()
538+
{
539+
let descriptions = tree_shaker
540+
.arguments_descriptions
541+
.entry(op_arg_name.to_string())
542+
.or_default();
543+
descriptions.push(description.trim().to_string())
545544
}
546545
}
547546

crates/apollo-schema-index/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[package]
22
name = "apollo-schema-index"
3-
edition = "2024"
43
authors.workspace = true
4+
edition.workspace = true
5+
license-file.workspace = true
6+
repository.workspace = true
7+
rust-version.workspace = true
58
version.workspace = true
6-
license-file = "../LICENSE"
7-
repository = "https://github.com/apollographql/apollo-mcp-server"
9+
810
description = "GraphQL schema indexing"
911

1012
[dependencies]

0 commit comments

Comments
 (0)