You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Deployment checks erroneously fail if local artifacts are placed in ".serverless/NAME.zip" #8350
Extracting this issue from #8187 (comment) so I can do a quick PR... I'll have a full regression test in the PR which will hopefully explain the isolated situation more.
The issue is that if a plugin (like jetpack does) or outside build process places it's own artifact into .serverless/<FROM_PACKAGE_ARTIFACT>.zip and sets package.artifact we end up with a case wherein we glob .serverless/<FROM_PACKAGE_ARTIFACT>.zip first in the sync glob and then add the exact same file(s) again in the package.artifact code in the conditional. This has the effect of (1) doing extra unneeded I/O for the hash calculation and (2) adding extra identical hashes to the localHashes array which causes the _.isEqual() check to be false and ultimately serverless will deploy when it otherwise shouldn't.
serverless.yml
# .. Just a sample:functions:
my-fun:
handler: index.handlerpackage:
# Assume this is created out of band by a separate process.artifact: ".serverless/my-fun.zip"
serverless deploy output
# EXPECT
Serverless: Service files not changed. Skipping deployment...
# ACTUAL => Gets a full deployment.
changed the title [-]Bugfix: Ensure deployment check for local artifacts only reads/hashes unique files once.[/-][+]Bug: Deployment checks erroneously fail if local artifacts are placed in ".serverless/NAME.zip"[/+]on Oct 7, 2020
Activity
[-]Bugfix: Ensure deployment check for local artifacts only reads/hashes unique files once.[/-][+]Bug: Deployment checks erroneously fail if local artifacts are placed in ".serverless/NAME.zip"[/+]