Skip to content

Commit

Permalink
feat(supergraph merge): respect desired fed version
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronArinder committed Sep 3, 2024
1 parent 7e152ea commit 24a5530
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/utils/supergraph_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ fn merge_supergraph_configs(
merged_config.set_federation_version(federation_version);
Some(merged_config)
}
// WARNING: this ignores the target fed version; should we ignore it?
(None, Some(local_config)) => Some(local_config),
(None, Some(local_config)) => {
let federation_version =
resolve_federation_version(target_federation_version.cloned(), &local_config);
let mut merged_config = local_config;
merged_config.set_federation_version(federation_version);
Some(merged_config)
}
(None, None) => None,
}
}
Expand Down Expand Up @@ -216,14 +221,12 @@ mod test_merge_supergraph_configs {
// Expected because local has fed one
FederationVersion::LatestFedOne
)]
// WARNING: this is current behavior, we might switch it to respect the target
#[case::no_remote_and_local_with_target(
TestCase::NoRemoteLocalWithTarget,
// Target is fed two because local has fed one
Some(FederationVersion::LatestFedTwo),
// Expected because target
// WARNING: note that this isn't the target
FederationVersion::LatestFedOne
FederationVersion::LatestFedTwo
)]
#[case::no_remote_and_local_without_target(
TestCase::NoRemoteLocalWithoutTarget,
Expand Down

0 comments on commit 24a5530

Please sign in to comment.