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 Dev Rewrite - Install Router Binary #2257

Merged
merged 6 commits into from
Nov 20, 2024
Merged

Conversation

dotdat
Copy link
Contributor

@dotdat dotdat commented Nov 8, 2024

No description provided.

@dotdat dotdat requested a review from a team as a code owner November 8, 2024 15:47
@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Nov 8, 2024

✅ Docs Preview Ready

No new or changed pages found.

@dotdat dotdat force-pushed the dotdat/install-router-plugin branch from 351d824 to 6f8ea7f Compare November 8, 2024 17:22
@dotdat dotdat force-pushed the dotdat/install-router-plugin branch from 8ab5e55 to 9e3811f Compare November 20, 2024 15:32
@dotdat dotdat enabled auto-merge (squash) November 20, 2024 16:45
@dotdat dotdat changed the title Install Router Binary Rover Dev Rewrite - Install Router Binary Nov 20, 2024
Copy link
Contributor

@aaronArinder aaronArinder left a 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"
Copy link
Contributor

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

Copy link
Contributor Author

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.

Comment on lines +13 to +17
impl RouterBinary {
pub fn new(exe: Utf8PathBuf, version: Version) -> RouterBinary {
RouterBinary { exe, version }
}
}
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sg, seems sensible

Comment on lines +37 to +47
#[allow(unused)]
pub fn new(
router_version: RouterVersion,
studio_client_config: StudioClientConfig,
) -> InstallRouter {
InstallRouter {
router_version,
studio_client_config,
}
}
}
Copy link
Contributor

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

Comment on lines +53 to +58
async fn install(
&self,
override_install_path: Option<Utf8PathBuf>,
elv2_license_accepter: LicenseAccepter,
skip_update: bool,
) -> Result<Self::Binary, Self::Error> {
Copy link
Contributor

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

Copy link
Contributor Author

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.

Comment on lines -273 to -278
// 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()?;
Copy link
Contributor

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?

Copy link
Contributor Author

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:

  1. Get a FederationVersion (which may be some kind of "latest")
  2. Download the binary using the specified argument
  3. Extract the exact version from the supergraph binary name
  4. 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does InstallSupergraphBinary exist anymore?

@dotdat dotdat merged commit a0eec43 into main Nov 20, 2024
22 checks passed
@dotdat dotdat deleted the dotdat/install-router-plugin branch November 20, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants