GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix: add field headers for other http verbs by busunkim96 · Pull Request #443 · googleapis/gapic-generator-python
This repository was archived by the owner on Aug 25, 2026. It is now read-only.
Conversation
|
|
Ahh, it looks like the generated unit tests aren't getting 100% coverage. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codecov Report
@@ Coverage Diff @@ ## master #443 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 26 26 Lines 1453 1453 Branches 300 300 ========================================= Hits 1453 1453
Continue to review full report at Codecov.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It looks like the last failing unit test is for a streaming method that uses field headers.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| with mock.patch.object( | ||
| type(client._transport.{{ method.name|snake_case }}), | ||
| '__call__') as call: | ||
| {% if method.void -%} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copy-pasted from the unit test below this.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ) | ||
| request = {{ method.input.ident }}() | ||
|
|
||
| {%- for field_header in method.field_headers %} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Tweaking this slightly for field headers like "/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| metadata = tuple(metadata) + ( | ||
| gapic_v1.routing_header.to_grpc_metadata(( | ||
| {%- for field_header in method.field_headers %} | ||
| {%- if not method.client_streaming %} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Added this for a failing showcase test (see streaming method in proto and failing test).
Not sure if this is the right call though. What's the correct way to handle metadata/headers for streaming methods? @software-dov
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that headers for streaming methods don't make a lot of sense because they're not tightly bound to http semantics. If that's not correct, then I think we would need to ask someone who knows better.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| metadata = tuple(metadata) + ( | ||
| gapic_v1.routing_header.to_grpc_metadata(( | ||
| {%- for field_header in method.field_headers %} | ||
| {%- if not method.client_streaming %} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that headers for streaming methods don't make a lot of sense because they're not tightly bound to http semantics. If that's not correct, then I think we would need to ask someone who knows better.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Generated clients are missing routing headers
There was an error while loading. Please reload this page.