Skip to content
This repository has been archived by the owner on Jun 2, 2020. It is now read-only.

Integrate latest RPC protocol changes #281

Open
peterhuene opened this issue May 20, 2019 · 15 comments
Open

Integrate latest RPC protocol changes #281

peterhuene opened this issue May 20, 2019 · 15 comments
Assignees
Labels
awaiting release The issue has been resolved in the dev branch and is awaiting the next release to close. enhancement New feature or request
Milestone

Comments

@peterhuene
Copy link
Owner

See https://github.com/Azure/azure-functions-language-worker-protobuf/releases/tag/v1.1.0-protofile.

@peterhuene peterhuene added the enhancement New feature or request label May 20, 2019
@peterhuene peterhuene added this to the 0.9.0 milestone May 20, 2019
@t-eckert
Copy link
Collaborator

Released 7 minutes ago. Fast on the pickup. What needs to be changed?

@peterhuene
Copy link
Owner Author

We'll need to expose the cookies via the HttpRequest request binding. The rest of the changes should be a no-op for us.

@t-eckert
Copy link
Collaborator

Would this be worth setting up a time to pair-program on?

@peterhuene
Copy link
Owner Author

Would you like to take a crack at this? We'll need to update the protobuf submodule and then build the azure-functions-shared crate with the compile_protobufs feature to regenerate the Rust code.

From there, add new functionality to HttpRequest to expose the cookie support that was added in Azure/azure-functions-language-worker-protobuf#31.

I might have time to pair on this later this week (today is crazy).

@t-eckert
Copy link
Collaborator

I would. I can read up on it. I am being sent to training Tuesday through Thursday, but could could do some evening time or during work hours on Friday.

@peterhuene peterhuene modified the milestones: 0.9.0, 0.10.0 Jun 11, 2019
@peterhuene
Copy link
Owner Author

peterhuene commented Jun 11, 2019

@t-eckert I've assigned this one to you given your interest.

I can handle updating my fork of the Azure Functions protocol repo so that we have the latest changes from upstream.

You'll need to regenerate the RPC code:

cd azure-functions-shared/protobufs
git fetch
git checkout 7796ba9
cd ..
cargo build --feature compile_protobufs
git add .

You will need protoc installed from Protocol Buffers.

Once the RPC code is generated, the rest of the work is exposing the new cookies interface on HttpRequest and HttpResponse. See Azure/azure-functions-language-worker-protobuf#32 for the changes that need to be exposed from the Rust API. We'll need a http::Cookie wrapper type for the RPC HttpCookie type that exposes the same sort of data.

@t-eckert
Copy link
Collaborator

I started a skeleton file of what you might be looking for: https://github.com/t-eckert/azure-functions-rs/blob/RCP-http-cookies/azure-functions/src/http/cookie.rs

Is there an example similar to what I'm trying to do that I can use to understand how to connect into the RPC from the cookie file?

@peterhuene
Copy link
Owner Author

peterhuene commented Jun 12, 2019

You can look to HttpRequest and HttpResponse, both of which wrap the underlying RpcHttp type.

Look to the RpcHttpCookie type to figure out what we need to expose.

In this case, since we can set cookies in the response, we'll need to extend the ResponseBuilder interface to allow users to easily add cookies to the response.

The idea is that we hide away the gRPC implementation details from the users in case it changes and it allows us to offer a simpler API.

@peterhuene
Copy link
Owner Author

@t-eckert how's this work proceeding? Let me know if you need any assistance.

@t-eckert
Copy link
Collaborator

t-eckert commented Jul 9, 2019

@peterhuene, I did some beginning cursory work, but lost the plot. It would be helpful to do a chat and scope out the work. I am on east coast time right now. Just let me know what your schedule looks like.

@peterhuene
Copy link
Owner Author

peterhuene commented Jul 10, 2019

I'll have some time tomorrow around noon PST if that works for you. If not, hit me up on Teams and hopefully I'll be free.

@peterhuene peterhuene modified the milestones: 0.10.0, 0.11.0 Jul 15, 2019
@peterhuene peterhuene added the blocked Issue is currently blocked. label Jul 29, 2019
@peterhuene
Copy link
Owner Author

Marking blocked on #346.

@t-eckert
Copy link
Collaborator

I think post-hackathon I have a better grasp on what needs to be done for this. We can confab on it this week.

@peterhuene
Copy link
Owner Author

peterhuene commented Jul 30, 2019

I'd like to get #346 fixed first as I think that would make it easier to implement this change.

For #346, I think we should basically pull the data out from the binding data and into the HttpRequest directly, removing the getter methods.

For HttpResponse, we should stop wrapping a rpc::Http and store the data directly on HttpResponse. Only when we convert to rpc::TypedData would it populate a rpc::Http.

@peterhuene peterhuene modified the milestones: 0.11.0, 0.12.0 Nov 10, 2019
@peterhuene peterhuene removed the blocked Issue is currently blocked. label Nov 11, 2019
@peterhuene peterhuene assigned peterhuene and unassigned t-eckert Nov 15, 2019
@peterhuene peterhuene added the in progress Work is in progress label Nov 15, 2019
@peterhuene
Copy link
Owner Author

I'm doing this as part of #346.

peterhuene added a commit that referenced this issue Nov 20, 2019
This commit refactors HttpRequest and HttpResponse to directly store the data
rather than an inner `RpcHttp`.

It also implements support for cookies in `HttpRequest`, `HttpResponse`, and
`ResponseBuilder`.

Also enables more lints and fixes the clippy warnings.

Binding attributes for parameters have moved to the parameters in the examples
and documentation.

Fixes #346.
Fixes #281.
@peterhuene peterhuene added awaiting release The issue has been resolved in the dev branch and is awaiting the next release to close. and removed in progress Work is in progress labels Nov 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting release The issue has been resolved in the dev branch and is awaiting the next release to close. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants