Skip to content
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

feat: Allow legacy option for lambdaHashingVersion property #10173

Merged
merged 1 commit into from Nov 3, 2021

Conversation

pgrzesik
Copy link
Contributor

Allow to use legacy option for lambdaHashingVersion to keep using the old algorithm

Reported internally

@pgrzesik pgrzesik self-assigned this Oct 28, 2021
@codecov
Copy link

codecov bot commented Oct 28, 2021

Codecov Report

Merging #10173 (2c74f72) into master (ee38f6a) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10173      +/-   ##
==========================================
- Coverage   85.37%   85.34%   -0.03%     
==========================================
  Files         339      339              
  Lines       13819    13822       +3     
==========================================
- Hits        11798    11797       -1     
- Misses       2021     2025       +4     
Impacted Files Coverage Δ
lib/plugins/aws/provider.js 94.29% <ø> (ø)
lib/plugins/aws/package/compile/functions.js 94.44% <100.00%> (ø)
lib/Serverless.js 66.96% <0.00%> (-2.51%) ⬇️
lib/plugins/aws/deploy/index.js 98.64% <0.00%> (+0.01%) ⬆️
lib/plugins/aws/info/index.js 97.22% <0.00%> (+0.07%) ⬆️
lib/plugins/aws/package/compile/events/httpApi.js 95.83% <0.00%> (+0.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee38f6a...2c74f72. Read the comment docs.

docs/deprecations.md Outdated Show resolved Hide resolved
docs/deprecations.md Outdated Show resolved Hide resolved
@pgrzesik pgrzesik force-pushed the allow-to-use-old-hashing-algorithm branch from 940137b to 494d00c Compare October 29, 2021 09:00
mnapoli
mnapoli previously approved these changes Nov 2, 2021
@pgrzesik pgrzesik requested a review from medikoo November 3, 2021 08:29
@@ -147,7 +148,7 @@ class AwsCompileFunctions {

async addFileToHash(filePath, hash) {
const lambdaHashingVersion = this.serverless.service.provider.lambdaHashingVersion;
if (lambdaHashingVersion) {
if (lambdaHashingVersion === '20201221') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Conceptually we should rather use >= comparison (although it's highly unlikely we will introduce any other mode in a future)

@@ -62,7 +62,8 @@ class AwsCompileFunctions {
'LAMBDA_HASHING_VERSION_V2',
'Resolution of lambda version hashes was improved with better algorithm, ' +
'which will be used in next major release.\n' +
'Switch to it now by setting "provider.lambdaHashingVersion" to "20201221"'
'Switch to it now by setting "provider.lambdaHashingVersion" to "20201221".\n' +
'While it is highly encouraged to upgrade to new algorithm, you can still use the old approach by setting "provider.lambdaHashingVersion" to "legacy".'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

legacy should be updated to 20200924

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍

@pgrzesik pgrzesik merged commit 50a8457 into master Nov 3, 2021
@pgrzesik pgrzesik deleted the allow-to-use-old-hashing-algorithm branch November 3, 2021 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants