-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
feat(Hub): Support custom connectors #338
Conversation
That's impressive work, thanks a lot! I will be watching the linked PR and see no issues in moving this PR along once 1) and 2) are completed. |
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.
Now that yup-oauth2
has been upgraded with tower
, I performed the upgrade here and tried the following as my minimal benchmark:
make groupsmigration1-cli-cargo ARGS=check
Unfortunately it fails with this:
error[E0308]: mismatched types
--> src/main.rs:164:52
|
47 | impl<'n, S> Engine<'n, S>
| - this type parameter
...
164 | hub: api::GroupsMigration::new(client, auth),
| ^^^^ expected type parameter `S`, found struct `HttpsConnector`
|
= note: expected struct `Authenticator<S>`
found struct `Authenticator<HttpsConnector<HttpConnector>>`
It's strangely the very same error I got before the yup-oauth2 upgrade and wonder if some adjustments might have to be done in the CLI version. Is this something you could take a look at?
Once this builds, I believe there is nothing in the way of merging.
Thanks @Byron, seems like I missed something! I'll dig into this in the next day or two. |
Okay, that should fix it! I updated the CLI code to construct our InstalledFlowAuthenticator using the hyper client with custom connector. I ran I have no experience actually using the CLIs, so it's probably a good idea to try some basic CLI operations as a sanity check to make sure all is well even beyond the compiler. |
Thanks a lot! GroupsMigration definitely works now. The next level of testing with
The error is in the API (so I could have caught it before), and I assume the CLI will work as the hub initialization should be the same across all APIs. Could you take another look?
You are absolutely right, that's what should be done. Admittedly I haven't done this for years now and (have to) trust in the power of Rust: it compiles, it works 😅. |
Updated! It was a simple enough fix, adding the proper type params to ResumableUploadHelper. I verified with |
Thanks a lot for the great work! It's much appreciated and keeps these crates alive and well-integrated for a while longer! As you can see, I am upping the stakes each time I reply while running tests locally. This time I ran Here is where it stumbled:
I think what's happening here is that no symbol of tower should be imported, the namespace/module handling of these crates is messy enough to otherwise allow conflicts between hand-created/picked imports and auto-generated types. You can use the full path to symbols you use to fix it. Thanks again. |
A good point! Unfortunately I made it sound like I put you on rails of some intransparent process, even though that process isn't known to me either. I already was about to merge when it sprung into my mind that I better try to check everything given the severity of these changes. In other words, building all CLIs is the last card up my sleeve. I recommend |
Switch the constraints on Hub types to use public traits based on tower::service, as recommended by Hyper. This enables support for custom connectors beyond hyper_rustls::HttpsConnector Closes Byron#337.
Thanks for clarifying. I realized after my hasty reply that you already specified how to build all APIs & CLIs; that seems like the best we can throw at it! 😅 I updated the I really appreciate your guidance in this issue and PR; you've been a tremendous help in getting me productive on the project! I'm happy to make any more tweaks and fixes that may be needed on this. |
No worries, and I have no recollection of this 😅.
Great, I will do the same here for good measure and merge right after. What's the action you would like me to take afterwards? I would like to avoid re-releasing everything until there is demand - if you need particular crates I can release them separately if would know about them.
I am glad, thank you |
Sure, I can stick around! I don't know about being more familiar with the codebase yet... But at a minimum, it's only fair that I help with any follow-ups relating to this change. I'd be happy to join as a collaborator. For longer-term maintenance and stability, I think the biggest thing that would help is some kind of integration testing. Rust rules out a lot of errors with the type system, but it still seems like this change is a bit scary to release across all the crates. Can we choose one or two CLIs or APIs that exercise all the core stuff, and set them up to run against a mock server or something? I'm not too familiar with GitHub's CI capabilities yet, but hopefully something like this is achievable. |
Thanks for letting me know - I republished the API and CLI @v4.0.
That will be much appreciated. I have invited you as collaborator. Please keep sending PRs for changes where possible so I get a chance to take a look as well.
I totally agree and would appreciate your help tremendously! Truth to be told, there is integration tests already to the point where it generates the groupsmigration and youtube APIs and builds them. There is no actual testing of the API against mocks, and I'd think doing that is tough as the mocks won't ever be actual (and ever changing) google services. However, getting CI with its basic tests back to run would be great, and the reason I deactivated it was merely that the python parts of the toolchain kept acting up as they are absolutely out of date and… python just isn't anything one wants to rely on for long-term anything. If you think you can get CI back to what it was, it's possible to try it now that I re-activated it. You will find what's there in If this is not for you, and trust me, I fully understand, please let me know and I deactivate CI again. |
Switch the constraints on Hub types to use public traits based on
tower_service::Service
, as recommended by Hyper. This enables support for custom connectors beyond hyper_rustls::HttpsConnector.Note: This PR is dependent on the changes in dermesser/yup-oauth2#178. Before merging this, we need:
Closes #337.