feat: init binding and async#1
Conversation
Fix failing assert to look for a different error message, likely due to a change in CloudEvents error message. Also add tests so that code coverage is back at 100%. Signed-off-by: Kehui Li <[email protected]>
Signed-off-by: Kehui Li <[email protected]>
|
Kehui Li seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
de96a02 to
05df573
Compare
That's a great enhancement! Thanks @kehuili And to utilize this python functions-framework, we might need to update https://github.com/OpenFunction/builder as well. Ben |
Just signed CLA. Also I picked a commit from GCP for a test fix (or one unit test would fail forever), it seems he/she also need to sign. Do I need to revert this commit and just commit this change myself? |
No, just you sign the CLA is all right |
| uri = json_dct.get('uri') or '' | ||
| component_name = json_dct.get('componentName') or '' | ||
| metadata = json_dct.get('metadata') | ||
| component_type = json_dct.get('componentType') or '' | ||
| operation = json_dct.get('operation') or '' |
There was a problem hiding this comment.
Would it be better to use get("key", "default")?
|
lgtm |
|
is the quick start example in the readme need to be updated as well? |
|
Kehui Li seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. @kehuili you may need to add your email used to sign this commit as your github primary email and sign the cla again. |
| OPEN_FUNC_BINDING = "bindings" | ||
| OPEN_FUNC_TOPIC = "pubsub" | ||
|
|
||
| KNATIVE_RUNTIME_TYPE = "Knative" |
There was a problem hiding this comment.
Is this runtime type used as the runtime field of serving?
If so it should be in lower case knative or async like https://github.com/OpenFunction/samples/blob/main/functions/async/logs-handler-function/logs-handler-function.yaml#L22
There was a problem hiding this comment.
It's for runtime in FUNC_CONTEXT, so I thought it should be capitalized w/ first letter like examples here https://github.com/OpenFunction/samples/blob/bb4e664321f0a2e9d509543936abf9a9b776557c/functions-framework/golang/Knative/http/README.md#func_context
Definitely gonna add some samples later🙆♀️ |
| context = _function_registry.get_openfunction_context(None) | ||
|
|
||
| # determine if async or knative | ||
| if context and context.runtime == ASYNC_RUNTIME_TYPE: |
There was a problem hiding this comment.
Let's make a case insensitive comparison for xx_RUNTIME_TYPE
Signed-off-by: Kehui Li <[email protected]>
9444e51 to
830895a
Compare
This big initial PR is an important upgrade to current GCP Python Function Framework with following task accomplished: