Skip to content

Commit

Permalink
fix(rover): store SupergraphConfig in BTreeMap
Browse files Browse the repository at this point in the history
SupergraphConfig was previously stored in a HashMap, the implementation
of which is non-deterministic in Rust. This commit changes it over to a
BTreeMap which ensures correct ordering.

closes #422
  • Loading branch information
lrlna committed Apr 6, 2021
1 parent 5a9f5ba commit beb50b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions installers/npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/command/supergraph/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ use camino::Utf8PathBuf;
use harmonizer::ServiceDefinition as SubgraphDefinition;
use serde::{Deserialize, Serialize};

use std::collections::HashMap;
use std::collections::BTreeMap;

use std::fs;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct SupergraphConfig {
pub(crate) subgraphs: HashMap<String, Subgraph>,
// Store config in a BTreeMap, as HashMap is non-deterministic.
pub(crate) subgraphs: BTreeMap<String, Subgraph>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down

0 comments on commit beb50b1

Please sign in to comment.