From e18b1df002eca8fd7f64c3f216192e91483c14f7 Mon Sep 17 00:00:00 2001 From: chihying7509 Date: Tue, 24 Dec 2019 17:01:34 -0800 Subject: [PATCH] fix: upgraded nodejs from v8 to v10 & fixed validate lambda deploy state issue --- lib/builtins/deploy-delegates/lambda-deployer/helper.js | 4 ++-- lib/utils/constants.js | 1 - test/unit/fixture/model/regional-stack-file.json | 2 +- test/unit/fixture/model/regional-stack-file.yaml | 2 +- test/unit/fixture/model/resources-config.json | 2 +- test/unit/fixture/model/resources-config.yaml | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/builtins/deploy-delegates/lambda-deployer/helper.js b/lib/builtins/deploy-delegates/lambda-deployer/helper.js index bc2f6976..2f6cec71 100644 --- a/lib/builtins/deploy-delegates/lambda-deployer/helper.js +++ b/lib/builtins/deploy-delegates/lambda-deployer/helper.js @@ -43,10 +43,10 @@ Please solve this IAM role mismatch and re-deploy again.`); return callback(`The current revisionId (The revision ID for Lambda ARN (${lambdaArn}) should be ${remoteRevisionId}, \ but found ${localRevisionId}. Please solve this revision mismatch and re-deploy again.`); } - updatedDeployState = R.set(R.lensPath(['lambda', 'revisionId']), remoteRevisionId, currentRegionDeployState); + updatedDeployState = R.set(R.lensPath(['lambda', 'revisionId']), remoteRevisionId, updatedDeployState); // 3. add lastModified const lastModified = data.Configuration.LastModified; - updatedDeployState = R.set(R.lensPath(['lambda', 'lastModified']), lastModified, currentRegionDeployState); + updatedDeployState = R.set(R.lensPath(['lambda', 'lastModified']), lastModified, updatedDeployState); callback(null, { updatedDeployState }); }); } diff --git a/lib/utils/constants.js b/lib/utils/constants.js index 3ae2d4f8..d74e18f4 100644 --- a/lib/utils/constants.js +++ b/lib/utils/constants.js @@ -105,7 +105,6 @@ module.exports.TEMPLATES = { NodeJS: { TEMPLATE_INDEX: 'https://ask-cli-static-content.s3-us-west-2.amazonaws.com/skill-templates/nodejs-templates.json', LAMBDA_RUNTIME: [ - 'nodejs8.10', 'nodejs10.x' ] }, diff --git a/test/unit/fixture/model/regional-stack-file.json b/test/unit/fixture/model/regional-stack-file.json index 42e2bf5d..63213368 100644 --- a/test/unit/fixture/model/regional-stack-file.json +++ b/test/unit/fixture/model/regional-stack-file.json @@ -50,7 +50,7 @@ "S3Key": "endpoint.s3.key", "S3ObjectVersion": "endpoint.s3.version" }, - "Runtime": "nodejs8.10", + "Runtime": "nodejs10.x", "MemorySize": 512, "Timeout": 60 } diff --git a/test/unit/fixture/model/regional-stack-file.yaml b/test/unit/fixture/model/regional-stack-file.yaml index 55ff0b6b..d30428c0 100644 --- a/test/unit/fixture/model/regional-stack-file.yaml +++ b/test/unit/fixture/model/regional-stack-file.yaml @@ -31,7 +31,7 @@ Resources: S3Bucket: endpoint.s3.bucket S3Key: endpoint.s3.key S3ObjectVersion: endpoint.s3.version - Runtime: nodejs8.10 + Runtime: nodejs10.x MemorySize: 512 Timeout: 60 AlexaSkillFunctionEventPermission: diff --git a/test/unit/fixture/model/resources-config.json b/test/unit/fixture/model/resources-config.json index 60cf521d..d0e4851c 100644 --- a/test/unit/fixture/model/resources-config.json +++ b/test/unit/fixture/model/resources-config.json @@ -24,7 +24,7 @@ "skillInfrastructure": { "type": "@ask-cli/cfn-deployer", "userConfig": { - "runtime": "nodejs8.10", + "runtime": "nodejs10.x", "handler": "index.handler", "template": "./awsStacks/skill-infra.yaml", "regionOverrides": { diff --git a/test/unit/fixture/model/resources-config.yaml b/test/unit/fixture/model/resources-config.yaml index c2c7441f..8d514ece 100644 --- a/test/unit/fixture/model/resources-config.yaml +++ b/test/unit/fixture/model/resources-config.yaml @@ -18,7 +18,7 @@ profiles: skillInfrastructure: type: "@ask-cli/cfn-deployer" userConfig: - runtime: nodejs8.10 + runtime: nodejs10.x handler: index.handler template: "./awsStacks/skill-infra.yaml" regionOverrides: