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

Fetch the pirita download URL #3355

Merged
merged 2 commits into from
Nov 23, 2022
Merged

Fetch the pirita download URL #3355

merged 2 commits into from
Nov 23, 2022

Conversation

Michael-F-Bryan
Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan commented Nov 22, 2022

Add some more queries to the wasmer-registry crate.

I've also had to remove lib/wasi-types/wit-bindgen because it's a broken link to use wai-bindgen from crates.io, otherwise you get the following error when trying to use wasmerio/wasmer as a git dependency (I had to temporarily patch my wasmer-registry from crates.io in https://github.com/wasmerio/pirita/pull/62 to see if this PR would work).

    Updating git repository `https://github.com/wasmerio/wasmer`
error: failed to load source for dependency `wasmer-registy`

Caused by:
  Unable to update https://github.com/wasmerio/wasmer?branch=more-queries

Caused by:
  failed to update submodule `lib/wasi-types/wit-bindgen`

Caused by:
  no URL configured for submodule 'lib/wasi-types/wit-bindgen'; class=Submodule (17)

@Michael-F-Bryan Michael-F-Bryan marked this pull request as ready for review November 22, 2022 13:38
@@ -317,6 +318,7 @@ pub fn query_command_from_registry(
let package = command.package_version.package.display_name;
let version = command.package_version.version;
let url = command.package_version.distribution.download_url;
let pirita_url = command.package_version.distribution.pirita_download_url;

Ok(PackageDownloadInfo {
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we return the type/content from command.package_version. That seems way easier than recreating a new struct each time

Copy link
Member

Choose a reason for hiding this comment

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

I'll approve in any case, we can revisit this after

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, you have a good point.

Something we should do is make all our GraphQL queries public. That way people can execute them directly if a high-level function (e.g. wasmer_registry::query_command_from_registry()) doesn't support exactly what you are looking for.

@syrusakbary
Copy link
Member

bors r+

@syrusakbary syrusakbary mentioned this pull request Nov 23, 2022
@bors
Copy link
Contributor

bors bot commented Nov 23, 2022

Build succeeded:

@bors bors bot merged commit a22b50a into master Nov 23, 2022
@bors bors bot deleted the more-queries branch November 23, 2022 02:25
bors bot added a commit that referenced this pull request Nov 23, 2022
3360: Introduce a "wasmer_registry::queries" module with all GraphQL queries r=fschutt a=Michael-F-Bryan

This makes all queries used in the `wasmer-registry` crate public. 

See #3355 (comment) for some more context.

Co-authored-by: Michael-F-Bryan <[email protected]>
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.

2 participants