Skip to content

Conversation

@elprans
Copy link
Collaborator

@elprans elprans commented Apr 13, 2018

Added subtree from https://github.com/azure/azure-functions-language-worker-protobuf.
Branch: dev. Commit: 894bebb70bf89f7f4017ec0a5c1d30c1b8f0f776

@elprans elprans requested review from 1st1 and asavaritayal April 13, 2018 20:53
@elprans elprans force-pushed the import-proto branch 3 times, most recently from 33fc6ad to 755be3b Compare April 13, 2018 21:42
Copy link

@mhoeger mhoeger left a comment

Choose a reason for hiding this comment

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

One quick note on the semantics of enable_content_negotiation. Otherwise, looks great and thank you for doing this so quickly!

status_code=str(status),
headers=headers,
is_raw=True,
enable_content_negotiation=True,
Copy link

Choose a reason for hiding this comment

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

Could you set this to False? Or to let the user choose True if they want to?

On consuming this change, we'll change the host so that is_raw = !enable_content_negotiation. This means that enable_content_negotiation will default to false (same effects as is_raw = true), and we'd like to let users opt-in to the c# content negotiation if they were using it before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Which version of the host contains the inverted logic? We cannot just flip it, because currently enable_content_negotiation is the same field as is_raw, so flipping it will cause tests to fail.

Copy link

@mhoeger mhoeger Apr 17, 2018

Choose a reason for hiding this comment

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

No current version of the host contains this logic. I was going to consume new language workers and update the host at the same time. Since that requires more coordination, I can also update the .proto file to accept both is_raw and enable_content_negotiation fields. Please let me know if you'd rather see that change!

is_raw will be deprecated no matter what, so I was hoping to get rid of it in the same step. But I might be getting ahead of myself :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem is that you've reused the the field in the proto spec, so we have to wait for a host version that supports the new interpretation of the field.

Copy link

Choose a reason for hiding this comment

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

Looks like we're at a bit of a deadlock since the host would have to consume a newer version of the language worker to work too. I'll update the .proto file to have enable_content_negotiation as a new field instead of a replacement!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mhoeger Yes, enable_content_negotiation=True works fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looking at the host PR, I actually think that the logic has not been reversed in all places, e.g line 166 in src/WebJobs.Script/Binding/Http/HttpBinding.cs

Copy link

@mhoeger mhoeger Apr 30, 2018

Choose a reason for hiding this comment

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

Sorry I'm very confused - line 166 is the only place the logic is reversed (besides test cases)? (note: the ScriptObjectResult will throw a 406, but RawScriptResult will not)
image

Copy link
Collaborator Author

@elprans elprans Apr 30, 2018

Choose a reason for hiding this comment

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

Sorry, this was a mistake on my end. Didn't flip enable_content_negotiation back to False when bumping to 2.0.11737. I amended the PR.

Copy link

Choose a reason for hiding this comment

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

Sounds great. Thanks! You actually helped us catch an unwanted revert in the master branch of functions-host as well, so thank you :)

@pragnagopa
Copy link
Member

@mhoeger can you please take a look and confirm the host version that has the changes?

Added subtree from https://github.com/azure/azure-functions-language-worker-protobuf.
Branch: dev.
Commit: 894bebb70bf89f7f4017ec0a5c1d30c1b8f0f776
Closes: #99.
@pragnagopa
Copy link
Member

This needs to be merged as well for the current release. @elprans - anything else pending here?

@elprans elprans merged commit 6478e39 into dev May 1, 2018
@elprans elprans deleted the import-proto branch May 1, 2018 20:05
@mhoeger
Copy link

mhoeger commented May 1, 2018

@elprans thank you! :)

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.

4 participants