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

Update to Hyper 1 #524

Merged
merged 27 commits into from
Oct 6, 2024
Merged

Update to Hyper 1 #524

merged 27 commits into from
Oct 6, 2024

Conversation

IvanUkhov
Copy link
Contributor

@IvanUkhov IvanUkhov commented Oct 2, 2024

Closes #459.

@IvanUkhov IvanUkhov changed the title Update all dependencies Update to Hyper 1 Oct 2, 2024
@IvanUkhov
Copy link
Contributor Author

@Byron, just wanted to get your early feedback. I have managed to make the API crates compile. At least, it passes for:

make storage1-clean storage1 storage1-cargo ARGS=test

It remains to update the CLI template.

Is this something that would would be willing to accept, or is it not the direction you want to take?

@Byron
Copy link
Owner

Byron commented Oct 3, 2024

Thank you, the work looks very promising and I'd be happy if we could see it through.

My recommendation is to get CI green first - the issues there seem to be unrelated to the CLI for now.

And regarding the CLI, I believe to remember that they didn't compile before your change either, it degenerated (maybe CI isn't actually testing these), and getting them to work again would be greatly appreciated - maybe there are still useful to some.

@IvanUkhov
Copy link
Contributor Author

Now the CI fails at the CLIs. I will then tackle them next.

@IvanUkhov
Copy link
Contributor Author

I added storage1 to the CI list to show the error I am facing (was passing for the other ones on the list). Please take a look. Looks like there is some confusion regarding type and format. An argument can be of type string and format int64, and the function is generated to take an integer while the CLI tries to pass a string. Do you have any ideas regarding what might be going on and how to address that?

Copy link
Owner

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot, this is great work and I think it is very, very promising!

That the CLI fails to compile for storage1 wouldn't even be a hold-up for this PR - the CLI was fully broken before this PR, and now it's only partially out of sync with the API with certain APIs even , I'd call that a huge improvement already.

With that said, I also don't know why it gets its typing wrong, maybe it's a split-brain issue somewhere?

However, there is one question I had when looking at a removal.
Further, did you managed to run cargo check on all the APIs? Do they still work?

If so, I think we can try to get this PR merged and a new major release created.

Thanks again!

@@ -703,17 +698,6 @@ else {
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
% endif
let mut req_result = {
% if resumable_media_param:
Copy link
Owner

Choose a reason for hiding this comment

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

Would this not be missing somewhere?

Copy link
Contributor Author

@IvanUkhov IvanUkhov Oct 5, 2024

Choose a reason for hiding this comment

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

I was planning to ask you about this. It was getting in the way, but I could not find how it was actually used. It looks like dead code. The way I see it is that should_ask_dlg_for_url is always false. Or what is going on here?

Copy link
Owner

Choose a reason for hiding this comment

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

Right! I checked and the variable was false from the very beginning, so it could never have worked anyway.

Also something I just noticed is the 'assignment as side-effect of if-condition' dark magic that is performed here, and it's incredible that I was the author of this 😅.

In any case, I agree that under the circumstances, it should definitely be removed.

Copy link
Owner

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot for following up!

From my point of view this would be ready to merge, unless of course you'd like to perform more testing or try to figure out how to fix that last remaining CLI generation issue.

It's entirely up to you.

@@ -703,17 +698,6 @@ else {
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
% endif
let mut req_result = {
% if resumable_media_param:
Copy link
Owner

Choose a reason for hiding this comment

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

Right! I checked and the variable was false from the very beginning, so it could never have worked anyway.

Also something I just noticed is the 'assignment as side-effect of if-condition' dark magic that is performed here, and it's incredible that I was the author of this 😅.

In any case, I agree that under the circumstances, it should definitely be removed.

@IvanUkhov
Copy link
Contributor Author

I have plugged in a few Python linters and cleaned up trailing whitespace and such. Also, clarified the CI workflow.

I will try to regenerate all APIs and run the checks with the tests now.

@IvanUkhov
Copy link
Contributor Author

OK, I am able to generate all APIs and the following succeeds:

 make cargo-api ARGS=check

@IvanUkhov IvanUkhov marked this pull request as ready for review October 6, 2024 17:01
Copy link
Owner

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the exhaustive update and modernisation!

It's great that CI is now more granular, too. Maybe it could be split between API and CLI as well so it's more clear that only CI currently fails, and nothing else.

Maybe with all the time spent in the code-base, it will soon become more obvious why some CLIs don't yet build. It seemed like it must be a small thing… .

@@ -25,9 +25,3 @@ make:
cargo:
keywords: [protocol, web, api]
doc_base_url: https://docs.rs
dependencies:
Copy link
Owner

Choose a reason for hiding this comment

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

It's a great idea to bring it all into the generator file.

src/generator/templates/deps.mako Outdated Show resolved Hide resolved
@Byron Byron merged commit 450748c into Byron:main Oct 6, 2024
4 of 5 checks passed
@IvanUkhov IvanUkhov deleted the yup-oauth2 branch October 7, 2024 07:18
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.

Upgrade to Hyper 1.0
2 participants