Skip to content

Commit 6f2abd3

Browse files
feat: updates harmonizer to v0.30.0 (#832)
* feat: updates harmonizer to v0.30.0 * docs: adds gateway compatibility section to compose docs * chore: address trevor's review comments * docs: rewrite gateway compat content Co-authored-by: Jesse Rosenberger <[email protected]> * chore: add --branch to xtask integration-test * chore: add --org to xtask integration-test * docs: clarify @tag repeatable requirements * chore: updates harmonizer to v0.33.0 * docs: removes unnecessary breaking change * docs: polish gateway compat Co-authored-by: Jesse Rosenberger <[email protected]>
1 parent d271cbd commit 6f2abd3

File tree

6 files changed

+41
-15
lines changed

6 files changed

+41
-15
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ console = "0.14"
5151
crossterm = "0.21"
5252
git-url-parse = "0.3"
5353
git2 = { version = "0.13", default-features = false, features = ["vendored-openssl"] }
54-
harmonizer = { version = "0.27.0", optional = true }
54+
harmonizer = { version = "0.33.0", optional = true }
5555
heck = "0.3"
5656
lazycell = "1"
5757
opener = "0.5"

docs/source/supergraphs.md

+20-7
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ The `supergraph compose` command's `--config` option expects the path to a YAML
3333
subgraphs:
3434
films:
3535
routing_url: https://films.example.com
36-
schema:
36+
schema:
3737
file: ./films.graphql
3838
people:
3939
routing_url: https://people.example.com
40-
schema:
40+
schema:
4141
file: ./people.graphql
4242
```
4343
@@ -49,17 +49,17 @@ It's also possible to pull subgraphs from various sources and specify them in th
4949
subgraphs:
5050
films:
5151
routing_url: https://films.example.com
52-
schema:
52+
schema:
5353
file: ./films.graphql
5454
people:
5555
routing_url: https://example.com/people
56-
schema:
56+
schema:
5757
subgraph_url: https://example.com/people
5858
actors:
5959
routing_url: https://localhost:4005
60-
schema:
61-
graphref: mygraph@current
62-
subgraph: actors
60+
schema:
61+
graphref: mygraph@current
62+
subgraph: actors
6363
```
6464

6565
### Output format
@@ -74,3 +74,16 @@ rover supergraph compose --config ./supergraph.yaml > prod-schema.graphql
7474
```
7575

7676
> For more on passing values via `stdout`, see [Using `stdout`](./conventions#using-stdout).
77+
78+
#### Gateway compatibility
79+
80+
The `rover supergraph compose` command produces a supergraph schema by using composition functions from the [`@apollo/federation`](https://www.apollographql.com/docs/federation/api/apollo-federation/) package. Because that library is still in pre-1.0 releases (as are Rover and Apollo Gateway), some updates to Rover might result in a supergraph schema with new functionality. In turn, this might require corresponding updates to your gateway.
81+
82+
Apollo Gateway fails to start up if it's provided with a supergraph schema that it doesn't support. To ensure compatibility, we recommend that you test launching your gateway in a CI pipeline with the supergraph schema it will ultimately use in production.
83+
84+
We aim to reduce the frequency at which these paired updates are necessary by making supergraph additions backwards compatible. We will note changes that require corresponding Apollo Gateway updates clearly in the Rover _Release Notes_, and we'll also update the following compatibility table.
85+
86+
|Rover version|Gateway version|
87+
|---|---|
88+
|<= v0.2.x|<= v0.38.x|
89+
|>= v0.3.x|>= v0.39.x|

xtask/src/commands/integration_test.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ pub struct IntegrationTest {
99
// The target to build Rover for
1010
#[structopt(long = "target", env = "XTASK_TARGET", default_value, possible_values = &[TARGET_GNU_LINUX])]
1111
pub(crate) target: Target,
12+
13+
// The supergraph-demo branch to check out
14+
#[structopt(long = "branch", default_value = "main")]
15+
pub(crate) branch: String,
16+
17+
// The supergraph-demo org to clone
18+
#[structopt(long = "org", default_value = "apollographql")]
19+
pub(crate) org: String,
1220
}
1321

1422
impl IntegrationTest {
@@ -22,7 +30,7 @@ impl IntegrationTest {
2230
MakeRunner::new(verbose, cargo_runner.get_bin_path(&self.target, release)?)?;
2331
cargo_runner.build(&self.target, release, None)?;
2432

25-
let repo_path = git_runner.clone_supergraph_demo()?;
33+
let repo_path = git_runner.clone_supergraph_demo(&self.org, &self.branch)?;
2634
make_runner.test_supergraph_demo(&repo_path)?;
2735
} else {
2836
crate::info!("skipping integration tests for --target {}", &self.target);

xtask/src/commands/test.rs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ impl Test {
1919
unit_test_runner.run(verbose)?;
2020
let integration_test_runner = IntegrationTest {
2121
target: self.target.clone(),
22+
branch: Default::default(),
23+
org: Default::default(),
2224
};
2325
integration_test_runner.run(verbose)?;
2426
Ok(())

xtask/src/tools/git.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ impl GitRunner {
2828
})
2929
}
3030

31-
pub(crate) fn clone_supergraph_demo(&self) -> Result<Utf8PathBuf> {
31+
pub(crate) fn clone_supergraph_demo(&self, org: &str, branch: &str) -> Result<Utf8PathBuf> {
3232
let repo_name = "supergraph-demo";
33-
let repo_url = format!("https://github.com/apollographql/{}", repo_name);
34-
self.runner
35-
.exec(&["clone", &repo_url], &self.temp_dir_path, None)?;
33+
let repo_url = format!("https://github.com/{}/{}", org, repo_name);
34+
self.runner.exec(
35+
&["clone", &repo_url, "--branch", branch],
36+
&self.temp_dir_path,
37+
None,
38+
)?;
3639

3740
let repo_path = self.temp_dir_path.join(repo_name);
3841
Ok(repo_path)

0 commit comments

Comments
 (0)