-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lambda update_function_code not incrementing Version when Publish=True #8337
Comments
I tracked down the issue to this: Line 1691 in edc7947
if latest_published.code_sha_256 == function.code_sha_256:
# Nothing has changed, don't publish
return latest_published AWS doesn't apply the same logic on their side when code is published. They seem to publish a new version even if the code hasn't changed. |
According to the documentation, AWS does not publish a new version when calling
Does the |
Here is what I am observing with AWS: import boto3
client = boto3.client('lambda', region_name='us-west-2')
res = client.update_function_code(FunctionName='test-handler', ZipFile=<archive>, Publish=True)
print(res["Version"]) # prints 1
res = client.update_function_code(FunctionName='test-handler', ZipFile=<archive>, Publish=True) # archive is identical to the first call
print(res["Version"]) # prints 2
res = client.publish_version(FunctionName='test-handler')
print(res["Version"]) # prints 2 So the docs for
Given all this, I'm not sure what the right course of action is with respect to mocking. Their docs are ambiguous and I can modify my test to slightly modify my archive to trigger the version to get updated with moto, but it would be nice if AWS would state explicitly what should happen for this case. |
When running the following beneath moto
After the first invocation this prints out
1
, but this also prints out1
for both results if the following is run:I would expect the second invocation to print out
2
since a new version is getting published.The text was updated successfully, but these errors were encountered: