-
Notifications
You must be signed in to change notification settings - Fork 85
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 Dev Rewrite - Install Router Binary #2257
Conversation
✅ Docs Preview ReadyNo new or changed pages found. |
351d824
to
6f8ea7f
Compare
8ab5e55
to
9e3811f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would like to know that the fed version and supergraph version work before approval, otherwise looks good
test-next = "test --all-features" | ||
build-next = "build --features composition-js,dev-next" | ||
|
||
test-next = "test --all-features -- --nocapture" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double-checking that you're wanting that --nocapture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. This was used as a binding in my editor and is to make sure we got traces logged right.
impl RouterBinary { | ||
pub fn new(exe: Utf8PathBuf, version: Version) -> RouterBinary { | ||
RouterBinary { exe, version } | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would we want to use Builder here instead? it seems like an emerging convention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My litmus test has been that more than two arguments equates to wanting a builder. Otherwise, a constructor is usually good enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sg, seems sensible
#[allow(unused)] | ||
pub fn new( | ||
router_version: RouterVersion, | ||
studio_client_config: StudioClientConfig, | ||
) -> InstallRouter { | ||
InstallRouter { | ||
router_version, | ||
studio_client_config, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question about using Builder
async fn install( | ||
&self, | ||
override_install_path: Option<Utf8PathBuf>, | ||
elv2_license_accepter: LicenseAccepter, | ||
skip_update: bool, | ||
) -> Result<Self::Binary, Self::Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doublechecking: override_install_path
and skip_update
are the only cli options we need to support? that's my read of the help for dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's my read as well.
// Federation versions and supergraph versions are synonymous, but have different types | ||
// representing them depending on their use (eg, we only ever have an exact | ||
// SupergraphVersion because we can only ever use an exact version of the binary, where the | ||
// FederationVersion can just point to latest to get the latest version--these are similar, | ||
// but represent different ways of using the underlying version) | ||
let supergraph_version: SupergraphVersion = fed_version.clone().try_into()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know for sure that using fed_version.clone()
above is going to get the right version from the supergraph binary's perspective?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. The process is this:
- Get a
FederationVersion
(which may be some kind of "latest") - Download the binary using the specified argument
- Extract the exact version from the supergraph binary name
- We now have an exact version, which is slightly different from a
FederationVersion
, since it's a exact semantic version.
SupergraphVersion(#[from] SupergraphVersionError), | ||
} | ||
|
||
/// The installer for the supergraph binary. It implements InstallSupergraphBinary and has an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does InstallSupergraphBinary
exist anymore?
No description provided.