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

ROVER-135 Make paths in supergraph.yaml resolve relative to the location of the file, not the current working directory of Rover #2119

Merged
merged 7 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ apollo-parser = "0.8"
apollo-encoder = "0.8"

# https://github.com/apollographql/federation-rs
apollo-federation-types = "0.13.2"
apollo-federation-types = { git = "https://github.com/apollographql/federation-rs", branch = "jr/ROVER-135" }

# crates.io dependencies
ariadne = "0.4"
Expand Down
20 changes: 13 additions & 7 deletions src/error/metadata/suggestion.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use std::cmp::Ordering;
use std::fmt::{self, Display, Write as _};

use crate::utils::env::RoverEnvKey;
use camino::Utf8PathBuf;
use rover_client::shared::GraphRef;
use rover_std::Style;

use crate::utils::env::RoverEnvKey;
use std::cmp::Ordering;
use std::fmt::{self, Display, Write as _};

use serde::Serialize;

Expand Down Expand Up @@ -79,6 +78,10 @@ pub enum RoverErrorSuggestion {
frontend_url_root: String,
},
AddRoutingUrlToSupergraphYaml,
InvalidSupergraphYamlSubgraphSchemaPath {
subgraph_name: String,
supergraph_yaml_path: Utf8PathBuf,
},
PublishSubgraphWithRoutingUrl {
subgraph_name: String,
graph_ref: String,
Expand Down Expand Up @@ -256,8 +259,11 @@ UpgradePlan => "Rover has likely reached rate limits while running graph or subg
format!("Try publishing the subgraph with a routing URL like so `rover subgraph publish {graph_ref} --name {subgraph_name} --routing-url <url>`")
},
AllowInvalidRoutingUrlOrSpecifyValidUrl => format!("Try publishing the subgraph with a valid routing URL. If you are sure you want to publish an invalid routing URL, re-run this command with the {} option.", Style::Command.paint("`--allow-invalid-routing-url`")),
ContactApolloAccountManager => {"Discuss your requirements with your Apollo point of contact.".to_string()}
TryAgainLater => {"Please try again later.".to_string()}
ContactApolloAccountManager => {"Discuss your requirements with your Apollo point of contact.".to_string()},
TryAgainLater => {"Please try again later.".to_string()},
InvalidSupergraphYamlSubgraphSchemaPath {
subgraph_name, supergraph_yaml_path
} => format!("Make sure the specified path for subgraph '{}' is relative to the location of the supergraph schema file ({})", subgraph_name, Style::Path.paint(supergraph_yaml_path))
};
write!(formatter, "{}", &suggestion)
}
Expand Down
Loading
Loading