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

merge dev #5940

Merged
merged 21 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cf47285
Remove experimental label from apollo usage reporting configs
bonnici Aug 13, 2024
47fbe90
Changeset and rename
bonnici Aug 13, 2024
daa082e
Merge branch 'dev' into njm/P-988/apollo-telemetry-config
bonnici Aug 27, 2024
ae67c79
Remove experimental_apollo_metrics_generation_mode
bonnici Aug 27, 2024
b48469a
Merge branch 'dev' into njm/P-988/apollo-telemetry-config
bonnici Aug 27, 2024
ec52860
Fix changelog and a yaml config
bonnici Aug 28, 2024
1db48f7
Restore test YAML file
bonnici Aug 28, 2024
2fb7a37
Fix typo
bonnici Aug 28, 2024
7288ed5
Merge branch 'dev' into njm/P-988/apollo-telemetry-config
bonnici Aug 29, 2024
089cbc1
Fix aws-sdk-sso to 1.39.0 (#5924)
Geal Aug 30, 2024
7f19682
Fix versions for aws-sdk-ssooidc and aws-sdk-sts (#5926)
Geal Aug 30, 2024
1f87295
feat: ease of use debugging (#5850)
cyberhck Aug 30, 2024
27cf712
Merge branch 'dev' into njm/P-988/apollo-telemetry-config
bonnici Sep 1, 2024
863d0bc
fix(federation): test directives on fragment spreads (#5785)
goto-bus-stop Sep 2, 2024
0f4622c
fix(federation): treat invalid subgraph operations as internal errors…
goto-bus-stop Sep 2, 2024
5bdb81c
Update .changesets/config_apollo_telemetry_config_rename.md
bonnici Sep 3, 2024
1d677bd
Merge branch 'dev' into njm/P-988/apollo-telemetry-config
bonnici Sep 3, 2024
7499c16
Remove experimental label from apollo usage reporting configs (#5807)
bonnici Sep 3, 2024
85bda8f
Paginate redis scan pages properly and don't use Notify anymore for e…
bnjjj Sep 3, 2024
036cab8
Merge branch 'dev' into lb/connectors/merge-dev
lennyburdette Sep 3, 2024
21a05d7
try upgrading xcode to 15.4.0
lennyburdette Sep 3, 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
10 changes: 10 additions & 0 deletions .changesets/config_apollo_telemetry_config_rename.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Remove experimental label from apollo usage reporting configs ([#5807](https://github.com/apollographql/router/pull/5807))

All known issues related to the new Apollo usage report generation have been resolved so we are renaming some experimental options to be non-experimental.
* `telemetry.apollo.experimental_apollo_metrics_reference_mode` is now `telemetry.apollo.metrics_reference_mode`
* `telemetry.apollo.experimental_apollo_signature_normalization_algorithm` is now `telemetry.apollo.signature_normalization_algorithm`
* `experimental_apollo_metrics_generation_mode` has been removed since the Rust implementation has been the default since v1.49.0 and it is generating reports identical to the router-bridge implementation

Previous configuration will warn but still work.

By [@bonnici](https://github.com/bonnici) in https://github.com/apollographql/router/pull/5807
7 changes: 7 additions & 0 deletions .changesets/config_musket_minute_linen_kitchen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Include hostname on heaptrack path, specify pod lifecycle ([Issue #5789](https://github.com/apollographql/router/issues/5789))

Use hostname in the heaptrack path to identify an individual container/instance/machine where the router is running. This means the filepath for heaptrack output will change.

Additionally, allow the specification of restartPolicy on deployment (defaults to `Always` which is kubernetes default)

By [@cyberhck](https://github.com/cyberhck) in https://github.com/apollographql/router/pull/5850
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ executors:
# See https://circleci.com/docs/xcode-policy along with the support matrix
# at https://circleci.com/docs/using-macos#supported-xcode-versions.
# We use the major.minor notation to bring in compatible patches.
xcode: "14.2.0"
xcode: "15.4.0"
resource_class: macos.m1.medium.gen1
macos_test: &macos_test_executor
macos:
Expand All @@ -57,7 +57,7 @@ executors:
# TODO: remove workaround added in https://github.com/apollographql/router/pull/5462
# once we update to Xcode >= 15.1.0
# See: https://github.com/apollographql/router/pull/5462
xcode: "14.2.0"
xcode: "15.4.0"
resource_class: macos.m1.medium.gen1
windows_build: &windows_build_executor
machine:
Expand Down Expand Up @@ -743,20 +743,20 @@ jobs:
command: |
# Source of the new image will be ser to the repo URL.
# This will have the effect of setting org.opencontainers.image.source and org.opencontainers.image.author to the originating pipeline
# Therefore the docker image will have the same permissions as the originating project.
# Therefore the docker image will have the same permissions as the originating project.
# See: https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package#connecting-a-repository-to-a-container-image-using-the-command-line

BASE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq --raw-output '.packages[0].version')
ARTIFACT_URL="https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/artifacts/router-v${BASE_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
VERSION="v$(echo "${BASE_VERSION}" | tr "+" "-")"
ROUTER_TAG=ghcr.io/apollographql/nightly/router

echo "REPO_URL: ${REPO_URL}"
echo "BASE_VERSION: ${BASE_VERSION}"
echo "ARTIFACT_URL: ${ARTIFACT_URL}"
echo "VERSION: ${VERSION}"
echo "ROUTER_TAG: ${ROUTER_TAG}"

# Create a multi-arch builder which works properly under qemu
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker context create buildx-build
Expand Down
35 changes: 21 additions & 14 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ dependencies = [
"async-trait",
"aws-config",
"aws-credential-types",
"aws-sdk-sso",
"aws-sdk-ssooidc",
"aws-sdk-sts",
"aws-sigv4",
"aws-smithy-runtime-api",
"aws-types",
Expand Down Expand Up @@ -958,9 +961,9 @@ dependencies = [

[[package]]
name = "aws-runtime"
version = "1.3.1"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87c5f920ffd1e0526ec9e70e50bf444db50b204395a0fa7016bbf9e31ea1698f"
checksum = "f42c2d4218de4dcd890a109461e2f799a1a2ba3bcd2cde9af88360f5df9266c6"
dependencies = [
"aws-credential-types",
"aws-sigv4",
Expand All @@ -973,6 +976,7 @@ dependencies = [
"fastrand 2.1.0",
"http 0.2.12",
"http-body 0.4.6",
"once_cell",
"percent-encoding",
"pin-project-lite",
"tracing",
Expand All @@ -981,9 +985,9 @@ dependencies = [

[[package]]
name = "aws-sdk-sso"
version = "1.35.0"
version = "1.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc3ef4ee9cdd19ec6e8b10d963b79637844bbf41c31177b77a188eaa941e69f7"
checksum = "11822090cf501c316c6f75711d77b96fba30658e3867a7762e5e2f5d32d31e81"
dependencies = [
"aws-credential-types",
"aws-runtime",
Expand All @@ -1003,9 +1007,9 @@ dependencies = [

[[package]]
name = "aws-sdk-ssooidc"
version = "1.36.0"
version = "1.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "527f3da450ea1f09f95155dba6153bd0d83fe0923344a12e1944dfa5d0b32064"
checksum = "78a2a06ff89176123945d1bbe865603c4d7101bea216a550bb4d2e4e9ba74d74"
dependencies = [
"aws-credential-types",
"aws-runtime",
Expand All @@ -1025,9 +1029,9 @@ dependencies = [

[[package]]
name = "aws-sdk-sts"
version = "1.35.0"
version = "1.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94316606a4aa2cb7a302388411b8776b3fbd254e8506e2dc43918286d8212e9b"
checksum = "a20a91795850826a6f456f4a48eff1dfa59a0e69bdbf5b8c50518fd372106574"
dependencies = [
"aws-credential-types",
"aws-runtime",
Expand Down Expand Up @@ -1121,9 +1125,9 @@ dependencies = [

[[package]]
name = "aws-smithy-runtime"
version = "1.6.2"
version = "1.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce87155eba55e11768b8c1afa607f3e864ae82f03caf63258b37455b0ad02537"
checksum = "0abbf454960d0db2ad12684a1640120e7557294b0ff8e2f11236290a1b293225"
dependencies = [
"aws-smithy-async",
"aws-smithy-http",
Expand All @@ -1148,9 +1152,9 @@ dependencies = [

[[package]]
name = "aws-smithy-runtime-api"
version = "1.7.1"
version = "1.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30819352ed0a04ecf6a2f3477e344d2d1ba33d43e0f09ad9047c12e0d923616f"
checksum = "e086682a53d3aa241192aa110fa8dfce98f2f5ac2ead0de84d41582c7e8fdb96"
dependencies = [
"aws-smithy-async",
"aws-smithy-types",
Expand All @@ -1165,13 +1169,14 @@ dependencies = [

[[package]]
name = "aws-smithy-types"
version = "1.2.0"
version = "1.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfe321a6b21f5d8eabd0ade9c55d3d0335f3c3157fc2b3e87f05f34b539e4df5"
checksum = "273dcdfd762fae3e1650b8024624e7cd50e484e37abdab73a7a706188ad34543"
dependencies = [
"base64-simd",
"bytes",
"bytes-utils",
"futures-core",
"http 0.2.12",
"http 1.1.0",
"http-body 0.4.6",
Expand All @@ -1184,6 +1189,8 @@ dependencies = [
"ryu",
"serde",
"time",
"tokio",
"tokio-util",
]

[[package]]
Expand Down
8 changes: 8 additions & 0 deletions apollo-federation/src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use apollo_compiler::executable::GetOperationError;
use apollo_compiler::validation::DiagnosticList;
use apollo_compiler::validation::WithErrors;
use apollo_compiler::InvalidNameError;
use apollo_compiler::Name;
use lazy_static::lazy_static;

use crate::subgraph::spec::FederationSpecError;
Expand Down Expand Up @@ -59,6 +60,8 @@ pub enum SingleFederationError {
InvalidSubgraph { message: String },
#[error("Operation name not found")]
UnknownOperation,
#[error("Unsupported custom directive @{name} on fragment spread. Due to query transformations during planning, the router requires directives on fragment spreads to support both the FRAGMENT_SPREAD and INLINE_FRAGMENT locations.")]
UnsupportedSpreadDirective { name: Name },
#[error("{message}")]
DirectiveDefinitionInvalid { message: String },
#[error("{message}")]
Expand Down Expand Up @@ -228,7 +231,12 @@ impl SingleFederationError {
SingleFederationError::InvalidGraphQL { .. }
| SingleFederationError::InvalidGraphQLName(_) => ErrorCode::InvalidGraphQL,
SingleFederationError::InvalidSubgraph { .. } => ErrorCode::InvalidGraphQL,
// TODO(@goto-bus-stop): this should have a different error code: it's not the graphql
// that's invalid, but the operation name
SingleFederationError::UnknownOperation => ErrorCode::InvalidGraphQL,
// TODO(@goto-bus-stop): this should have a different error code: it's not invalid,
// just unsupported due to internal limitations.
SingleFederationError::UnsupportedSpreadDirective { .. } => ErrorCode::InvalidGraphQL,
SingleFederationError::DirectiveDefinitionInvalid { .. } => {
ErrorCode::DirectiveDefinitionInvalid
}
Expand Down
19 changes: 19 additions & 0 deletions apollo-federation/src/operation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3333,6 +3333,25 @@ impl InlineFragmentSelection {
parent_type_position: CompositeTypeDefinitionPosition,
fragment_spread_selection: &Arc<FragmentSpreadSelection>,
) -> Result<InlineFragmentSelection, FederationError> {
let schema = fragment_spread_selection.spread.schema.schema();
for directive in fragment_spread_selection.spread.directives.iter() {
let Some(definition) = schema.directive_definitions.get(&directive.name) else {
return Err(FederationError::internal(format!(
"Undefined directive {}",
directive.name
)));
};
if !definition
.locations
.contains(&apollo_compiler::schema::DirectiveLocation::InlineFragment)
{
return Err(SingleFederationError::UnsupportedSpreadDirective {
name: directive.name.clone(),
}
.into());
}
}

// Note: We assume that fragment_spread_selection.spread.type_condition_position is the same as
// fragment_spread_selection.selection_set.type_position.
Ok(InlineFragmentSelection::new(
Expand Down
60 changes: 0 additions & 60 deletions apollo-federation/src/operation/optimize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3205,66 +3205,6 @@ mod tests {
/// applied directives
///

#[test]
#[should_panic(expected = "directive is not supported for FRAGMENT_DEFINITION")]
// XXX(@goto-bus-stop): this test does not make sense, we should remove this feature
fn reuse_fragments_with_same_directive_on_the_fragment() {
let schema_doc = r#"
type Query {
t1: T
t2: T
t3: T
}

type T {
a: Int
b: Int
c: Int
d: Int
}
"#;

let query = r#"
fragment DirectiveOnDef on T @include(if: $cond1) {
a
}

query myQuery($cond1: Boolean!, $cond2: Boolean!) {
t1 {
...DirectiveOnDef
}
t2 {
... on T @include(if: $cond2) {
a
}
}
t3 {
...DirectiveOnDef @include(if: $cond2)
}
}
"#;

test_fragments_roundtrip!(schema_doc, query, @r###"
query myQuery($cond1: Boolean!, $cond2: Boolean!) {
t1 {
... on T @include(if: $cond1) {
a
}
}
t2 {
... on T @include(if: $cond2) {
a
}
}
t3 {
... on T @include(if: $cond1) @include(if: $cond2) {
a
}
}
}
"###);
}

#[test]
fn reuse_fragments_with_same_directive_in_the_fragment_selection() {
let schema_doc = r#"
Expand Down
Loading