feat: Advanced breaking change detection for inputs and arguments for apollo-router-hive-fork (#6906)

Co-authored-by: Dotan Simha <dotansimha@gmail.com>
Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
This commit is contained in:
Emily Goodwin 2025-10-23 10:39:14 -04:00 committed by GitHub
parent abca499545
commit 7fe1c271a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 911 additions and 125 deletions

View file

@ -0,0 +1,11 @@
---
'hive-apollo-router-plugin': minor
---
Advanced breaking change detection for inputs and arguments.
With this change, inputs and arguments will now be collected from the GraphQL operations executed by the router, and will be reported to Hive Console.
Additional references:
- https://github.com/graphql-hive/console/pull/6764
- https://github.com/graphql-hive/console/issues/6649

View file

@ -0,0 +1,5 @@
---
'hive-apollo-router-plugin': patch
---
Update Rust version to 1.90

View file

@ -28,7 +28,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1
with:
toolchain: '1.87.0'
toolchain: '1.90.0'
default: true
override: true

View file

@ -84,7 +84,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1
with:
toolchain: '1.87.0'
toolchain: '1.90.0'
target: ${{ env.RUST_TARGET }}
default: true
override: true

View file

@ -2692,7 +2692,7 @@ dependencies = [
"reqwest",
"reqwest-middleware",
"reqwest-retry",
"schemars 0.8.22",
"schemars 1.0.4",
"serde",
"serde_json",
"sha2",
@ -5269,19 +5269,6 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "schemars"
version = "0.8.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
dependencies = [
"dyn-clone",
"schemars_derive 0.8.22",
"serde",
"serde_json",
"url",
]
[[package]]
name = "schemars"
version = "0.9.0"
@ -5302,24 +5289,12 @@ checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0"
dependencies = [
"dyn-clone",
"ref-cast",
"schemars_derive 1.0.4",
"schemars_derive",
"serde",
"serde_json",
"url",
]
[[package]]
name = "schemars_derive"
version = "0.8.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d"
dependencies = [
"proc-macro2",
"quote",
"serde_derive_internals",
"syn 2.0.104",
]
[[package]]
name = "schemars_derive"
version = "1.0.4"

View file

@ -2,7 +2,7 @@
FROM scratch AS pkg
FROM scratch AS config
FROM rust:1.87 AS build
FROM rust:1.90-slim-bookworm AS build
# Required by Apollo Router
RUN apt-get update

View file

@ -33,7 +33,7 @@ tracing = "0.1"
hyper = { version = "1", features = ["server", "client"] }
async-trait = "0.1.77"
futures = { version = "0.3.30", features = ["thread-pool"] }
schemars = { version = "0.8", features = ["url"] }
schemars = { version = "1.0.4", features = ["url2"] }
serde = "1"
serde_json = "1"
tokio = { version = "1.36.0", features = ["full"] }

View file

@ -136,6 +136,7 @@ pub enum AgentError {
}
impl UsageAgent {
#[allow(clippy::too_many_arguments)]
pub fn new(
schema: String,
token: String,

File diff suppressed because it is too large Load diff

View file

@ -479,7 +479,7 @@ mod hive_persisted_documents_tests {
}
/// Registers a valid artifact URL with an actual GraphQL document
fn add_valid(&self, document_id: &str) -> Mock {
fn add_valid(&'_ self, document_id: &str) -> Mock<'_> {
let valid_artifact_url = format!("/apps/{}", str::replace(document_id, "~", "/"));
let document = "query { __typename }";
let mock = self.server.mock(|when, then| {

View file

@ -27,6 +27,7 @@ pub struct HiveRegistryConfig {
static COMMIT: Option<&'static str> = option_env!("GITHUB_SHA");
impl HiveRegistry {
#[allow(clippy::new_ret_no_self)]
pub fn new(user_config: Option<HiveRegistryConfig>) -> Result<()> {
let mut config = HiveRegistryConfig {
endpoint: None,

View file

@ -38,6 +38,12 @@ pub struct Logger {
max_level: LogLevel,
}
impl Default for Logger {
fn default() -> Self {
Self::new()
}
}
impl Logger {
pub fn new() -> Logger {
Self {

View file

@ -463,7 +463,7 @@ mod hive_usage_tests {
tokio::time::sleep(tokio::time::Duration::from_secs(1))
}
fn activate_usage_mock(&self) -> Mock {
fn activate_usage_mock(&'_ self) -> Mock<'_> {
self.mocked_upstream.mock(|when, then| {
when.method(POST).path("/usage").matches(|r| {
// This mock also validates that the content of the reported usage is valid

4
rust-toolchain.toml Normal file
View file

@ -0,0 +1,4 @@
[toolchain]
channel = "1.90.0"
components = ["rustfmt", "clippy"]
profile = "minimal"