Repository navigation
Allow lazy function invocation to target version/alias - #679
Conversation
seratch
left a comment
There was a problem hiding this comment.
Thanks for improving this! LGTM
| event["method"] = "NONE" | ||
| invocation = self.lambda_client.invoke( | ||
| FunctionName=request.context["aws_lambda_function_name"], | ||
| FunctionName=request.context["aws_lambda_invoked_function_arn"], |
There was a problem hiding this comment.
This should work. The lambda invocation API accepts any of function name, function ARN, and partial ARN. https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html#options
|
@angrychimp The change looks great to me already but this change requires a small update in the unit test code. Could you update the test code to be consistent with your code change? |
|
Not sure how I missed that, but thanks for pointing it out. I've added the updated test script to the PR. I'm getting a seg-fault running the "run_tests" script which I believe is just an issue with my environment, but while I figure that out let me know if it looks like there's anything else I'm missing.
|
Codecov Report
@@ Coverage Diff @@
## main #679 +/- ##
=======================================
Coverage 92.05% 92.05%
=======================================
Files 172 172
Lines 5864 5865 +1
=======================================
+ Hits 5398 5399 +1
Misses 466 466
Continue to review full report at Codecov.
|
We are aware of this potential error that can rarely happen but this is it not related to your changes. Also, retrying the test execution should succeed. The CI builds are now successful! Thanks a lot for your contribution 🎉 |
Currently lazy responses are only targeting the
$LATESTversion of a given AWS function. This prevents meaningful A/B testing if you're using function versions/aliases to compare code changes. Adjusting theinvokemethod to use the function ARN from the current execution allows downstream code parity.This change adds a variable (
invoked_function_arn) to the request context, then uses that value when invoking the sub-request.Category
slack_bolt.Appand/or its core componentsslack_bolt.async_app.AsyncAppand/or its core componentsslack_bolt.adapter/docsRequirements (place an
xin each[ ])Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
./scripts/install_all_and_run_tests.shafter making the changes.