From e9f3f9ffbc651dbdd3967a9023b9cfdfcce171c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 11:32:53 -0800 Subject: [PATCH 01/23] chore(deps): bump the boto group in /requirements with 6 updates (#6784) Bumps the boto group in /requirements with 6 updates: | Package | From | To | | --- | --- | --- | | [boto3](https://github.com/boto/boto3) | `1.34.52` | `1.34.56` | | [boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]](https://github.com/youtype/mypy_boto3_builder) | `1.34.52` | `1.34.56` | | [botocore](https://github.com/boto/botocore) | `1.34.52` | `1.34.56` | | [botocore-stubs](https://github.com/youtype/botocore-stubs) | `1.34.52` | `1.34.56` | | [mypy-boto3-apigateway](https://github.com/youtype/mypy_boto3_builder) | `1.34.50` | `1.34.56` | | [mypy-boto3-cloudformation](https://github.com/youtype/mypy_boto3_builder) | `1.34.32` | `1.34.55` | Updates `boto3` from 1.34.52 to 1.34.56 - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.34.52...1.34.56) Updates `boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]` from 1.34.52 to 1.34.56 - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) Updates `botocore` from 1.34.52 to 1.34.56 - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.34.52...1.34.56) Updates `botocore-stubs` from 1.34.52 to 1.34.56 - [Release notes](https://github.com/youtype/botocore-stubs/releases) - [Commits](https://github.com/youtype/botocore-stubs/commits) Updates `mypy-boto3-apigateway` from 1.34.50 to 1.34.56 - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) Updates `mypy-boto3-cloudformation` from 1.34.32 to 1.34.55 - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray] dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore-stubs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: mypy-boto3-apigateway dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: mypy-boto3-cloudformation dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/base.txt | 2 +- requirements/reproducible-linux.txt | 36 ++++++++++++++--------------- requirements/reproducible-mac.txt | 36 ++++++++++++++--------------- requirements/reproducible-win.txt | 36 ++++++++++++++--------------- 4 files changed, 55 insertions(+), 55 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 170ed88910..aac51d4186 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -31,4 +31,4 @@ tzlocal==5.2 cfn-lint~=0.85.2 # Type checking boto3 objects -boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.52 +boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.56 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 29d267e982..8e68f70f06 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -38,25 +38,25 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.52 \ - --hash=sha256:66303b5f26d92afb72656ff490b22ea72dfff8bf1a29e4a0c5d5f11ec56245dd \ - --hash=sha256:898ad2123b18cae8efd85adc56ac2d1925be54592aebc237020d4f16e9a9e7a9 +boto3==1.34.56 \ + --hash=sha256:300888f0c1b6f32f27f85a9aa876f50f46514ec619647af7e4d20db74d339714 \ + --hash=sha256:b26928f9a21cf3649cea20a59061340f3294c6e7785ceb6e1a953eb8010dc3ba # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.52 \ - --hash=sha256:644381a404fb5884154f7dcc40bb819f0c7f37de21b7a7b493585277b51c9a5f \ - --hash=sha256:823c41059f836d6877daaa1cbd20f813c8f1a78b9fdf290bc0b853127e127ba3 +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.56 \ + --hash=sha256:627f8eca69d832581ee1676d39df099a2a2e3a86d6b3ebd21c81c5f11ed6a6fa \ + --hash=sha256:a87e7ecbab6235ec371b4363027e57483bca349a9cd5c891f40db81dadfa273e # via aws-sam-cli (setup.py) -botocore==1.34.52 \ - --hash=sha256:05567d8aba344826060481ea309555432c96f0febe22bee7cf5a3b6d3a03cec8 \ - --hash=sha256:187da93aec3f2e87d8a31eced16fa2cb9c71fe2d69b0a797f9f7a9220f5bf7ae +botocore==1.34.56 \ + --hash=sha256:bffeb71ab21d47d4ecf947d9bdb2fbd1b0bbd0c27742cea7cf0b77b701c41d9f \ + --hash=sha256:fff66e22a5589c2d58fba57d1d95c334ce771895e831f80365f6cff6453285ec # via # boto3 # s3transfer -botocore-stubs==1.34.52 \ - --hash=sha256:0870e2db4ec557c21a8fc142f1f785759f263437b64c1d45f2ca16e91d612af7 \ - --hash=sha256:a51b6ca1fca9acdaa9e80412f37153690fffad7ed227743cc530809920d2a009 +botocore-stubs==1.34.56 \ + --hash=sha256:018e001e3add5eb1828ef444b45fb8c9faf695e08334031bf2d96853cd9af703 \ + --hash=sha256:25468ba6983987b704b1856bb155f297f576e6d4a690b021ab0c7122889ba907 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ @@ -405,13 +405,13 @@ mpmath==1.3.0 \ --hash=sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f \ --hash=sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c # via sympy -mypy-boto3-apigateway==1.34.50 \ - --hash=sha256:3df3cb29a38fe6e7607dde0680f3016e223b895c566ced9820da64657f9b4fad \ - --hash=sha256:43978b27d585528dc218749082b683cc060519aa4958b97d107620ddad6a383d +mypy-boto3-apigateway==1.34.56 \ + --hash=sha256:3695503bd9388b3067c1dc1dc4ec1486dcec450dbf1e9889f451120e333b92da \ + --hash=sha256:5ab15db30d730198384d6445d50cc1fec98361b85366dd092b10e9b9f4a1a2cb # via boto3-stubs -mypy-boto3-cloudformation==1.34.32 \ - --hash=sha256:49d04c090dae3fd8289738ae592cac9d6faa5169684de40c2730b425bba2a32d \ - --hash=sha256:bfe5ec405eae6dae31dc9874729eef5e668e634eae8972032f00400d17bd2c7d +mypy-boto3-cloudformation==1.34.55 \ + --hash=sha256:78c4d25ef7102bd02c8e87d32211ff60a7b474ec546e9948b46f170d341ae0a2 \ + --hash=sha256:de9f4d45d0a4e57bb5ef8b8d7a03476f8ef24ffa253d636cd824cde061227439 # via boto3-stubs mypy-boto3-ecr==1.34.0 \ --hash=sha256:3346c02c22b16068c9acc67d990e32060bf7cdaea5f3d43c50e44308fbbc3439 \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index 42b12aef6f..b80ca6c30f 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -56,25 +56,25 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.52 \ - --hash=sha256:66303b5f26d92afb72656ff490b22ea72dfff8bf1a29e4a0c5d5f11ec56245dd \ - --hash=sha256:898ad2123b18cae8efd85adc56ac2d1925be54592aebc237020d4f16e9a9e7a9 +boto3==1.34.56 \ + --hash=sha256:300888f0c1b6f32f27f85a9aa876f50f46514ec619647af7e4d20db74d339714 \ + --hash=sha256:b26928f9a21cf3649cea20a59061340f3294c6e7785ceb6e1a953eb8010dc3ba # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.52 \ - --hash=sha256:644381a404fb5884154f7dcc40bb819f0c7f37de21b7a7b493585277b51c9a5f \ - --hash=sha256:823c41059f836d6877daaa1cbd20f813c8f1a78b9fdf290bc0b853127e127ba3 +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.56 \ + --hash=sha256:627f8eca69d832581ee1676d39df099a2a2e3a86d6b3ebd21c81c5f11ed6a6fa \ + --hash=sha256:a87e7ecbab6235ec371b4363027e57483bca349a9cd5c891f40db81dadfa273e # via aws-sam-cli (setup.py) -botocore==1.34.52 \ - --hash=sha256:05567d8aba344826060481ea309555432c96f0febe22bee7cf5a3b6d3a03cec8 \ - --hash=sha256:187da93aec3f2e87d8a31eced16fa2cb9c71fe2d69b0a797f9f7a9220f5bf7ae +botocore==1.34.56 \ + --hash=sha256:bffeb71ab21d47d4ecf947d9bdb2fbd1b0bbd0c27742cea7cf0b77b701c41d9f \ + --hash=sha256:fff66e22a5589c2d58fba57d1d95c334ce771895e831f80365f6cff6453285ec # via # boto3 # s3transfer -botocore-stubs==1.34.52 \ - --hash=sha256:0870e2db4ec557c21a8fc142f1f785759f263437b64c1d45f2ca16e91d612af7 \ - --hash=sha256:a51b6ca1fca9acdaa9e80412f37153690fffad7ed227743cc530809920d2a009 +botocore-stubs==1.34.56 \ + --hash=sha256:018e001e3add5eb1828ef444b45fb8c9faf695e08334031bf2d96853cd9af703 \ + --hash=sha256:25468ba6983987b704b1856bb155f297f576e6d4a690b021ab0c7122889ba907 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ @@ -433,13 +433,13 @@ mpmath==1.3.0 \ --hash=sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f \ --hash=sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c # via sympy -mypy-boto3-apigateway==1.34.50 \ - --hash=sha256:3df3cb29a38fe6e7607dde0680f3016e223b895c566ced9820da64657f9b4fad \ - --hash=sha256:43978b27d585528dc218749082b683cc060519aa4958b97d107620ddad6a383d +mypy-boto3-apigateway==1.34.56 \ + --hash=sha256:3695503bd9388b3067c1dc1dc4ec1486dcec450dbf1e9889f451120e333b92da \ + --hash=sha256:5ab15db30d730198384d6445d50cc1fec98361b85366dd092b10e9b9f4a1a2cb # via boto3-stubs -mypy-boto3-cloudformation==1.34.32 \ - --hash=sha256:49d04c090dae3fd8289738ae592cac9d6faa5169684de40c2730b425bba2a32d \ - --hash=sha256:bfe5ec405eae6dae31dc9874729eef5e668e634eae8972032f00400d17bd2c7d +mypy-boto3-cloudformation==1.34.55 \ + --hash=sha256:78c4d25ef7102bd02c8e87d32211ff60a7b474ec546e9948b46f170d341ae0a2 \ + --hash=sha256:de9f4d45d0a4e57bb5ef8b8d7a03476f8ef24ffa253d636cd824cde061227439 # via boto3-stubs mypy-boto3-ecr==1.34.0 \ --hash=sha256:3346c02c22b16068c9acc67d990e32060bf7cdaea5f3d43c50e44308fbbc3439 \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index 8feec9b08e..716182d2f0 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -38,25 +38,25 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.52 \ - --hash=sha256:66303b5f26d92afb72656ff490b22ea72dfff8bf1a29e4a0c5d5f11ec56245dd \ - --hash=sha256:898ad2123b18cae8efd85adc56ac2d1925be54592aebc237020d4f16e9a9e7a9 +boto3==1.34.56 \ + --hash=sha256:300888f0c1b6f32f27f85a9aa876f50f46514ec619647af7e4d20db74d339714 \ + --hash=sha256:b26928f9a21cf3649cea20a59061340f3294c6e7785ceb6e1a953eb8010dc3ba # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.52 \ - --hash=sha256:644381a404fb5884154f7dcc40bb819f0c7f37de21b7a7b493585277b51c9a5f \ - --hash=sha256:823c41059f836d6877daaa1cbd20f813c8f1a78b9fdf290bc0b853127e127ba3 +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.56 \ + --hash=sha256:627f8eca69d832581ee1676d39df099a2a2e3a86d6b3ebd21c81c5f11ed6a6fa \ + --hash=sha256:a87e7ecbab6235ec371b4363027e57483bca349a9cd5c891f40db81dadfa273e # via aws-sam-cli (setup.py) -botocore==1.34.52 \ - --hash=sha256:05567d8aba344826060481ea309555432c96f0febe22bee7cf5a3b6d3a03cec8 \ - --hash=sha256:187da93aec3f2e87d8a31eced16fa2cb9c71fe2d69b0a797f9f7a9220f5bf7ae +botocore==1.34.56 \ + --hash=sha256:bffeb71ab21d47d4ecf947d9bdb2fbd1b0bbd0c27742cea7cf0b77b701c41d9f \ + --hash=sha256:fff66e22a5589c2d58fba57d1d95c334ce771895e831f80365f6cff6453285ec # via # boto3 # s3transfer -botocore-stubs==1.34.52 \ - --hash=sha256:0870e2db4ec557c21a8fc142f1f785759f263437b64c1d45f2ca16e91d612af7 \ - --hash=sha256:a51b6ca1fca9acdaa9e80412f37153690fffad7ed227743cc530809920d2a009 +botocore-stubs==1.34.56 \ + --hash=sha256:018e001e3add5eb1828ef444b45fb8c9faf695e08334031bf2d96853cd9af703 \ + --hash=sha256:25468ba6983987b704b1856bb155f297f576e6d4a690b021ab0c7122889ba907 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ @@ -409,13 +409,13 @@ mpmath==1.3.0 \ --hash=sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f \ --hash=sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c # via sympy -mypy-boto3-apigateway==1.34.50 \ - --hash=sha256:3df3cb29a38fe6e7607dde0680f3016e223b895c566ced9820da64657f9b4fad \ - --hash=sha256:43978b27d585528dc218749082b683cc060519aa4958b97d107620ddad6a383d +mypy-boto3-apigateway==1.34.56 \ + --hash=sha256:3695503bd9388b3067c1dc1dc4ec1486dcec450dbf1e9889f451120e333b92da \ + --hash=sha256:5ab15db30d730198384d6445d50cc1fec98361b85366dd092b10e9b9f4a1a2cb # via boto3-stubs -mypy-boto3-cloudformation==1.34.32 \ - --hash=sha256:49d04c090dae3fd8289738ae592cac9d6faa5169684de40c2730b425bba2a32d \ - --hash=sha256:bfe5ec405eae6dae31dc9874729eef5e668e634eae8972032f00400d17bd2c7d +mypy-boto3-cloudformation==1.34.55 \ + --hash=sha256:78c4d25ef7102bd02c8e87d32211ff60a7b474ec546e9948b46f170d341ae0a2 \ + --hash=sha256:de9f4d45d0a4e57bb5ef8b8d7a03476f8ef24ffa253d636cd824cde061227439 # via boto3-stubs mypy-boto3-ecr==1.34.0 \ --hash=sha256:3346c02c22b16068c9acc67d990e32060bf7cdaea5f3d43c50e44308fbbc3439 \ From 783bc7e43ae1f830f0e73b196f2e6220e667d3f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 11:33:47 -0800 Subject: [PATCH 02/23] chore(deps): bump cfn-lint from 0.85.2 to 0.86.0 in /requirements (#6780) Bumps [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint) from 0.85.2 to 0.86.0. - [Release notes](https://github.com/aws-cloudformation/cfn-python-lint/releases) - [Changelog](https://github.com/aws-cloudformation/cfn-lint/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws-cloudformation/cfn-python-lint/compare/v0.85.2...v0.86.0) --- updated-dependencies: - dependency-name: cfn-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/base.txt | 2 +- requirements/reproducible-linux.txt | 6 +++--- requirements/reproducible-mac.txt | 6 +++--- requirements/reproducible-win.txt | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index aac51d4186..c8f6424527 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -28,7 +28,7 @@ regex!=2021.10.8 tzlocal==5.2 #Adding cfn-lint dependency for SAM validate -cfn-lint~=0.85.2 +cfn-lint~=0.86.0 # Type checking boto3 objects boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.56 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 8e68f70f06..abdd3ef447 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -116,9 +116,9 @@ cffi==1.16.0 \ --hash=sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956 \ --hash=sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357 # via cryptography -cfn-lint==0.85.2 \ - --hash=sha256:e7a0aafb9ad93dbe5db54cbefca92a94f2d173309218273ef997ecb048125d89 \ - --hash=sha256:f8a5cc55daeaaa747b8d776dcf62fe1b6bfb8cb46ae60950cbe627601facccd7 +cfn-lint==0.86.0 \ + --hash=sha256:70cefa0ab91e35698cd8c03a2f99a367d71d848da5a62123192552937652d542 \ + --hash=sha256:7216e9c10dd27af73821d0ae79b17406cd89f5dfbc25feb5d2ba756eb6e9a651 # via aws-sam-cli (setup.py) chardet==5.2.0 \ --hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index b80ca6c30f..3dfd80b006 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -134,9 +134,9 @@ cffi==1.16.0 \ --hash=sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956 \ --hash=sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357 # via cryptography -cfn-lint==0.85.2 \ - --hash=sha256:e7a0aafb9ad93dbe5db54cbefca92a94f2d173309218273ef997ecb048125d89 \ - --hash=sha256:f8a5cc55daeaaa747b8d776dcf62fe1b6bfb8cb46ae60950cbe627601facccd7 +cfn-lint==0.86.0 \ + --hash=sha256:70cefa0ab91e35698cd8c03a2f99a367d71d848da5a62123192552937652d542 \ + --hash=sha256:7216e9c10dd27af73821d0ae79b17406cd89f5dfbc25feb5d2ba756eb6e9a651 # via aws-sam-cli (setup.py) chardet==5.2.0 \ --hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index 716182d2f0..e744589b95 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -116,9 +116,9 @@ cffi==1.16.0 \ --hash=sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956 \ --hash=sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357 # via cryptography -cfn-lint==0.85.2 \ - --hash=sha256:e7a0aafb9ad93dbe5db54cbefca92a94f2d173309218273ef997ecb048125d89 \ - --hash=sha256:f8a5cc55daeaaa747b8d776dcf62fe1b6bfb8cb46ae60950cbe627601facccd7 +cfn-lint==0.86.0 \ + --hash=sha256:70cefa0ab91e35698cd8c03a2f99a367d71d848da5a62123192552937652d542 \ + --hash=sha256:7216e9c10dd27af73821d0ae79b17406cd89f5dfbc25feb5d2ba756eb6e9a651 # via aws-sam-cli (setup.py) chardet==5.2.0 \ --hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \ From b98bba519de52f14261ddaddaf248cf3721f77d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:50:15 -0800 Subject: [PATCH 03/23] chore(deps): bump python-dateutil in /requirements (#6775) Bumps [python-dateutil](https://github.com/dateutil/dateutil) from 2.8.2 to 2.9.0.post0. - [Release notes](https://github.com/dateutil/dateutil/releases) - [Changelog](https://github.com/dateutil/dateutil/blob/master/NEWS) - [Commits](https://github.com/dateutil/dateutil/compare/2.8.2...2.9.0.post0) --- updated-dependencies: - dependency-name: python-dateutil dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- requirements/reproducible-linux.txt | 6 +++--- requirements/reproducible-mac.txt | 6 +++--- requirements/reproducible-win.txt | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index abdd3ef447..9b2852c08b 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -572,9 +572,9 @@ pyopenssl==24.0.0 \ --hash=sha256:6aa33039a93fffa4563e655b61d11364d01264be8ccb49906101e02a334530bf \ --hash=sha256:ba07553fb6fd6a7a2259adb9b84e12302a9a8a75c44046e8bb5d3e5ee887e3c3 # via aws-sam-cli (setup.py) -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 +python-dateutil==2.9.0.post0 \ + --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ + --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 # via # arrow # botocore diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index 3dfd80b006..8135dea77c 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -604,9 +604,9 @@ pyopenssl==24.0.0 \ --hash=sha256:6aa33039a93fffa4563e655b61d11364d01264be8ccb49906101e02a334530bf \ --hash=sha256:ba07553fb6fd6a7a2259adb9b84e12302a9a8a75c44046e8bb5d3e5ee887e3c3 # via aws-sam-cli (setup.py) -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 +python-dateutil==2.9.0.post0 \ + --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ + --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 # via # arrow # botocore diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index e744589b95..341b3a78ef 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -576,9 +576,9 @@ pyopenssl==24.0.0 \ --hash=sha256:6aa33039a93fffa4563e655b61d11364d01264be8ccb49906101e02a334530bf \ --hash=sha256:ba07553fb6fd6a7a2259adb9b84e12302a9a8a75c44046e8bb5d3e5ee887e3c3 # via aws-sam-cli (setup.py) -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 +python-dateutil==2.9.0.post0 \ + --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ + --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 # via # arrow # botocore From 9fdbc27a4e684342ddb03758faa0a46f65e75c85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:21:29 -0800 Subject: [PATCH 04/23] chore(deps): bump urllib3 from 1.26.18 to 2.0.7 in /requirements (#6714) * chore(deps): bump urllib3 from 1.26.18 to 2.2.1 in /requirements Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.18 to 2.2.1. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.26.18...2.2.1) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update reproducibles: update-reproducible-linux-reqs * Update reproducibles: update-reproducible-mac-reqs * Update reproducibles: update-reproducible-win-reqs --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: GitHub Action Co-authored-by: Lucas <12496191+lucashuy@users.noreply.github.com> Co-authored-by: jysheng123 <141280295+jysheng123@users.noreply.github.com> Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- requirements/reproducible-linux.txt | 6 +++--- requirements/reproducible-win.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 9b2852c08b..c4fadaf466 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -975,9 +975,9 @@ tzlocal==5.2 \ # via # aws-sam-cli (setup.py) # dateparser -urllib3==1.26.18 \ - --hash=sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07 \ - --hash=sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0 +urllib3==2.0.7 \ + --hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \ + --hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e # via # botocore # docker diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index 341b3a78ef..b354044944 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -999,9 +999,9 @@ tzlocal==5.2 \ # via # aws-sam-cli (setup.py) # dateparser -urllib3==1.26.18 \ - --hash=sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07 \ - --hash=sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0 +urllib3==2.0.7 \ + --hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \ + --hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e # via # botocore # docker From cff9a42d21ed4248177a645b3b5277ca9fb62e3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:44:24 -0800 Subject: [PATCH 05/23] chore(deps): bump the types group in /requirements with 3 updates (#6773) Bumps the types group in /requirements with 3 updates: [types-awscrt](https://github.com/youtype/types-awscrt), [types-setuptools](https://github.com/python/typeshed) and [types-docutils](https://github.com/python/typeshed). Updates `types-awscrt` from 0.20.4 to 0.20.5 - [Release notes](https://github.com/youtype/types-awscrt/releases) - [Commits](https://github.com/youtype/types-awscrt/commits) Updates `types-setuptools` from 69.1.0.20240229 to 69.1.0.20240302 - [Commits](https://github.com/python/typeshed/commits) Updates `types-docutils` from 0.20.0.20240227 to 0.20.0.20240304 - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-awscrt dependency-type: direct:production update-type: version-update:semver-patch dependency-group: types - dependency-name: types-setuptools dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types - dependency-name: types-docutils dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: sidhujus <105385029+sidhujus@users.noreply.github.com> --- requirements/dev.txt | 4 ++-- requirements/reproducible-linux.txt | 6 +++--- requirements/reproducible-mac.txt | 6 +++--- requirements/reproducible-win.txt | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index d382830312..cac0f6afb7 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -12,11 +12,11 @@ types-pywin32==306.0.0.20240130 types-PyYAML==6.0.12.12 types-chevron==0.14.2.20240106 types-psutil==5.9.5.20240205 -types-setuptools==69.1.0.20240229 +types-setuptools==69.1.0.20240302 types-Pygments==2.17.0.20240106 types-colorama==0.4.15.20240205 types-dateparser==1.1.4.20240106 -types-docutils==0.20.0.20240227 +types-docutils==0.20.0.20240304 types-jsonschema==4.21.0.20240118 types-pyOpenSSL==24.0.0.20240228 # as of types-requests>=2.31.0.7, this now requires `urllib3>2`, pin we are able to upgrade diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index c4fadaf466..86047d864e 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -934,9 +934,9 @@ tomlkit==0.12.3 \ --hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \ --hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba # via aws-sam-cli (setup.py) -types-awscrt==0.20.4 \ - --hash=sha256:10245570c7285e949362b4ae710c54bf285d64a27453d42762477bcee5cd77a3 \ - --hash=sha256:73be0a2720d6f76b924df6917d4edf4c9958f83e5c25bf7d9f0c1e9cdf836941 +types-awscrt==0.20.5 \ + --hash=sha256:61811bbf4de95248939f9276a434be93d2b95f6ccfe8aa94e56999e9778cfcc2 \ + --hash=sha256:79d5bfb01f64701b6cf442e89a37d9c4dc6dbb79a46f2f611739b2418d30ecfd # via botocore-stubs types-python-dateutil==2.8.19.20240106 \ --hash=sha256:1f8db221c3b98e6ca02ea83a58371b22c374f42ae5bbdf186db9c9a76581459f \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index 8135dea77c..f9ad8e03c9 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -966,9 +966,9 @@ tomlkit==0.12.3 \ --hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \ --hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba # via aws-sam-cli (setup.py) -types-awscrt==0.20.4 \ - --hash=sha256:10245570c7285e949362b4ae710c54bf285d64a27453d42762477bcee5cd77a3 \ - --hash=sha256:73be0a2720d6f76b924df6917d4edf4c9958f83e5c25bf7d9f0c1e9cdf836941 +types-awscrt==0.20.5 \ + --hash=sha256:61811bbf4de95248939f9276a434be93d2b95f6ccfe8aa94e56999e9778cfcc2 \ + --hash=sha256:79d5bfb01f64701b6cf442e89a37d9c4dc6dbb79a46f2f611739b2418d30ecfd # via botocore-stubs types-python-dateutil==2.8.19.20240106 \ --hash=sha256:1f8db221c3b98e6ca02ea83a58371b22c374f42ae5bbdf186db9c9a76581459f \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index b354044944..115ed3d2d0 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -954,9 +954,9 @@ tomlkit==0.12.3 \ --hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \ --hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba # via aws-sam-cli (setup.py) -types-awscrt==0.20.4 \ - --hash=sha256:10245570c7285e949362b4ae710c54bf285d64a27453d42762477bcee5cd77a3 \ - --hash=sha256:73be0a2720d6f76b924df6917d4edf4c9958f83e5c25bf7d9f0c1e9cdf836941 +types-awscrt==0.20.5 \ + --hash=sha256:61811bbf4de95248939f9276a434be93d2b95f6ccfe8aa94e56999e9778cfcc2 \ + --hash=sha256:79d5bfb01f64701b6cf442e89a37d9c4dc6dbb79a46f2f611739b2418d30ecfd # via botocore-stubs types-python-dateutil==2.8.19.20240106 \ --hash=sha256:1f8db221c3b98e6ca02ea83a58371b22c374f42ae5bbdf186db9c9a76581459f \ From 6e4e06107cd7a852a16a1cea69b8b51d8b06ee62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:26:39 -0800 Subject: [PATCH 06/23] chore(deps): bump rich from 13.7.0 to 13.7.1 in /requirements (#6764) Bumps [rich](https://github.com/Textualize/rich) from 13.7.0 to 13.7.1. - [Release notes](https://github.com/Textualize/rich/releases) - [Changelog](https://github.com/Textualize/rich/blob/master/CHANGELOG.md) - [Commits](https://github.com/Textualize/rich/compare/v13.7.0...v13.7.1) --- updated-dependencies: - dependency-name: rich dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: sidhujus <105385029+sidhujus@users.noreply.github.com> Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- requirements/base.txt | 2 +- requirements/reproducible-linux.txt | 6 +++--- requirements/reproducible-mac.txt | 6 +++--- requirements/reproducible-win.txt | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index c8f6424527..590098f0eb 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -14,7 +14,7 @@ requests~=2.31.0 aws_lambda_builders==1.47.0 tomlkit==0.12.3 watchdog==4.0.0 -rich~=13.7.0 +rich~=13.7.1 pyopenssl~=24.0.0 # Pin to <4.18 to until SAM-T no longer uses RefResolver jsonschema<4.22 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 86047d864e..f430c0f794 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -743,9 +743,9 @@ requests==2.31.0 \ # aws-sam-cli (setup.py) # cookiecutter # docker -rich==13.7.0 \ - --hash=sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa \ - --hash=sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235 +rich==13.7.1 \ + --hash=sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222 \ + --hash=sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432 # via # aws-sam-cli (setup.py) # cookiecutter diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index f9ad8e03c9..c2005e1278 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -775,9 +775,9 @@ requests==2.31.0 \ # aws-sam-cli (setup.py) # cookiecutter # docker -rich==13.7.0 \ - --hash=sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa \ - --hash=sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235 +rich==13.7.1 \ + --hash=sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222 \ + --hash=sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432 # via # aws-sam-cli (setup.py) # cookiecutter diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index 115ed3d2d0..fb3fb243c4 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -763,9 +763,9 @@ requests==2.31.0 \ # aws-sam-cli (setup.py) # cookiecutter # docker -rich==13.7.0 \ - --hash=sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa \ - --hash=sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235 +rich==13.7.1 \ + --hash=sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222 \ + --hash=sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432 # via # aws-sam-cli (setup.py) # cookiecutter From 177310c9f8c09b765c0d6af52f2b3f18e3015860 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:27:08 -0800 Subject: [PATCH 07/23] chore(deps): bump tomlkit from 0.12.3 to 0.12.4 in /requirements (#6765) Bumps [tomlkit](https://github.com/sdispater/tomlkit) from 0.12.3 to 0.12.4. - [Release notes](https://github.com/sdispater/tomlkit/releases) - [Changelog](https://github.com/sdispater/tomlkit/blob/master/CHANGELOG.md) - [Commits](https://github.com/sdispater/tomlkit/compare/0.12.3...0.12.4) --- updated-dependencies: - dependency-name: tomlkit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> Co-authored-by: sidhujus <105385029+sidhujus@users.noreply.github.com> --- requirements/base.txt | 2 +- requirements/reproducible-linux.txt | 6 +++--- requirements/reproducible-mac.txt | 6 +++--- requirements/reproducible-win.txt | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 590098f0eb..17a3c7388e 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -12,7 +12,7 @@ docker~=7.0.0 dateparser~=1.2 requests~=2.31.0 aws_lambda_builders==1.47.0 -tomlkit==0.12.3 +tomlkit==0.12.4 watchdog==4.0.0 rich~=13.7.1 pyopenssl~=24.0.0 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index f430c0f794..877cb12f72 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -930,9 +930,9 @@ text-unidecode==1.3 \ --hash=sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8 \ --hash=sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93 # via python-slugify -tomlkit==0.12.3 \ - --hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \ - --hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba +tomlkit==0.12.4 \ + --hash=sha256:5cd82d48a3dd89dee1f9d64420aa20ae65cfbd00668d6f094d7578a78efbb77b \ + --hash=sha256:7ca1cfc12232806517a8515047ba66a19369e71edf2439d0f5824f91032b6cc3 # via aws-sam-cli (setup.py) types-awscrt==0.20.5 \ --hash=sha256:61811bbf4de95248939f9276a434be93d2b95f6ccfe8aa94e56999e9778cfcc2 \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index c2005e1278..ac1eab49d4 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -962,9 +962,9 @@ text-unidecode==1.3 \ --hash=sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8 \ --hash=sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93 # via python-slugify -tomlkit==0.12.3 \ - --hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \ - --hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba +tomlkit==0.12.4 \ + --hash=sha256:5cd82d48a3dd89dee1f9d64420aa20ae65cfbd00668d6f094d7578a78efbb77b \ + --hash=sha256:7ca1cfc12232806517a8515047ba66a19369e71edf2439d0f5824f91032b6cc3 # via aws-sam-cli (setup.py) types-awscrt==0.20.5 \ --hash=sha256:61811bbf4de95248939f9276a434be93d2b95f6ccfe8aa94e56999e9778cfcc2 \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index fb3fb243c4..f69549e64b 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -950,9 +950,9 @@ text-unidecode==1.3 \ --hash=sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8 \ --hash=sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93 # via python-slugify -tomlkit==0.12.3 \ - --hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \ - --hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba +tomlkit==0.12.4 \ + --hash=sha256:5cd82d48a3dd89dee1f9d64420aa20ae65cfbd00668d6f094d7578a78efbb77b \ + --hash=sha256:7ca1cfc12232806517a8515047ba66a19369e71edf2439d0f5824f91032b6cc3 # via aws-sam-cli (setup.py) types-awscrt==0.20.5 \ --hash=sha256:61811bbf4de95248939f9276a434be93d2b95f6ccfe8aa94e56999e9778cfcc2 \ From 1305c33b80a4f691ea3f62c56c6bce5fce85f0e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 00:48:07 +0000 Subject: [PATCH 08/23] chore(deps): bump typing-extensions in /requirements (#6767) Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.9.0 to 4.10.0. - [Release notes](https://github.com/python/typing_extensions/releases) - [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md) - [Commits](https://github.com/python/typing_extensions/compare/4.9.0...4.10.0) --- updated-dependencies: - dependency-name: typing-extensions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: sidhujus <105385029+sidhujus@users.noreply.github.com> Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- requirements/reproducible-linux.txt | 6 +++--- requirements/reproducible-mac.txt | 6 +++--- requirements/reproducible-win.txt | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 877cb12f72..c5a83150bf 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -946,9 +946,9 @@ types-s3transfer==0.10.0 \ --hash=sha256:35e4998c25df7f8985ad69dedc8e4860e8af3b43b7615e940d53c00d413bdc69 \ --hash=sha256:44fcdf0097b924a9aab1ee4baa1179081a9559ca62a88c807e2b256893ce688f # via boto3-stubs -typing-extensions==4.9.0 \ - --hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \ - --hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd +typing-extensions==4.10.0 \ + --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \ + --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb # via # aws-sam-cli (setup.py) # aws-sam-translator diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index ac1eab49d4..721203eca1 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -978,9 +978,9 @@ types-s3transfer==0.10.0 \ --hash=sha256:35e4998c25df7f8985ad69dedc8e4860e8af3b43b7615e940d53c00d413bdc69 \ --hash=sha256:44fcdf0097b924a9aab1ee4baa1179081a9559ca62a88c807e2b256893ce688f # via boto3-stubs -typing-extensions==4.9.0 \ - --hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \ - --hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd +typing-extensions==4.10.0 \ + --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \ + --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb # via # annotated-types # aws-sam-cli (setup.py) diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index f69549e64b..4a1d20704f 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -966,9 +966,9 @@ types-s3transfer==0.10.0 \ --hash=sha256:35e4998c25df7f8985ad69dedc8e4860e8af3b43b7615e940d53c00d413bdc69 \ --hash=sha256:44fcdf0097b924a9aab1ee4baa1179081a9559ca62a88c807e2b256893ce688f # via boto3-stubs -typing-extensions==4.9.0 \ - --hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \ - --hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd +typing-extensions==4.10.0 \ + --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \ + --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb # via # aws-sam-cli (setup.py) # aws-sam-translator From 9bcbc0435e377efd141187c4aff3bc83a2ace555 Mon Sep 17 00:00:00 2001 From: Jared Bentvelsen Date: Thu, 7 Mar 2024 08:11:02 -0800 Subject: [PATCH 09/23] Handle Container Creation Failure in `local invoke`, `local start-api` and `local start-lambda` (#6719) * Refactor to run sam validate before any sam local logic * Formatting * refactor sam validate * raise docker image creation error * fix lint errors * update type hint * handle container creation error in local apigw service * reformat * handle errors in local api invoke and local lambda invoke * move exception * handle error in local invoke * remove unnecessary integration tests * fix formatting * use try/except to run lint --------- Co-authored-by: Jared Bentvelsen Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> --- .../local/cli_common/invoke_context.py | 14 ++++- samcli/commands/local/invoke/cli.py | 9 ++- samcli/commands/local/start_api/cli.py | 1 + samcli/commands/local/start_lambda/cli.py | 1 + samcli/commands/validate/validate.py | 50 +++------------- samcli/lib/lint.py | 60 +++++++++++++++++++ samcli/local/apigw/local_apigw_service.py | 3 + samcli/local/apigw/service_error_responses.py | 10 ++++ samcli/local/docker/container.py | 20 ++++++- samcli/local/docker/exceptions.py | 6 ++ .../lambda_service/lambda_error_responses.py | 26 ++++++++ .../local_lambda_invoke_service.py | 3 + samcli/local/lambdafn/runtime.py | 6 +- tests/unit/commands/local/invoke/test_cli.py | 12 +++- .../unit/commands/local/start_api/test_cli.py | 1 + .../commands/local/start_lambda/test_cli.py | 1 + tests/unit/lib/test_lint.py | 50 ++++++++++++++++ .../local/apigw/test_local_apigw_service.py | 22 +++++++ .../test_local_lambda_invoke_service.py | 24 ++++++++ 19 files changed, 269 insertions(+), 50 deletions(-) create mode 100644 samcli/lib/lint.py create mode 100644 tests/unit/lib/test_lint.py diff --git a/samcli/commands/local/cli_common/invoke_context.py b/samcli/commands/local/cli_common/invoke_context.py index 9255761143..cc5412431a 100644 --- a/samcli/commands/local/cli_common/invoke_context.py +++ b/samcli/commands/local/cli_common/invoke_context.py @@ -11,10 +11,11 @@ from typing import Any, Dict, List, Optional, TextIO, Tuple, Type, cast from samcli.commands._utils.template import TemplateFailedParsingException, TemplateNotFoundException -from samcli.commands.exceptions import ContainersInitializationException +from samcli.commands.exceptions import ContainersInitializationException, UserException from samcli.commands.local.cli_common.user_exceptions import DebugContextException, InvokeContextException from samcli.commands.local.lib.debug_context import DebugContext from samcli.commands.local.lib.local_lambda import LocalLambdaRunner +from samcli.lib.lint import get_lint_matches from samcli.lib.providers.provider import Function, Stack from samcli.lib.providers.sam_function_provider import RefreshableSamFunctionProvider, SamFunctionProvider from samcli.lib.providers.sam_stack_provider import SamLocalStackProvider @@ -100,6 +101,7 @@ def __init__( container_host_interface: Optional[str] = None, add_host: Optional[dict] = None, invoke_images: Optional[str] = None, + verbose: bool = False, ) -> None: """ Initialize the context @@ -154,6 +156,8 @@ def __init__( Optional. Docker extra hosts support from --add-host parameters invoke_images dict Optional. A dictionary that defines the custom invoke image URI of each function + verbose bool + Set template validation to verbose mode """ self._template_file = template_file self._function_identifier = function_identifier @@ -178,6 +182,7 @@ def __init__( self._aws_region = aws_region self._aws_profile = aws_profile self._shutdown = shutdown + self._verbose = verbose self._container_host = container_host self._container_host_interface = container_host_interface @@ -220,6 +225,13 @@ def __enter__(self) -> "InvokeContext": self._stacks = self._get_stacks() + try: + _, matches_output = get_lint_matches(self._template_file, self._verbose, self._aws_region) + if matches_output: + LOG.warning("Lint Error found, containter creation might fail: %s", matches_output) + except UserException as e: + LOG.warning("Non blocking error found when trying to validate template: %s", e) + _function_providers_class: Dict[ContainersMode, Type[SamFunctionProvider]] = { ContainersMode.WARM: RefreshableSamFunctionProvider, ContainersMode.COLD: SamFunctionProvider, diff --git a/samcli/commands/local/invoke/cli.py b/samcli/commands/local/invoke/cli.py index a31d68386d..265d3db16e 100644 --- a/samcli/commands/local/invoke/cli.py +++ b/samcli/commands/local/invoke/cli.py @@ -16,7 +16,11 @@ from samcli.commands.local.lib.exceptions import InvalidIntermediateImageError from samcli.lib.telemetry.metric import track_command from samcli.lib.utils.version_checker import check_newer_version -from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse +from samcli.local.docker.exceptions import ( + ContainerNotStartableException, + DockerContainerCreationFailedException, + PortAlreadyInUse, +) LOG = logging.getLogger(__name__) @@ -200,6 +204,7 @@ def do_cli( # pylint: disable=R0914 container_host_interface=container_host_interface, add_host=add_host, invoke_images=processed_invoke_images, + ctx=ctx, ) as context: # Invoke the function context.local_lambda_runner.invoke( @@ -220,7 +225,7 @@ def do_cli( # pylint: disable=R0914 PortAlreadyInUse, ) as ex: raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex - except DockerImagePullFailedException as ex: + except (DockerImagePullFailedException, DockerContainerCreationFailedException) as ex: raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex except ContainerNotStartableException as ex: raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex diff --git a/samcli/commands/local/start_api/cli.py b/samcli/commands/local/start_api/cli.py index fc42468d9d..532678cab6 100644 --- a/samcli/commands/local/start_api/cli.py +++ b/samcli/commands/local/start_api/cli.py @@ -253,6 +253,7 @@ def do_cli( # pylint: disable=R0914 container_host_interface=container_host_interface, invoke_images=processed_invoke_images, add_host=add_host, + ctx=ctx, ) as invoke_context: ssl_context = (ssl_cert_file, ssl_key_file) if ssl_cert_file else None service = LocalApiService( diff --git a/samcli/commands/local/start_lambda/cli.py b/samcli/commands/local/start_lambda/cli.py index 275afa7f1c..22267e23d5 100644 --- a/samcli/commands/local/start_lambda/cli.py +++ b/samcli/commands/local/start_lambda/cli.py @@ -205,6 +205,7 @@ def do_cli( # pylint: disable=R0914 container_host_interface=container_host_interface, add_host=add_host, invoke_images=processed_invoke_images, + ctx=ctx, ) as invoke_context: service = LocalLambdaService(lambda_invoke_context=invoke_context, port=port, host=host) service.start() diff --git a/samcli/commands/validate/validate.py b/samcli/commands/validate/validate.py index db0a130b24..732608c7b5 100644 --- a/samcli/commands/validate/validate.py +++ b/samcli/commands/validate/validate.py @@ -142,49 +142,15 @@ def _lint(ctx: Context, template: str) -> None: Path to the template file """ + from samcli.lib.lint import get_lint_matches - import logging - - import cfnlint.core # type: ignore - - from samcli.commands.exceptions import UserException - - cfn_lint_logger = logging.getLogger("cfnlint") - cfn_lint_logger.propagate = False EventTracker.track_event("UsedFeature", "CFNLint") + matches, matches_output = get_lint_matches(template, ctx.debug, ctx.region) + if not matches: + click.secho("{} is a valid SAM Template".format(template), fg="green") + return - try: - lint_args = [template] - if ctx.debug: - lint_args.append("--debug") - if ctx.region: - lint_args.append("--region") - lint_args.append(ctx.region) - - (args, filenames, formatter) = cfnlint.core.get_args_filenames(lint_args) - cfn_lint_logger.setLevel(logging.WARNING) - matches = list(cfnlint.core.get_matches(filenames, args)) - if not matches: - click.secho("{} is a valid SAM Template".format(template), fg="green") - return - - rules = cfnlint.core.get_used_rules() - matches_output = formatter.print_matches(matches, rules, filenames) - - if matches_output: - click.secho(matches_output) - - raise LinterRuleMatchedException( - "Linting failed. At least one linting rule was matched to the provided template." - ) + if matches_output: + click.secho(matches_output) - except cfnlint.core.InvalidRegionException as e: - raise UserException( - "AWS Region was not found. Please configure your region through the --region option", - wrapped_from=e.__class__.__name__, - ) from e - except cfnlint.core.CfnLintExitException as lint_error: - raise UserException( - lint_error, - wrapped_from=lint_error.__class__.__name__, - ) from lint_error + raise LinterRuleMatchedException("Linting failed. At least one linting rule was matched to the provided template.") diff --git a/samcli/lib/lint.py b/samcli/lib/lint.py new file mode 100644 index 0000000000..d0b20945fb --- /dev/null +++ b/samcli/lib/lint.py @@ -0,0 +1,60 @@ +from typing import List, Optional, Tuple + + +def get_lint_matches(template: str, debug: Optional[bool] = None, region: Optional[str] = None) -> Tuple[List, str]: + """ + Parses provided SAM template and maps errors from CloudFormation template back to SAM template. + + Cfn-lint loggers are added to the SAM cli logging hierarchy which at the root logger + configures with INFO level logging and a different formatting. This exposes and duplicates + some cfn-lint logs that are not typically shown to customers. Explicitly setting the level to + WARNING and propagate to be False remediates these issues. + + Parameters + ----------- + template + Path to the template file + debug + Enable debug mode + region + AWS region to run against + + """ + + import logging + + import cfnlint.core # type: ignore + + from samcli.commands.exceptions import UserException + + cfn_lint_logger = logging.getLogger("cfnlint") + cfn_lint_logger.propagate = False + + try: + lint_args = [template] + if debug: + lint_args.append("--debug") + if region: + lint_args.append("--region") + lint_args.append(region) + + (args, filenames, formatter) = cfnlint.core.get_args_filenames(lint_args) + cfn_lint_logger.setLevel(logging.WARNING) + matches = list(cfnlint.core.get_matches(filenames, args)) + if not matches: + return matches, "" + + rules = cfnlint.core.get_used_rules() + matches_output = formatter.print_matches(matches, rules, filenames) + return matches, matches_output + + except cfnlint.core.InvalidRegionException as e: + raise UserException( + "AWS Region was not found. Please configure your region through the --region option", + wrapped_from=e.__class__.__name__, + ) from e + except cfnlint.core.CfnLintExitException as lint_error: + raise UserException( + lint_error, + wrapped_from=lint_error.__class__.__name__, + ) from lint_error diff --git a/samcli/local/apigw/local_apigw_service.py b/samcli/local/apigw/local_apigw_service.py index 1e0f871fcd..78104c0f7b 100644 --- a/samcli/local/apigw/local_apigw_service.py +++ b/samcli/local/apigw/local_apigw_service.py @@ -30,6 +30,7 @@ from samcli.local.apigw.path_converter import PathConverter from samcli.local.apigw.route import Route from samcli.local.apigw.service_error_responses import ServiceErrorResponses +from samcli.local.docker.exceptions import DockerContainerCreationFailedException from samcli.local.events.api_event import ( ContextHTTP, ContextIdentity, @@ -730,6 +731,8 @@ def _request_handler(self, **kwargs): ) except LambdaResponseParseException: endpoint_service_error = ServiceErrorResponses.lambda_body_failure_response() + except DockerContainerCreationFailedException as ex: + endpoint_service_error = ServiceErrorResponses.container_creation_failed(ex.message) if endpoint_service_error: return endpoint_service_error diff --git a/samcli/local/apigw/service_error_responses.py b/samcli/local/apigw/service_error_responses.py index 42c91e22c1..6c19b3a2e7 100644 --- a/samcli/local/apigw/service_error_responses.py +++ b/samcli/local/apigw/service_error_responses.py @@ -101,3 +101,13 @@ def route_not_found(*args): """ response_data = jsonify(ServiceErrorResponses._MISSING_AUTHENTICATION) return make_response(response_data, ServiceErrorResponses.HTTP_STATUS_CODE_403) + + @staticmethod + def container_creation_failed(message): + """ + Constuct a Flask Response for when container creation fails for a Lambda Function + + :return: a Flask Response + """ + response_data = jsonify({"message": message}) + return make_response(response_data, ServiceErrorResponses.HTTP_STATUS_CODE_501) diff --git a/samcli/local/docker/container.py b/samcli/local/docker/container.py index 9e83e8eca0..a34e96c7c1 100644 --- a/samcli/local/docker/container.py +++ b/samcli/local/docker/container.py @@ -17,14 +17,23 @@ import docker import requests -from docker.errors import NotFound as DockerNetworkNotFound +from docker.errors import ( + APIError as DockerAPIError, +) +from docker.errors import ( + NotFound as DockerNetworkNotFound, +) from samcli.lib.constants import DOCKER_MIN_API_VERSION from samcli.lib.utils.retry import retry from samcli.lib.utils.stream_writer import StreamWriter from samcli.lib.utils.tar import extract_tarfile from samcli.local.docker.effective_user import ROOT_USER_ID, EffectiveUser -from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse +from samcli.local.docker.exceptions import ( + ContainerNotStartableException, + DockerContainerCreationFailedException, + PortAlreadyInUse, +) from samcli.local.docker.utils import NoFreePortsError, find_free_port, to_posix_path LOG = logging.getLogger(__name__) @@ -227,7 +236,12 @@ def create(self): if self._extra_hosts: kwargs["extra_hosts"] = self._extra_hosts - real_container = self.docker_client.containers.create(self._image, **kwargs) + try: + real_container = self.docker_client.containers.create(self._image, **kwargs) + except DockerAPIError as ex: + raise DockerContainerCreationFailedException( + f"Container creation failed: {ex.explanation}, check template for potential issue" + ) self.id = real_container.id self._logs_thread = None diff --git a/samcli/local/docker/exceptions.py b/samcli/local/docker/exceptions.py index 6ff7ad3850..e22eac1583 100644 --- a/samcli/local/docker/exceptions.py +++ b/samcli/local/docker/exceptions.py @@ -37,3 +37,9 @@ class InvalidRuntimeException(UserException): """ Raised when an invalid runtime is specified for a Lambda Function """ + + +class DockerContainerCreationFailedException(UserException): + """ + Docker Container Creation failed. It could be due to invalid template + """ diff --git a/samcli/local/lambda_service/lambda_error_responses.py b/samcli/local/lambda_service/lambda_error_responses.py index 89ef7b13dc..3596828bf5 100644 --- a/samcli/local/lambda_service/lambda_error_responses.py +++ b/samcli/local/lambda_service/lambda_error_responses.py @@ -20,6 +20,7 @@ class LambdaErrorResponses: InvalidRequestContentException = ("InvalidRequestContent", 400) NotImplementedException = ("NotImplemented", 501) + ContainerCreationFailed = ("ContainerCreationFailed", 501) PathNotFoundException = ("PathNotFoundLocally", 404) @@ -204,6 +205,31 @@ def generic_method_not_allowed(*args): exception_tuple[1], ) + @staticmethod + def container_creation_failed(message): + """ + Creates a Container Creation Failed response + + Parameters + ---------- + args list + List of arguments Flask passes to the method + + Returns + ------- + Flask.Response + A response object representing the ContainerCreationFailed Error + """ + error_type, status_code = LambdaErrorResponses.ContainerCreationFailed + return BaseLocalService.service_response( + LambdaErrorResponses._construct_error_response_body( + LambdaErrorResponses.LOCAL_SERVICE_ERROR, + message, + ), + LambdaErrorResponses._construct_headers(error_type), + status_code, + ) + @staticmethod def _construct_error_response_body(error_type, error_message): """ diff --git a/samcli/local/lambda_service/local_lambda_invoke_service.py b/samcli/local/lambda_service/local_lambda_invoke_service.py index a847802b3c..51030f6806 100644 --- a/samcli/local/lambda_service/local_lambda_invoke_service.py +++ b/samcli/local/lambda_service/local_lambda_invoke_service.py @@ -9,6 +9,7 @@ from samcli.commands.local.lib.exceptions import UnsupportedInlineCodeError from samcli.lib.utils.stream_writer import StreamWriter +from samcli.local.docker.exceptions import DockerContainerCreationFailedException from samcli.local.lambdafn.exceptions import FunctionNotFound from samcli.local.services.base_local_service import BaseLocalService, LambdaOutputParser @@ -178,6 +179,8 @@ def _invoke_request_handler(self, function_name): return LambdaErrorResponses.not_implemented_locally( "Inline code is not supported for sam local commands. Please write your code in a separate file." ) + except DockerContainerCreationFailedException as ex: + return LambdaErrorResponses.container_creation_failed(ex.message) lambda_response, is_lambda_user_error_response = LambdaOutputParser.get_lambda_output( stdout_stream_string, stdout_stream_bytes diff --git a/samcli/local/lambdafn/runtime.py b/samcli/local/lambdafn/runtime.py index 83af384dcf..38922f858d 100644 --- a/samcli/local/lambdafn/runtime.py +++ b/samcli/local/lambdafn/runtime.py @@ -16,7 +16,7 @@ from samcli.lib.utils.packagetype import ZIP from samcli.local.docker.container import Container from samcli.local.docker.container_analyzer import ContainerAnalyzer -from samcli.local.docker.exceptions import ContainerFailureError +from samcli.local.docker.exceptions import ContainerFailureError, DockerContainerCreationFailedException from samcli.local.docker.lambda_container import LambdaContainer from ...lib.providers.provider import LayerVersion @@ -112,6 +112,10 @@ def create( self._container_manager.create(container) return container + except DockerContainerCreationFailedException: + LOG.warning("Failed to create container for function %s", function_config.full_path) + raise + except KeyboardInterrupt: LOG.debug("Ctrl+C was pressed. Aborting container creation") raise diff --git a/tests/unit/commands/local/invoke/test_cli.py b/tests/unit/commands/local/invoke/test_cli.py index a033905b8c..476dd99ce2 100644 --- a/tests/unit/commands/local/invoke/test_cli.py +++ b/tests/unit/commands/local/invoke/test_cli.py @@ -6,7 +6,11 @@ from unittest.mock import patch, Mock from parameterized import parameterized, param -from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse +from samcli.local.docker.exceptions import ( + ContainerNotStartableException, + PortAlreadyInUse, + DockerContainerCreationFailedException, +) from samcli.local.lambdafn.exceptions import FunctionNotFound from samcli.lib.providers.exceptions import InvalidLayerReference from samcli.commands.validate.lib.exceptions import InvalidSamDocumentException @@ -112,6 +116,7 @@ def test_cli_must_setup_context_and_invoke(self, get_event_mock, InvokeContextMo container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={None: "amazon/aws-sam-cli-emulation-image-python3.9"}, + ctx=self.ctx_mock, ) context_mock.local_lambda_runner.invoke.assert_called_with( @@ -152,6 +157,7 @@ def test_cli_must_invoke_with_no_event(self, get_event_mock, InvokeContextMock): container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={None: "amazon/aws-sam-cli-emulation-image-python3.9"}, + ctx=self.ctx_mock, ) get_event_mock.assert_not_called() @@ -263,6 +269,10 @@ def test_must_raise_user_exception_on_invalid_env_vars(self, get_event_mock, Inv PortAlreadyInUse("Container cannot be started, provided port already in use"), "Container cannot be started, provided port already in use", ), + param( + DockerContainerCreationFailedException("Container creation failed, check template for potential issue"), + "Container creation failed, check template for potential issue", + ), ] ) @patch("samcli.commands.local.cli_common.invoke_context.InvokeContext") diff --git a/tests/unit/commands/local/start_api/test_cli.py b/tests/unit/commands/local/start_api/test_cli.py index 1860dd66c0..54c7e663d1 100644 --- a/tests/unit/commands/local/start_api/test_cli.py +++ b/tests/unit/commands/local/start_api/test_cli.py @@ -97,6 +97,7 @@ def test_cli_must_setup_context_and_start_service(self, local_api_service_mock, container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={}, + ctx=self.ctx_mock, ) local_api_service_mock.assert_called_with( diff --git a/tests/unit/commands/local/start_lambda/test_cli.py b/tests/unit/commands/local/start_lambda/test_cli.py index aa779ed871..d743f13e3e 100644 --- a/tests/unit/commands/local/start_lambda/test_cli.py +++ b/tests/unit/commands/local/start_lambda/test_cli.py @@ -84,6 +84,7 @@ def test_cli_must_setup_context_and_start_service(self, local_lambda_service_moc container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={}, + ctx=self.ctx_mock, ) local_lambda_service_mock.assert_called_with(lambda_invoke_context=context_mock, port=self.port, host=self.host) diff --git a/tests/unit/lib/test_lint.py b/tests/unit/lib/test_lint.py new file mode 100644 index 0000000000..d5eda1f8aa --- /dev/null +++ b/tests/unit/lib/test_lint.py @@ -0,0 +1,50 @@ +from unittest import TestCase +from unittest.mock import Mock, patch + +from parameterized import parameterized + +from samcli.lib.lint import get_lint_matches + + +class TestLint(TestCase): + args_mock = Mock() + filenames_mock = Mock() + formatter_mock = Mock() + get_args_filenames_mock = Mock() + get_matches_mock = Mock() + + @parameterized.expand( + [ + (("path/to/template", None, None), ["path/to/template"]), + (("path/to/template", True, None), ["path/to/template", "--debug"]), + (("path/to/template", False, "us-east-1"), ["path/to/template", "--region", "us-east-1"]), + ] + ) + @patch("cfnlint.core") + def test_empty_matches(self, call_args, expect_called_args, cfnlint_mock): + self.get_args_filenames_mock.return_value = (self.args_mock, self.filenames_mock, self.formatter_mock) + cfnlint_mock.get_args_filenames = self.get_args_filenames_mock + self.get_matches_mock.return_value = [] + cfnlint_mock.get_matches = self.get_matches_mock + actual = get_lint_matches(*call_args) + self.get_args_filenames_mock.assert_called_with(expect_called_args) + self.get_matches_mock.assert_called_with(self.filenames_mock, self.args_mock) + self.assertEqual(actual, ([], "")) + + @patch("cfnlint.core") + def test_non_empty_matches(self, cfnlint_mock): + self.get_args_filenames_mock.return_value = (self.args_mock, self.filenames_mock, self.formatter_mock) + cfnlint_mock.get_args_filenames = self.get_args_filenames_mock + match = Mock() + self.get_matches_mock.return_value = [match] + cfnlint_mock.get_matches = self.get_matches_mock + cfnlint_mock.get_used_rules = Mock() + self.formatter_mock.print_matches = Mock() + self.formatter_mock.print_matches.return_value = "lint error" + + actual = get_lint_matches("path_to_template") + self.get_args_filenames_mock.assert_called_with(["path_to_template"]) + self.get_matches_mock.assert_called_with(self.filenames_mock, self.args_mock) + cfnlint_mock.get_used_rules.assert_called_once() + self.formatter_mock.print_matches.assert_called_once() + self.assertEqual(actual, ([match], "lint error")) diff --git a/tests/unit/local/apigw/test_local_apigw_service.py b/tests/unit/local/apigw/test_local_apigw_service.py index c3442aaf06..54bf0da1e0 100644 --- a/tests/unit/local/apigw/test_local_apigw_service.py +++ b/tests/unit/local/apigw/test_local_apigw_service.py @@ -23,6 +23,7 @@ LambdaResponseParseException, PayloadFormatVersionValidateException, ) +from samcli.local.docker.exceptions import DockerContainerCreationFailedException from samcli.local.lambdafn.exceptions import FunctionNotFound from samcli.commands.local.lib.exceptions import UnsupportedInlineCodeError @@ -457,6 +458,27 @@ def test_request_handles_error_when_invoke_function_with_inline_code( self.assertEqual(response, not_implemented_response_mock) + @patch.object(LocalApigwService, "get_request_methods_endpoints") + @patch("samcli.local.apigw.local_apigw_service.ServiceErrorResponses") + @patch("samcli.local.apigw.local_apigw_service.LocalApigwService._generate_lambda_event") + def test_request_handles_error_when_container_creation_failed( + self, generate_mock, service_error_responses_patch, request_mock + ): + generate_mock.return_value = {} + container_creation_failed_response_mock = Mock() + self.api_service._get_current_route = MagicMock() + self.api_service._get_current_route.return_value.payload_format_version = "2.0" + self.api_service._get_current_route.return_value.authorizer_object = None + self.api_service._get_current_route.methods = [] + + service_error_responses_patch.container_creation_failed.return_value = container_creation_failed_response_mock + + self.lambda_runner.invoke.side_effect = DockerContainerCreationFailedException("container creation failed") + request_mock.return_value = ("test", "test") + response = self.api_service._request_handler() + + self.assertEqual(response, container_creation_failed_response_mock) + @patch.object(LocalApigwService, "get_request_methods_endpoints") def test_request_throws_when_invoke_fails(self, request_mock): self.lambda_runner.invoke.side_effect = Exception() diff --git a/tests/unit/local/lambda_service/test_local_lambda_invoke_service.py b/tests/unit/local/lambda_service/test_local_lambda_invoke_service.py index e338762db9..af5a2a5aa2 100644 --- a/tests/unit/local/lambda_service/test_local_lambda_invoke_service.py +++ b/tests/unit/local/lambda_service/test_local_lambda_invoke_service.py @@ -1,6 +1,7 @@ from unittest import TestCase from unittest.mock import Mock, patch, ANY, call +from samcli.local.docker.exceptions import DockerContainerCreationFailedException from samcli.local.lambda_service import local_lambda_invoke_service from samcli.local.lambda_service.local_lambda_invoke_service import LocalLambdaInvokeService, FunctionNamePathConverter from samcli.local.lambdafn.exceptions import FunctionNotFound @@ -111,6 +112,29 @@ def test_invoke_request_function_contains_inline_code(self, lambda_error_respons lambda_error_responses_mock.not_implemented_locally.assert_called() + @patch("samcli.local.lambda_service.local_lambda_invoke_service.LambdaErrorResponses") + def test_invoke_request_container_creation_failed(self, lambda_error_responses_mock): + request_mock = Mock() + request_mock.get_data.return_value = b"{}" + local_lambda_invoke_service.request = request_mock + + lambda_runner_mock = Mock() + lambda_runner_mock.invoke.side_effect = DockerContainerCreationFailedException("container creation failed") + + lambda_error_responses_mock.container_creation_failed.return_value = "Container creation failed" + + service = LocalLambdaInvokeService(lambda_runner=lambda_runner_mock, port=3000, host="localhost") + + response = service._invoke_request_handler(function_name="FunctionContainerCreationFailed") + + self.assertEqual(response, "Container creation failed") + + lambda_runner_mock.invoke.assert_called_once_with( + "FunctionContainerCreationFailed", "{}", stdout=ANY, stderr=None + ) + + lambda_error_responses_mock.container_creation_failed.assert_called() + @patch("samcli.local.lambda_service.local_lambda_invoke_service.LocalLambdaInvokeService.service_response") @patch("samcli.local.lambda_service.local_lambda_invoke_service.LambdaOutputParser") def test_request_handler_returns_process_stdout_when_making_response( From e729cdb7fc35c88507290f800bee64d97968ab15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:01:02 -0800 Subject: [PATCH 10/23] chore(deps): bump the boto group in /requirements with 4 updates (#6790) Bumps the boto group in /requirements with 4 updates: [boto3](https://github.com/boto/boto3), [boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]](https://github.com/youtype/mypy_boto3_builder), [botocore](https://github.com/boto/botocore) and [botocore-stubs](https://github.com/youtype/botocore-stubs). Updates `boto3` from 1.34.56 to 1.34.57 - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.34.56...1.34.57) Updates `boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]` from 1.34.56 to 1.34.57 - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) Updates `botocore` from 1.34.56 to 1.34.57 - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.34.56...1.34.57) Updates `botocore-stubs` from 1.34.56 to 1.34.57 - [Release notes](https://github.com/youtype/botocore-stubs/releases) - [Commits](https://github.com/youtype/botocore-stubs/commits) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray] dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore-stubs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/base.txt | 2 +- requirements/reproducible-linux.txt | 24 ++++++++++++------------ requirements/reproducible-mac.txt | 24 ++++++++++++------------ requirements/reproducible-win.txt | 24 ++++++++++++------------ 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 17a3c7388e..5c048aad48 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -31,4 +31,4 @@ tzlocal==5.2 cfn-lint~=0.86.0 # Type checking boto3 objects -boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.56 +boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.57 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index c5a83150bf..00cb00bf70 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -38,25 +38,25 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.56 \ - --hash=sha256:300888f0c1b6f32f27f85a9aa876f50f46514ec619647af7e4d20db74d339714 \ - --hash=sha256:b26928f9a21cf3649cea20a59061340f3294c6e7785ceb6e1a953eb8010dc3ba +boto3==1.34.57 \ + --hash=sha256:c26c31ceeeb2bc5d2bb96ba0fdc9a04d7b10e6e0b081c55b9cea9069a0be04dd \ + --hash=sha256:f8046e3e2d1186a49b49f7464c4811c265c86001f404dd1a96c4365c773a4245 # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.56 \ - --hash=sha256:627f8eca69d832581ee1676d39df099a2a2e3a86d6b3ebd21c81c5f11ed6a6fa \ - --hash=sha256:a87e7ecbab6235ec371b4363027e57483bca349a9cd5c891f40db81dadfa273e +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.57 \ + --hash=sha256:2b7271bb6876dc6a6b3f1e6194471da5deaa92ce9c4ee56abf42de0dc39be456 \ + --hash=sha256:7a46ee0cf8d068f36cbd08ad1679001fd03f6357d2a6a8e35ad051b00a8e9676 # via aws-sam-cli (setup.py) -botocore==1.34.56 \ - --hash=sha256:bffeb71ab21d47d4ecf947d9bdb2fbd1b0bbd0c27742cea7cf0b77b701c41d9f \ - --hash=sha256:fff66e22a5589c2d58fba57d1d95c334ce771895e831f80365f6cff6453285ec +botocore==1.34.57 \ + --hash=sha256:9a5aa2034de9f0c367b4b61a92af0fa827f5c21affa19e0a284838a142e71083 \ + --hash=sha256:c8dafe0ad378a88bcf4153e6972870b03fb5aab406b694202307500709940baf # via # boto3 # s3transfer -botocore-stubs==1.34.56 \ - --hash=sha256:018e001e3add5eb1828ef444b45fb8c9faf695e08334031bf2d96853cd9af703 \ - --hash=sha256:25468ba6983987b704b1856bb155f297f576e6d4a690b021ab0c7122889ba907 +botocore-stubs==1.34.57 \ + --hash=sha256:13f133ef244ebde6425cff3b41b43898af709d0fc8a749b26ddf304eff3a6570 \ + --hash=sha256:2deb03f218469c5a76dfefeb2d1e9f1599914adbb5f8bd8cc0d7ad7d7a07ae33 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index 721203eca1..df05f39a43 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -56,25 +56,25 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.56 \ - --hash=sha256:300888f0c1b6f32f27f85a9aa876f50f46514ec619647af7e4d20db74d339714 \ - --hash=sha256:b26928f9a21cf3649cea20a59061340f3294c6e7785ceb6e1a953eb8010dc3ba +boto3==1.34.57 \ + --hash=sha256:c26c31ceeeb2bc5d2bb96ba0fdc9a04d7b10e6e0b081c55b9cea9069a0be04dd \ + --hash=sha256:f8046e3e2d1186a49b49f7464c4811c265c86001f404dd1a96c4365c773a4245 # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.56 \ - --hash=sha256:627f8eca69d832581ee1676d39df099a2a2e3a86d6b3ebd21c81c5f11ed6a6fa \ - --hash=sha256:a87e7ecbab6235ec371b4363027e57483bca349a9cd5c891f40db81dadfa273e +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.57 \ + --hash=sha256:2b7271bb6876dc6a6b3f1e6194471da5deaa92ce9c4ee56abf42de0dc39be456 \ + --hash=sha256:7a46ee0cf8d068f36cbd08ad1679001fd03f6357d2a6a8e35ad051b00a8e9676 # via aws-sam-cli (setup.py) -botocore==1.34.56 \ - --hash=sha256:bffeb71ab21d47d4ecf947d9bdb2fbd1b0bbd0c27742cea7cf0b77b701c41d9f \ - --hash=sha256:fff66e22a5589c2d58fba57d1d95c334ce771895e831f80365f6cff6453285ec +botocore==1.34.57 \ + --hash=sha256:9a5aa2034de9f0c367b4b61a92af0fa827f5c21affa19e0a284838a142e71083 \ + --hash=sha256:c8dafe0ad378a88bcf4153e6972870b03fb5aab406b694202307500709940baf # via # boto3 # s3transfer -botocore-stubs==1.34.56 \ - --hash=sha256:018e001e3add5eb1828ef444b45fb8c9faf695e08334031bf2d96853cd9af703 \ - --hash=sha256:25468ba6983987b704b1856bb155f297f576e6d4a690b021ab0c7122889ba907 +botocore-stubs==1.34.57 \ + --hash=sha256:13f133ef244ebde6425cff3b41b43898af709d0fc8a749b26ddf304eff3a6570 \ + --hash=sha256:2deb03f218469c5a76dfefeb2d1e9f1599914adbb5f8bd8cc0d7ad7d7a07ae33 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index 4a1d20704f..2e3067b07b 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -38,25 +38,25 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.56 \ - --hash=sha256:300888f0c1b6f32f27f85a9aa876f50f46514ec619647af7e4d20db74d339714 \ - --hash=sha256:b26928f9a21cf3649cea20a59061340f3294c6e7785ceb6e1a953eb8010dc3ba +boto3==1.34.57 \ + --hash=sha256:c26c31ceeeb2bc5d2bb96ba0fdc9a04d7b10e6e0b081c55b9cea9069a0be04dd \ + --hash=sha256:f8046e3e2d1186a49b49f7464c4811c265c86001f404dd1a96c4365c773a4245 # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.56 \ - --hash=sha256:627f8eca69d832581ee1676d39df099a2a2e3a86d6b3ebd21c81c5f11ed6a6fa \ - --hash=sha256:a87e7ecbab6235ec371b4363027e57483bca349a9cd5c891f40db81dadfa273e +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.57 \ + --hash=sha256:2b7271bb6876dc6a6b3f1e6194471da5deaa92ce9c4ee56abf42de0dc39be456 \ + --hash=sha256:7a46ee0cf8d068f36cbd08ad1679001fd03f6357d2a6a8e35ad051b00a8e9676 # via aws-sam-cli (setup.py) -botocore==1.34.56 \ - --hash=sha256:bffeb71ab21d47d4ecf947d9bdb2fbd1b0bbd0c27742cea7cf0b77b701c41d9f \ - --hash=sha256:fff66e22a5589c2d58fba57d1d95c334ce771895e831f80365f6cff6453285ec +botocore==1.34.57 \ + --hash=sha256:9a5aa2034de9f0c367b4b61a92af0fa827f5c21affa19e0a284838a142e71083 \ + --hash=sha256:c8dafe0ad378a88bcf4153e6972870b03fb5aab406b694202307500709940baf # via # boto3 # s3transfer -botocore-stubs==1.34.56 \ - --hash=sha256:018e001e3add5eb1828ef444b45fb8c9faf695e08334031bf2d96853cd9af703 \ - --hash=sha256:25468ba6983987b704b1856bb155f297f576e6d4a690b021ab0c7122889ba907 +botocore-stubs==1.34.57 \ + --hash=sha256:13f133ef244ebde6425cff3b41b43898af709d0fc8a749b26ddf304eff3a6570 \ + --hash=sha256:2deb03f218469c5a76dfefeb2d1e9f1599914adbb5f8bd8cc0d7ad7d7a07ae33 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ From cedea4afe274b527126faa878339cffe37a5ff1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 19:25:29 +0000 Subject: [PATCH 11/23] chore(deps): bump pydantic from 2.6.2 to 2.6.3 in /requirements (#6792) Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.6.2 to 2.6.3. - [Release notes](https://github.com/pydantic/pydantic/releases) - [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md) - [Commits](https://github.com/pydantic/pydantic/compare/v2.6.2...v2.6.3) --- updated-dependencies: - dependency-name: pydantic dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: sidhujus <105385029+sidhujus@users.noreply.github.com> --- requirements/reproducible-linux.txt | 6 +++--- requirements/reproducible-mac.txt | 6 +++--- requirements/reproducible-win.txt | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 00cb00bf70..960653279e 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -479,9 +479,9 @@ pycparser==2.21 \ --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 # via cffi -pydantic==2.6.2 \ - --hash=sha256:37a5432e54b12fecaa1049c5195f3d860a10e01bdfd24f1840ef14bd0d3aeab3 \ - --hash=sha256:a09be1c3d28f3abe37f8a78af58284b236a92ce520105ddc91a6d29ea1176ba7 +pydantic==2.6.3 \ + --hash=sha256:72c6034df47f46ccdf81869fddb81aade68056003900a8724a4f160700016a2a \ + --hash=sha256:e07805c4c7f5c6826e33a1d4c9d47950d7eaf34868e2690f8594d2e30241f11f # via aws-sam-translator pydantic-core==2.16.3 \ --hash=sha256:00ee1c97b5364b84cb0bd82e9bbf645d5e2871fb8c58059d158412fee2d33d8a \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index df05f39a43..fbdc1457bf 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -511,9 +511,9 @@ pycparser==2.21 \ --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 # via cffi -pydantic==2.6.2 \ - --hash=sha256:37a5432e54b12fecaa1049c5195f3d860a10e01bdfd24f1840ef14bd0d3aeab3 \ - --hash=sha256:a09be1c3d28f3abe37f8a78af58284b236a92ce520105ddc91a6d29ea1176ba7 +pydantic==2.6.3 \ + --hash=sha256:72c6034df47f46ccdf81869fddb81aade68056003900a8724a4f160700016a2a \ + --hash=sha256:e07805c4c7f5c6826e33a1d4c9d47950d7eaf34868e2690f8594d2e30241f11f # via aws-sam-translator pydantic-core==2.16.3 \ --hash=sha256:00ee1c97b5364b84cb0bd82e9bbf645d5e2871fb8c58059d158412fee2d33d8a \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index 2e3067b07b..374ba93a7b 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -483,9 +483,9 @@ pycparser==2.21 \ --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 # via cffi -pydantic==2.6.2 \ - --hash=sha256:37a5432e54b12fecaa1049c5195f3d860a10e01bdfd24f1840ef14bd0d3aeab3 \ - --hash=sha256:a09be1c3d28f3abe37f8a78af58284b236a92ce520105ddc91a6d29ea1176ba7 +pydantic==2.6.3 \ + --hash=sha256:72c6034df47f46ccdf81869fddb81aade68056003900a8724a4f160700016a2a \ + --hash=sha256:e07805c4c7f5c6826e33a1d4c9d47950d7eaf34868e2690f8594d2e30241f11f # via aws-sam-translator pydantic-core==2.16.3 \ --hash=sha256:00ee1c97b5364b84cb0bd82e9bbf645d5e2871fb8c58059d158412fee2d33d8a \ From 61c88f6ecff32023844eb00456e424c71c770180 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:35:21 -0800 Subject: [PATCH 12/23] chore(deps-dev): bump ruff from 0.2.2 to 0.3.1 in /requirements (#6789) * chore(deps-dev): bump ruff from 0.2.2 to 0.3.1 in /requirements Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.2 to 0.3.1. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.2.2...v0.3.1) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix ruff issues --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Haresh Nasit Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- requirements/pre-dev.txt | 2 +- samcli/commands/build/build_context.py | 28 +++---- samcli/commands/build/command.py | 35 ++++----- samcli/commands/build/core/options.py | 2 +- samcli/lib/build/app_builder.py | 75 ++++++++++--------- samcli/lib/build/build_graph.py | 9 +-- samcli/lib/build/build_strategy.py | 23 +++--- samcli/lib/build/bundler.py | 3 +- samcli/lib/build/dependency_hash_generator.py | 1 - samcli/lib/build/utils.py | 6 +- samcli/lib/build/workflow_config.py | 16 ++-- 11 files changed, 101 insertions(+), 99 deletions(-) diff --git a/requirements/pre-dev.txt b/requirements/pre-dev.txt index 83028ae40b..e93be0b37b 100644 --- a/requirements/pre-dev.txt +++ b/requirements/pre-dev.txt @@ -1 +1 @@ -ruff==0.2.2 +ruff==0.3.1 diff --git a/samcli/commands/build/build_context.py b/samcli/commands/build/build_context.py index c976f13532..77cd372b4e 100644 --- a/samcli/commands/build/build_context.py +++ b/samcli/commands/build/build_context.py @@ -6,7 +6,7 @@ import os import pathlib import shutil -from typing import Dict, Optional, List, Tuple +from typing import Dict, List, Optional, Tuple import click @@ -17,14 +17,14 @@ move_template, ) from samcli.commands.build.exceptions import InvalidBuildDirException, MissingBuildMethodException -from samcli.commands.build.utils import prompt_user_to_enable_mount_with_write_if_needed, MountMode +from samcli.commands.build.utils import MountMode, prompt_user_to_enable_mount_with_write_if_needed from samcli.commands.exceptions import UserException from samcli.lib.bootstrap.nested_stack.nested_stack_manager import NestedStackManager from samcli.lib.build.app_builder import ( ApplicationBuilder, + ApplicationBuildResult, BuildError, UnsupportedBuilderLibraryVersionError, - ApplicationBuildResult, ) from samcli.lib.build.build_graph import DEFAULT_DEPENDENCIES_DIR from samcli.lib.build.bundler import EsbuildBundlerManager @@ -34,12 +34,12 @@ ) from samcli.lib.build.workflow_config import UnsupportedRuntimeException from samcli.lib.intrinsic_resolver.intrinsics_symbol_table import IntrinsicsSymbolTable -from samcli.lib.providers.provider import ResourcesToBuildCollector, Stack, LayerVersion +from samcli.lib.providers.provider import LayerVersion, ResourcesToBuildCollector, Stack from samcli.lib.providers.sam_api_provider import SamApiProvider from samcli.lib.providers.sam_function_provider import SamFunctionProvider from samcli.lib.providers.sam_layer_provider import SamLayerProvider from samcli.lib.providers.sam_stack_provider import SamLocalStackProvider -from samcli.lib.telemetry.event import EventTracker, UsedFeature, EventName +from samcli.lib.telemetry.event import EventName, EventTracker, UsedFeature from samcli.lib.utils.osutils import BUILD_DIR_PERMISSIONS from samcli.local.docker.manager import ContainerManager from samcli.local.lambdafn.exceptions import ( @@ -577,8 +577,8 @@ def collect_build_resources(self, resource_identifier: str) -> ResourcesToBuildC if not result.functions and not result.layers: # Collect all functions and layers that are not inline - all_resources = [f.name for f in self.function_provider.get_all() if not f.inlinecode] - all_resources.extend([l.name for l in self.layer_provider.get_all()]) + all_resources = [func.name for func in self.function_provider.get_all() if not func.inlinecode] + all_resources.extend([layer.name for layer in self.layer_provider.get_all()]) available_resource_message = ( f"{resource_identifier} not found. Possible options in your " f"template: {all_resources}" @@ -599,16 +599,16 @@ def collect_all_build_resources(self) -> ResourcesToBuildCollector: excludes: Tuple[str, ...] = self._exclude if self._exclude is not None else () result.add_functions( [ - f - for f in self.function_provider.get_all() - if (f.name not in excludes) and f.function_build_info.is_buildable() + func + for func in self.function_provider.get_all() + if (func.name not in excludes) and func.function_build_info.is_buildable() ] ) result.add_layers( [ - l - for l in self.layer_provider.get_all() - if (l.name not in excludes) and BuildContext.is_layer_buildable(l) + layer + for layer in self.layer_provider.get_all() + if (layer.name not in excludes) and BuildContext.is_layer_buildable(layer) ] ) return result @@ -639,7 +639,7 @@ def _collect_single_function_and_dependent_layers( return resource_collector.add_function(function) - resource_collector.add_layers([l for l in function.layers if BuildContext.is_layer_buildable(l)]) + resource_collector.add_layers([layer for layer in function.layers if BuildContext.is_layer_buildable(layer)]) def _collect_single_buildable_layer( self, resource_identifier: str, resource_collector: ResourcesToBuildCollector diff --git a/samcli/commands/build/command.py b/samcli/commands/build/command.py index e2713e9e54..7b467b65a4 100644 --- a/samcli/commands/build/command.py +++ b/samcli/commands/build/command.py @@ -2,37 +2,38 @@ CLI command for "build" command """ -import os import logging -from typing import List, Optional, Dict, Tuple +import os +from typing import Dict, List, Optional, Tuple + import click +from samcli.cli.cli_config_file import ConfigProvider, configuration_option, save_params_option from samcli.cli.context import Context +from samcli.cli.main import aws_creds_options, pass_context, print_cmdline_args +from samcli.cli.main import common_options as cli_framework_options +from samcli.commands._utils.option_value_processor import process_env_var, process_image_options from samcli.commands._utils.options import ( - build_in_source_option, - skip_prepare_infra_option, - template_option_without_build, - docker_common_options, - parameter_override_option, + base_dir_option, build_dir_option, + build_image_option, + build_in_source_option, cache_dir_option, - base_dir_option, - manifest_option, cached_option, - use_container_build_option, - build_image_option, + docker_common_options, hook_name_click_option, - terraform_plan_file_option, + manifest_option, + parameter_override_option, + skip_prepare_infra_option, + template_option_without_build, terraform_project_root_path_option, + use_container_build_option, ) -from samcli.commands._utils.option_value_processor import process_env_var, process_image_options -from samcli.cli.main import pass_context, common_options as cli_framework_options, aws_creds_options, print_cmdline_args +from samcli.commands.build.click_container import ContainerOptions from samcli.commands.build.core.command import BuildCommand +from samcli.commands.build.utils import MountMode from samcli.lib.telemetry.metric import track_command -from samcli.cli.cli_config_file import configuration_option, ConfigProvider, save_params_option from samcli.lib.utils.version_checker import check_newer_version -from samcli.commands.build.click_container import ContainerOptions -from samcli.commands.build.utils import MountMode LOG = logging.getLogger(__name__) diff --git a/samcli/commands/build/core/options.py b/samcli/commands/build/core/options.py index 2da97d83ed..dbd36231c9 100644 --- a/samcli/commands/build/core/options.py +++ b/samcli/commands/build/core/options.py @@ -4,8 +4,8 @@ from typing import Dict, List -from samcli.cli.row_modifiers import RowDefinition from samcli.cli.core.options import ALL_COMMON_OPTIONS, SAVE_PARAMS_OPTIONS, add_common_options_info +from samcli.cli.row_modifiers import RowDefinition # NOTE(sriram-mv): The ordering of the option lists matter, they are the order # in which options will be displayed. diff --git a/samcli/lib/build/app_builder.py b/samcli/lib/build/app_builder.py index 6c8b0f02f1..d4fa45ac27 100644 --- a/samcli/lib/build/app_builder.py +++ b/samcli/lib/build/app_builder.py @@ -2,12 +2,13 @@ Builds the application """ -import os import io import json import logging +import os import pathlib -from typing import List, Optional, Dict, cast, NamedTuple +from typing import Dict, List, NamedTuple, Optional, cast + import docker import docker.errors from aws_lambda_builders import ( @@ -15,16 +16,40 @@ ) from aws_lambda_builders.builder import LambdaBuilder from aws_lambda_builders.exceptions import LambdaBuilderError -from samcli.lib.constants import DOCKER_MIN_API_VERSION -from samcli.lib.build.build_graph import FunctionBuildDefinition, LayerBuildDefinition, BuildGraph + +from samcli.commands._utils.experimental import get_enabled_experimental_flags +from samcli.lib.build.build_graph import BuildGraph, FunctionBuildDefinition, LayerBuildDefinition from samcli.lib.build.build_strategy import ( - DefaultBuildStrategy, + BuildStrategy, CachedOrIncrementalBuildStrategyWrapper, + DefaultBuildStrategy, ParallelBuildStrategy, - BuildStrategy, ) -from samcli.lib.build.constants import DEPRECATED_RUNTIMES, BUILD_PROPERTIES +from samcli.lib.build.constants import BUILD_PROPERTIES, DEPRECATED_RUNTIMES +from samcli.lib.build.exceptions import ( + BuildError, + BuildInsideContainerError, + DockerBuildFailed, + DockerConnectionError, + DockerfileOutSideOfContext, + UnsupportedBuilderLibraryVersionError, +) from samcli.lib.build.utils import _make_env_vars +from samcli.lib.build.workflow_config import ( + CONFIG, + UnsupportedRuntimeException, + get_layer_subfolder, + get_workflow_config, + supports_specified_workflow, +) +from samcli.lib.constants import DOCKER_MIN_API_VERSION +from samcli.lib.docker.log_streamer import LogStreamer, LogStreamError +from samcli.lib.providers.provider import ResourcesToBuildCollector, Stack, get_full_path +from samcli.lib.samlib.resource_metadata_normalizer import ResourceMetadataNormalizer +from samcli.lib.utils import osutils +from samcli.lib.utils.colors import Colored, Colors +from samcli.lib.utils.lambda_builders import patch_runtime +from samcli.lib.utils.packagetype import IMAGE, ZIP from samcli.lib.utils.path_utils import convert_path_to_unix_path from samcli.lib.utils.resources import ( AWS_CLOUDFORMATION_STACK, @@ -34,38 +59,18 @@ AWS_SERVERLESS_FUNCTION, AWS_SERVERLESS_LAYERVERSION, ) -from samcli.lib.samlib.resource_metadata_normalizer import ResourceMetadataNormalizer -from samcli.lib.docker.log_streamer import LogStreamer, LogStreamError -from samcli.lib.providers.provider import ResourcesToBuildCollector, get_full_path, Stack -from samcli.lib.utils.colors import Colored, Colors -from samcli.lib.utils import osutils -from samcli.lib.utils.lambda_builders import patch_runtime -from samcli.lib.utils.packagetype import IMAGE, ZIP from samcli.lib.utils.stream_writer import StreamWriter -from samcli.local.docker.exceptions import ContainerNotStartableException from samcli.local.docker.lambda_build_container import LambdaBuildContainer -from samcli.local.docker.utils import is_docker_reachable, get_docker_platform from samcli.local.docker.manager import ContainerManager, DockerImagePullFailedException -from samcli.commands._utils.experimental import get_enabled_experimental_flags -from samcli.lib.build.exceptions import ( - DockerConnectionError, - DockerfileOutSideOfContext, - DockerBuildFailed, - BuildError, - BuildInsideContainerError, - UnsupportedBuilderLibraryVersionError, -) -from samcli.lib.build.workflow_config import ( - get_workflow_config, - supports_specified_workflow, - get_layer_subfolder, - CONFIG, - UnsupportedRuntimeException, -) +from samcli.local.docker.utils import get_docker_platform, is_docker_reachable LOG = logging.getLogger(__name__) FIRST_COMPATIBLE_RUNTIME_INDEX = 0 +HTTP_400 = 400 +HTTP_500 = 500 +HTTP_505 = 505 +JSON_RPC_CODE = -32601 class ApplicationBuildResult(NamedTuple): @@ -988,11 +993,11 @@ def _parse_builder_response(stdout_data: str, image_name: str) -> Dict: err_code = error.get("code") msg = error.get("message") - if 400 <= err_code < 500: + if HTTP_400 <= err_code < HTTP_500: # Like HTTP 4xx - customer error raise BuildInsideContainerError(msg) - if err_code == 505: + if err_code == HTTP_505: # Like HTTP 505 error code: Version of the protocol is not supported # In this case, this error means that the Builder Library within the container is # not compatible with the version of protocol expected SAM CLI installation supports. @@ -1000,7 +1005,7 @@ def _parse_builder_response(stdout_data: str, image_name: str) -> Dict: # https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/505 raise UnsupportedBuilderLibraryVersionError(image_name, msg) - if err_code == -32601: + if err_code == JSON_RPC_CODE: # Default JSON Rpc Code for Method Unavailable https://www.jsonrpc.org/specification # This can happen if customers are using an incompatible version of builder library within the # container diff --git a/samcli/lib/build/build_graph.py b/samcli/lib/build/build_graph.py index 2674f80c76..a8121dd3dc 100644 --- a/samcli/lib/build/build_graph.py +++ b/samcli/lib/build/build_graph.py @@ -9,22 +9,21 @@ from abc import abstractmethod from copy import deepcopy from pathlib import Path -from typing import Sequence, Tuple, List, Any, Optional, Dict, cast, NamedTuple +from typing import Any, Dict, List, NamedTuple, Optional, Sequence, Tuple, cast from uuid import uuid4 import tomlkit from tomlkit.toml_document import TOMLDocument -from samcli.commands._utils.experimental import is_experimental_enabled, ExperimentalFlag +from samcli.commands._utils.experimental import ExperimentalFlag, is_experimental_enabled from samcli.lib.build.exceptions import InvalidBuildGraphException from samcli.lib.providers.provider import Function, LayerVersion from samcli.lib.samlib.resource_metadata_normalizer import ( - SAM_RESOURCE_ID_KEY, SAM_IS_NORMALIZED, + SAM_RESOURCE_ID_KEY, ) -from samcli.lib.utils.packagetype import ZIP from samcli.lib.utils.architecture import X86_64 - +from samcli.lib.utils.packagetype import ZIP LOG = logging.getLogger(__name__) diff --git a/samcli/lib/build/build_strategy.py b/samcli/lib/build/build_strategy.py index 5fae26e79d..b1317e9311 100644 --- a/samcli/lib/build/build_strategy.py +++ b/samcli/lib/build/build_strategy.py @@ -7,27 +7,26 @@ import os.path import pathlib import shutil -from abc import abstractmethod, ABC +from abc import ABC, abstractmethod from copy import deepcopy -from typing import Callable, Dict, List, Any, Optional, cast, Set, Tuple, TypeVar +from typing import Any, Callable, Dict, List, Optional, Set, Tuple, TypeVar, cast -from samcli.commands._utils.experimental import is_experimental_enabled, ExperimentalFlag -from samcli.lib.utils import osutils -from samcli.lib.utils.async_utils import AsyncContext -from samcli.lib.utils.hash import dir_checksum -from samcli.lib.utils.packagetype import ZIP, IMAGE -from samcli.lib.build.dependency_hash_generator import DependencyHashGenerator +from samcli.commands._utils.experimental import ExperimentalFlag, is_experimental_enabled from samcli.lib.build.build_graph import ( + DEFAULT_DEPENDENCIES_DIR, + AbstractBuildDefinition, BuildGraph, FunctionBuildDefinition, LayerBuildDefinition, - AbstractBuildDefinition, - DEFAULT_DEPENDENCIES_DIR, ) +from samcli.lib.build.dependency_hash_generator import DependencyHashGenerator from samcli.lib.build.exceptions import MissingBuildMethodException from samcli.lib.build.utils import warn_on_invalid_architecture - -from samcli.lib.utils.architecture import X86_64, ARM64 +from samcli.lib.utils import osutils +from samcli.lib.utils.architecture import X86_64 +from samcli.lib.utils.async_utils import AsyncContext +from samcli.lib.utils.hash import dir_checksum +from samcli.lib.utils.packagetype import IMAGE, ZIP LOG = logging.getLogger(__name__) diff --git a/samcli/lib/build/bundler.py b/samcli/lib/build/bundler.py index 797171391f..4b9ea3dbd7 100644 --- a/samcli/lib/build/bundler.py +++ b/samcli/lib/build/bundler.py @@ -4,10 +4,9 @@ import logging from copy import deepcopy -from pathlib import Path, PosixPath +from pathlib import Path from typing import Dict, Optional -from samcli.commands.local.lib.exceptions import InvalidHandlerPathError from samcli.lib.providers.provider import Stack from samcli.lib.providers.sam_function_provider import SamFunctionProvider diff --git a/samcli/lib/build/dependency_hash_generator.py b/samcli/lib/build/dependency_hash_generator.py index 635618f91d..fb95f2117d 100644 --- a/samcli/lib/build/dependency_hash_generator.py +++ b/samcli/lib/build/dependency_hash_generator.py @@ -1,7 +1,6 @@ """Utility Class for Getting Function or Layer Manifest Dependency Hashes""" import pathlib - from typing import Any, Optional from samcli.lib.build.workflow_config import get_workflow_config diff --git a/samcli/lib/build/utils.py b/samcli/lib/build/utils.py index 45ef2c4672..f0e399e524 100644 --- a/samcli/lib/build/utils.py +++ b/samcli/lib/build/utils.py @@ -3,12 +3,12 @@ """ import logging -from typing import Union, Dict, Optional +from typing import Dict, Optional, Union from samcli.commands.local.lib.exceptions import OverridesNotWellDefinedError -from samcli.lib.providers.provider import Function, LayerVersion from samcli.lib.build.build_graph import LayerBuildDefinition -from samcli.lib.utils.architecture import X86_64, ARM64 +from samcli.lib.providers.provider import Function, LayerVersion +from samcli.lib.utils.architecture import ARM64, X86_64 LOG = logging.getLogger(__name__) diff --git a/samcli/lib/build/workflow_config.py b/samcli/lib/build/workflow_config.py index d28c7fea97..d48adbac7c 100644 --- a/samcli/lib/build/workflow_config.py +++ b/samcli/lib/build/workflow_config.py @@ -2,22 +2,22 @@ Contains Builder Workflow Configs for different Runtimes """ -import os import logging -from typing import Dict, List, Optional, Tuple, Union, cast +import os +from typing import Dict, List, Optional, Union, cast from samcli.lib.build.workflows import ( CONFIG, - PYTHON_PIP_CONFIG, - NODEJS_NPM_CONFIG, - RUBY_BUNDLER_CONFIG, + DOTNET_CLIPACKAGE_CONFIG, + GO_MOD_CONFIG, JAVA_GRADLE_CONFIG, JAVA_KOTLIN_GRADLE_CONFIG, JAVA_MAVEN_CONFIG, - DOTNET_CLIPACKAGE_CONFIG, - GO_MOD_CONFIG, - PROVIDED_MAKE_CONFIG, + NODEJS_NPM_CONFIG, NODEJS_NPM_ESBUILD_CONFIG, + PROVIDED_MAKE_CONFIG, + PYTHON_PIP_CONFIG, + RUBY_BUNDLER_CONFIG, RUST_CARGO_LAMBDA_CONFIG, ) from samcli.lib.telemetry.event import EventTracker From a0a299ac9b9254a3a5114df63cb45e5eaad73563 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 19:14:40 +0000 Subject: [PATCH 13/23] chore: update aws-sam-translator to 1.86.0 (#6793) * chore: update aws-sam-translator to 1.86.0 * Update reproducibles: update-reproducible-linux-reqs * Update reproducibles: update-reproducible-mac-reqs * Update reproducibles: update-reproducible-win-reqs --------- Co-authored-by: GitHub Action --- requirements/base.txt | 2 +- requirements/reproducible-linux.txt | 6 +++--- requirements/reproducible-mac.txt | 6 +++--- requirements/reproducible-win.txt | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 5c048aad48..3cae5881fa 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,7 +6,7 @@ jmespath~=1.0.1 ruamel_yaml~=0.18.6 PyYAML~=6.0,>=6.0.1 cookiecutter~=2.6.0 -aws-sam-translator==1.85.0 +aws-sam-translator==1.86.0 #docker minor version updates can include breaking changes. Auto update micro version only. docker~=7.0.0 dateparser~=1.2 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 960653279e..1c25f628ec 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -24,9 +24,9 @@ aws-lambda-builders==1.47.0 \ --hash=sha256:e35466c7faa603f9bd30c851be1a8e6076b93876e56ab59ff78dca5b244bdddf \ --hash=sha256:f30175975ae60f6fe301a6ca1e3e7b5ca53c7685da9a3bccc9e720a7f5168e5e # via aws-sam-cli (setup.py) -aws-sam-translator==1.85.0 \ - --hash=sha256:e41938affa128fb5bde5e1989b260bf539a96369bba3faf316ce66651351df39 \ - --hash=sha256:e8c69a4db7279421ff6c3579cd4d43395fe9b6781f50416528e984be68e25481 +aws-sam-translator==1.86.0 \ + --hash=sha256:97a44e5ac8b0d141c31f4ed35c57aa94429a0e6cef7fe989831c9a1c40455473 \ + --hash=sha256:a748dcd7886024cb7586abbbdbabe8c787c44c6547bb6602879d7bb8a6934d05 # via # aws-sam-cli (setup.py) # cfn-lint diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index fbdc1457bf..b18bd49324 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -24,9 +24,9 @@ aws-lambda-builders==1.47.0 \ --hash=sha256:e35466c7faa603f9bd30c851be1a8e6076b93876e56ab59ff78dca5b244bdddf \ --hash=sha256:f30175975ae60f6fe301a6ca1e3e7b5ca53c7685da9a3bccc9e720a7f5168e5e # via aws-sam-cli (setup.py) -aws-sam-translator==1.85.0 \ - --hash=sha256:e41938affa128fb5bde5e1989b260bf539a96369bba3faf316ce66651351df39 \ - --hash=sha256:e8c69a4db7279421ff6c3579cd4d43395fe9b6781f50416528e984be68e25481 +aws-sam-translator==1.86.0 \ + --hash=sha256:97a44e5ac8b0d141c31f4ed35c57aa94429a0e6cef7fe989831c9a1c40455473 \ + --hash=sha256:a748dcd7886024cb7586abbbdbabe8c787c44c6547bb6602879d7bb8a6934d05 # via # aws-sam-cli (setup.py) # cfn-lint diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index 374ba93a7b..f73bb4f5de 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -24,9 +24,9 @@ aws-lambda-builders==1.47.0 \ --hash=sha256:e35466c7faa603f9bd30c851be1a8e6076b93876e56ab59ff78dca5b244bdddf \ --hash=sha256:f30175975ae60f6fe301a6ca1e3e7b5ca53c7685da9a3bccc9e720a7f5168e5e # via aws-sam-cli (setup.py) -aws-sam-translator==1.85.0 \ - --hash=sha256:e41938affa128fb5bde5e1989b260bf539a96369bba3faf316ce66651351df39 \ - --hash=sha256:e8c69a4db7279421ff6c3579cd4d43395fe9b6781f50416528e984be68e25481 +aws-sam-translator==1.86.0 \ + --hash=sha256:97a44e5ac8b0d141c31f4ed35c57aa94429a0e6cef7fe989831c9a1c40455473 \ + --hash=sha256:a748dcd7886024cb7586abbbdbabe8c787c44c6547bb6602879d7bb8a6934d05 # via # aws-sam-cli (setup.py) # cfn-lint From 39240d08253ab5d80e3da0a353bf7f83173c046e Mon Sep 17 00:00:00 2001 From: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> Date: Fri, 8 Mar 2024 12:18:24 -0800 Subject: [PATCH 14/23] Fix bug in PR#6719 (#6794) * Refactor to run sam validate before any sam local logic * Formatting * refactor sam validate * raise docker image creation error * fix lint errors * update type hint * handle container creation error in local apigw service * reformat * handle errors in local api invoke and local lambda invoke * move exception * handle error in local invoke * remove unnecessary integration tests * fix formatting * use try/except to run lint * fix unexpected arg in invoke context * fix test * fix broken test --------- Co-authored-by: Jared Bentvelsen Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- samcli/commands/local/invoke/cli.py | 2 +- samcli/commands/local/start_api/cli.py | 2 +- samcli/commands/local/start_lambda/cli.py | 2 +- tests/unit/commands/local/invoke/test_cli.py | 4 ++-- tests/unit/commands/local/start_api/test_cli.py | 2 +- tests/unit/commands/local/start_lambda/test_cli.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/samcli/commands/local/invoke/cli.py b/samcli/commands/local/invoke/cli.py index 265d3db16e..e19ab69c8d 100644 --- a/samcli/commands/local/invoke/cli.py +++ b/samcli/commands/local/invoke/cli.py @@ -204,7 +204,7 @@ def do_cli( # pylint: disable=R0914 container_host_interface=container_host_interface, add_host=add_host, invoke_images=processed_invoke_images, - ctx=ctx, + verbose=ctx.debug, ) as context: # Invoke the function context.local_lambda_runner.invoke( diff --git a/samcli/commands/local/start_api/cli.py b/samcli/commands/local/start_api/cli.py index 532678cab6..7669ade219 100644 --- a/samcli/commands/local/start_api/cli.py +++ b/samcli/commands/local/start_api/cli.py @@ -253,7 +253,7 @@ def do_cli( # pylint: disable=R0914 container_host_interface=container_host_interface, invoke_images=processed_invoke_images, add_host=add_host, - ctx=ctx, + verbose=ctx.debug, ) as invoke_context: ssl_context = (ssl_cert_file, ssl_key_file) if ssl_cert_file else None service = LocalApiService( diff --git a/samcli/commands/local/start_lambda/cli.py b/samcli/commands/local/start_lambda/cli.py index 22267e23d5..9b1b136c35 100644 --- a/samcli/commands/local/start_lambda/cli.py +++ b/samcli/commands/local/start_lambda/cli.py @@ -205,7 +205,7 @@ def do_cli( # pylint: disable=R0914 container_host_interface=container_host_interface, add_host=add_host, invoke_images=processed_invoke_images, - ctx=ctx, + verbose=ctx.debug, ) as invoke_context: service = LocalLambdaService(lambda_invoke_context=invoke_context, port=port, host=host) service.start() diff --git a/tests/unit/commands/local/invoke/test_cli.py b/tests/unit/commands/local/invoke/test_cli.py index 476dd99ce2..78a915c390 100644 --- a/tests/unit/commands/local/invoke/test_cli.py +++ b/tests/unit/commands/local/invoke/test_cli.py @@ -116,7 +116,7 @@ def test_cli_must_setup_context_and_invoke(self, get_event_mock, InvokeContextMo container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={None: "amazon/aws-sam-cli-emulation-image-python3.9"}, - ctx=self.ctx_mock, + verbose=self.ctx_mock.debug, ) context_mock.local_lambda_runner.invoke.assert_called_with( @@ -157,7 +157,7 @@ def test_cli_must_invoke_with_no_event(self, get_event_mock, InvokeContextMock): container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={None: "amazon/aws-sam-cli-emulation-image-python3.9"}, - ctx=self.ctx_mock, + verbose=self.ctx_mock.debug, ) get_event_mock.assert_not_called() diff --git a/tests/unit/commands/local/start_api/test_cli.py b/tests/unit/commands/local/start_api/test_cli.py index 54c7e663d1..1c1dde2d34 100644 --- a/tests/unit/commands/local/start_api/test_cli.py +++ b/tests/unit/commands/local/start_api/test_cli.py @@ -97,7 +97,7 @@ def test_cli_must_setup_context_and_start_service(self, local_api_service_mock, container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={}, - ctx=self.ctx_mock, + verbose=self.ctx_mock.debug, ) local_api_service_mock.assert_called_with( diff --git a/tests/unit/commands/local/start_lambda/test_cli.py b/tests/unit/commands/local/start_lambda/test_cli.py index d743f13e3e..2a620ec194 100644 --- a/tests/unit/commands/local/start_lambda/test_cli.py +++ b/tests/unit/commands/local/start_lambda/test_cli.py @@ -84,7 +84,7 @@ def test_cli_must_setup_context_and_start_service(self, local_lambda_service_moc container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={}, - ctx=self.ctx_mock, + verbose=self.ctx_mock.debug, ) local_lambda_service_mock.assert_called_with(lambda_invoke_context=context_mock, port=self.port, host=self.host) From 7e3eb82c9f7ecaa98c1d053610b79979904db26a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:34:19 -0800 Subject: [PATCH 15/23] chore(deps): bump importlib-resources in /requirements (#6798) Bumps [importlib-resources](https://github.com/python/importlib_resources) from 6.1.2 to 6.1.3. - [Release notes](https://github.com/python/importlib_resources/releases) - [Changelog](https://github.com/python/importlib_resources/blob/main/NEWS.rst) - [Commits](https://github.com/python/importlib_resources/compare/v6.1.2...v6.1.3) --- updated-dependencies: - dependency-name: importlib-resources dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/reproducible-mac.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index b18bd49324..5eb460231c 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -303,9 +303,9 @@ importlib-metadata==7.0.1 \ --hash=sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e \ --hash=sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc # via flask -importlib-resources==6.1.2 \ - --hash=sha256:308abf8474e2dba5f867d279237cd4076482c3de7104a40b41426370e891549b \ - --hash=sha256:9a0a862501dc38b68adebc82970140c9e4209fc99601782925178f8386339938 +importlib-resources==6.1.3 \ + --hash=sha256:4c0269e3580fe2634d364b39b38b961540a7738c02cb984e98add8b4221d793d \ + --hash=sha256:56fb4525197b78544a3354ea27793952ab93f935bb4bf746b846bb1015020f2b # via # jsonschema # jsonschema-specifications From 8f082bcf308a0c351da29b39e27b9fbe36ebbae3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 21:35:14 +0000 Subject: [PATCH 16/23] chore(deps-dev): bump the types group in /requirements with 2 updates (#6796) Bumps the types group in /requirements with 2 updates: [types-setuptools](https://github.com/python/typeshed) and [types-docutils](https://github.com/python/typeshed). Updates `types-setuptools` from 69.1.0.20240302 to 69.1.0.20240308 - [Commits](https://github.com/python/typeshed/commits) Updates `types-docutils` from 0.20.0.20240304 to 0.20.0.20240308 - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-setuptools dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types - dependency-name: types-docutils dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index cac0f6afb7..e2fbb2c7a9 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -12,11 +12,11 @@ types-pywin32==306.0.0.20240130 types-PyYAML==6.0.12.12 types-chevron==0.14.2.20240106 types-psutil==5.9.5.20240205 -types-setuptools==69.1.0.20240302 +types-setuptools==69.1.0.20240308 types-Pygments==2.17.0.20240106 types-colorama==0.4.15.20240205 types-dateparser==1.1.4.20240106 -types-docutils==0.20.0.20240304 +types-docutils==0.20.0.20240308 types-jsonschema==4.21.0.20240118 types-pyOpenSSL==24.0.0.20240228 # as of types-requests>=2.31.0.7, this now requires `urllib3>2`, pin we are able to upgrade From 20dd8499f523e264d31c1451684926ab11a5a779 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 21:35:35 +0000 Subject: [PATCH 17/23] chore(deps): bump the boto group in /requirements with 5 updates (#6795) Bumps the boto group in /requirements with 5 updates: | Package | From | To | | --- | --- | --- | | [boto3](https://github.com/boto/boto3) | `1.34.57` | `1.34.58` | | [boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]](https://github.com/youtype/mypy_boto3_builder) | `1.34.57` | `1.34.58` | | [botocore](https://github.com/boto/botocore) | `1.34.57` | `1.34.58` | | [botocore-stubs](https://github.com/youtype/botocore-stubs) | `1.34.57` | `1.34.58` | | [mypy-boto3-lambda](https://github.com/youtype/mypy_boto3_builder) | `1.34.46` | `1.34.58` | Updates `boto3` from 1.34.57 to 1.34.58 - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.34.57...1.34.58) Updates `boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]` from 1.34.57 to 1.34.58 - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) Updates `botocore` from 1.34.57 to 1.34.58 - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.34.57...1.34.58) Updates `botocore-stubs` from 1.34.57 to 1.34.58 - [Release notes](https://github.com/youtype/botocore-stubs/releases) - [Commits](https://github.com/youtype/botocore-stubs/commits) Updates `mypy-boto3-lambda` from 1.34.46 to 1.34.58 - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray] dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: botocore-stubs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto - dependency-name: mypy-boto3-lambda dependency-type: direct:production update-type: version-update:semver-patch dependency-group: boto ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/base.txt | 2 +- requirements/reproducible-linux.txt | 30 ++++++++++++++--------------- requirements/reproducible-mac.txt | 30 ++++++++++++++--------------- requirements/reproducible-win.txt | 30 ++++++++++++++--------------- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 3cae5881fa..38cd50577c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -31,4 +31,4 @@ tzlocal==5.2 cfn-lint~=0.86.0 # Type checking boto3 objects -boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.57 +boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.34.58 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 1c25f628ec..e4bfa16fbb 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -38,25 +38,25 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.57 \ - --hash=sha256:c26c31ceeeb2bc5d2bb96ba0fdc9a04d7b10e6e0b081c55b9cea9069a0be04dd \ - --hash=sha256:f8046e3e2d1186a49b49f7464c4811c265c86001f404dd1a96c4365c773a4245 +boto3==1.34.58 \ + --hash=sha256:09e3d17c718bc938a76774f31bc557b20733c0f5f9135a3e7782b55f3459cbdd \ + --hash=sha256:d213a6fea9db6d537b1e65924133d8279ada79a40bc840d4930e1b64be869d4c # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.57 \ - --hash=sha256:2b7271bb6876dc6a6b3f1e6194471da5deaa92ce9c4ee56abf42de0dc39be456 \ - --hash=sha256:7a46ee0cf8d068f36cbd08ad1679001fd03f6357d2a6a8e35ad051b00a8e9676 +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.58 \ + --hash=sha256:14ea85a355f984bd7dc17e39237bfc24c3a55479fbcb87f17c00269bd95a2b44 \ + --hash=sha256:f164e520361d6aa39d295ac09588a6dc6b8efbc4058ada0b796d3bfb0e6e6e98 # via aws-sam-cli (setup.py) -botocore==1.34.57 \ - --hash=sha256:9a5aa2034de9f0c367b4b61a92af0fa827f5c21affa19e0a284838a142e71083 \ - --hash=sha256:c8dafe0ad378a88bcf4153e6972870b03fb5aab406b694202307500709940baf +botocore==1.34.58 \ + --hash=sha256:8086a6ea27d0f658505ac81e6d7314e013561469c40db9b5a4692127eb5c97cf \ + --hash=sha256:d75216952886dc513ea1b5e2979a6af08feed2f537e3fc102e4a0a2ead563a35 # via # boto3 # s3transfer -botocore-stubs==1.34.57 \ - --hash=sha256:13f133ef244ebde6425cff3b41b43898af709d0fc8a749b26ddf304eff3a6570 \ - --hash=sha256:2deb03f218469c5a76dfefeb2d1e9f1599914adbb5f8bd8cc0d7ad7d7a07ae33 +botocore-stubs==1.34.58 \ + --hash=sha256:7f820ed37a11109744a8c4aeb9f0224c7114b5aaabcbd46fc6c4f60af69faa3e \ + --hash=sha256:830bf3bc6b0a7299f770c0adcbea21fda5d240080024f12ca6d80633a3ce46c4 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ @@ -425,9 +425,9 @@ mypy-boto3-kinesis==1.34.0 \ --hash=sha256:1add81c53f6e36599e0c22e142024867759aaf2f4954bcb2baa21c284c852377 \ --hash=sha256:f404e75badd5977e9f09741b769b8888854bdd411c631344686ab889efe98741 # via boto3-stubs -mypy-boto3-lambda==1.34.46 \ - --hash=sha256:275297944c5e36a170b37ce70229f21db6dd3561606799f18d96e36ac5df6876 \ - --hash=sha256:a12232002e04ee06b413b47068bc6bb085aeaa3693d28e9bf0efd76fa6953a0b +mypy-boto3-lambda==1.34.58 \ + --hash=sha256:6ab1b9611ff396e9310ad77f02994a6e03d40c8a0eea51085e355b4fd2a0cbc9 \ + --hash=sha256:903822c74bd1b34748eb2d72eab0f132fbc3b392c8041aa8fe4d9552a44b0c65 # via boto3-stubs mypy-boto3-s3==1.34.14 \ --hash=sha256:71c39ab0623cdb442d225b71c1783f6a513cff4c4a13505a2efbb2e3aff2e965 \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index 5eb460231c..4d94effd23 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -56,25 +56,25 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.57 \ - --hash=sha256:c26c31ceeeb2bc5d2bb96ba0fdc9a04d7b10e6e0b081c55b9cea9069a0be04dd \ - --hash=sha256:f8046e3e2d1186a49b49f7464c4811c265c86001f404dd1a96c4365c773a4245 +boto3==1.34.58 \ + --hash=sha256:09e3d17c718bc938a76774f31bc557b20733c0f5f9135a3e7782b55f3459cbdd \ + --hash=sha256:d213a6fea9db6d537b1e65924133d8279ada79a40bc840d4930e1b64be869d4c # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.57 \ - --hash=sha256:2b7271bb6876dc6a6b3f1e6194471da5deaa92ce9c4ee56abf42de0dc39be456 \ - --hash=sha256:7a46ee0cf8d068f36cbd08ad1679001fd03f6357d2a6a8e35ad051b00a8e9676 +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.58 \ + --hash=sha256:14ea85a355f984bd7dc17e39237bfc24c3a55479fbcb87f17c00269bd95a2b44 \ + --hash=sha256:f164e520361d6aa39d295ac09588a6dc6b8efbc4058ada0b796d3bfb0e6e6e98 # via aws-sam-cli (setup.py) -botocore==1.34.57 \ - --hash=sha256:9a5aa2034de9f0c367b4b61a92af0fa827f5c21affa19e0a284838a142e71083 \ - --hash=sha256:c8dafe0ad378a88bcf4153e6972870b03fb5aab406b694202307500709940baf +botocore==1.34.58 \ + --hash=sha256:8086a6ea27d0f658505ac81e6d7314e013561469c40db9b5a4692127eb5c97cf \ + --hash=sha256:d75216952886dc513ea1b5e2979a6af08feed2f537e3fc102e4a0a2ead563a35 # via # boto3 # s3transfer -botocore-stubs==1.34.57 \ - --hash=sha256:13f133ef244ebde6425cff3b41b43898af709d0fc8a749b26ddf304eff3a6570 \ - --hash=sha256:2deb03f218469c5a76dfefeb2d1e9f1599914adbb5f8bd8cc0d7ad7d7a07ae33 +botocore-stubs==1.34.58 \ + --hash=sha256:7f820ed37a11109744a8c4aeb9f0224c7114b5aaabcbd46fc6c4f60af69faa3e \ + --hash=sha256:830bf3bc6b0a7299f770c0adcbea21fda5d240080024f12ca6d80633a3ce46c4 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ @@ -453,9 +453,9 @@ mypy-boto3-kinesis==1.34.0 \ --hash=sha256:1add81c53f6e36599e0c22e142024867759aaf2f4954bcb2baa21c284c852377 \ --hash=sha256:f404e75badd5977e9f09741b769b8888854bdd411c631344686ab889efe98741 # via boto3-stubs -mypy-boto3-lambda==1.34.46 \ - --hash=sha256:275297944c5e36a170b37ce70229f21db6dd3561606799f18d96e36ac5df6876 \ - --hash=sha256:a12232002e04ee06b413b47068bc6bb085aeaa3693d28e9bf0efd76fa6953a0b +mypy-boto3-lambda==1.34.58 \ + --hash=sha256:6ab1b9611ff396e9310ad77f02994a6e03d40c8a0eea51085e355b4fd2a0cbc9 \ + --hash=sha256:903822c74bd1b34748eb2d72eab0f132fbc3b392c8041aa8fe4d9552a44b0c65 # via boto3-stubs mypy-boto3-s3==1.34.14 \ --hash=sha256:71c39ab0623cdb442d225b71c1783f6a513cff4c4a13505a2efbb2e3aff2e965 \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index f73bb4f5de..a1b7d971f9 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -38,25 +38,25 @@ blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 # via flask -boto3==1.34.57 \ - --hash=sha256:c26c31ceeeb2bc5d2bb96ba0fdc9a04d7b10e6e0b081c55b9cea9069a0be04dd \ - --hash=sha256:f8046e3e2d1186a49b49f7464c4811c265c86001f404dd1a96c4365c773a4245 +boto3==1.34.58 \ + --hash=sha256:09e3d17c718bc938a76774f31bc557b20733c0f5f9135a3e7782b55f3459cbdd \ + --hash=sha256:d213a6fea9db6d537b1e65924133d8279ada79a40bc840d4930e1b64be869d4c # via # aws-sam-cli (setup.py) # aws-sam-translator -boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.57 \ - --hash=sha256:2b7271bb6876dc6a6b3f1e6194471da5deaa92ce9c4ee56abf42de0dc39be456 \ - --hash=sha256:7a46ee0cf8d068f36cbd08ad1679001fd03f6357d2a6a8e35ad051b00a8e9676 +boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.34.58 \ + --hash=sha256:14ea85a355f984bd7dc17e39237bfc24c3a55479fbcb87f17c00269bd95a2b44 \ + --hash=sha256:f164e520361d6aa39d295ac09588a6dc6b8efbc4058ada0b796d3bfb0e6e6e98 # via aws-sam-cli (setup.py) -botocore==1.34.57 \ - --hash=sha256:9a5aa2034de9f0c367b4b61a92af0fa827f5c21affa19e0a284838a142e71083 \ - --hash=sha256:c8dafe0ad378a88bcf4153e6972870b03fb5aab406b694202307500709940baf +botocore==1.34.58 \ + --hash=sha256:8086a6ea27d0f658505ac81e6d7314e013561469c40db9b5a4692127eb5c97cf \ + --hash=sha256:d75216952886dc513ea1b5e2979a6af08feed2f537e3fc102e4a0a2ead563a35 # via # boto3 # s3transfer -botocore-stubs==1.34.57 \ - --hash=sha256:13f133ef244ebde6425cff3b41b43898af709d0fc8a749b26ddf304eff3a6570 \ - --hash=sha256:2deb03f218469c5a76dfefeb2d1e9f1599914adbb5f8bd8cc0d7ad7d7a07ae33 +botocore-stubs==1.34.58 \ + --hash=sha256:7f820ed37a11109744a8c4aeb9f0224c7114b5aaabcbd46fc6c4f60af69faa3e \ + --hash=sha256:830bf3bc6b0a7299f770c0adcbea21fda5d240080024f12ca6d80633a3ce46c4 # via boto3-stubs certifi==2024.2.2 \ --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ @@ -429,9 +429,9 @@ mypy-boto3-kinesis==1.34.0 \ --hash=sha256:1add81c53f6e36599e0c22e142024867759aaf2f4954bcb2baa21c284c852377 \ --hash=sha256:f404e75badd5977e9f09741b769b8888854bdd411c631344686ab889efe98741 # via boto3-stubs -mypy-boto3-lambda==1.34.46 \ - --hash=sha256:275297944c5e36a170b37ce70229f21db6dd3561606799f18d96e36ac5df6876 \ - --hash=sha256:a12232002e04ee06b413b47068bc6bb085aeaa3693d28e9bf0efd76fa6953a0b +mypy-boto3-lambda==1.34.58 \ + --hash=sha256:6ab1b9611ff396e9310ad77f02994a6e03d40c8a0eea51085e355b4fd2a0cbc9 \ + --hash=sha256:903822c74bd1b34748eb2d72eab0f132fbc3b392c8041aa8fe4d9552a44b0c65 # via boto3-stubs mypy-boto3-s3==1.34.14 \ --hash=sha256:71c39ab0623cdb442d225b71c1783f6a513cff4c4a13505a2efbb2e3aff2e965 \ From 4cbe0109dc8d159b9eb9b5ed5ae77766a92c491e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:48:49 -0800 Subject: [PATCH 18/23] chore(deps-dev): bump the pytest group in /requirements with 1 update (#6797) Bumps the pytest group in /requirements with 1 update: [pytest-timeout](https://github.com/pytest-dev/pytest-timeout). Updates `pytest-timeout` from 2.2.0 to 2.3.1 - [Commits](https://github.com/pytest-dev/pytest-timeout/compare/2.2.0...2.3.1) --- updated-dependencies: - dependency-name: pytest-timeout dependency-type: direct:development update-type: version-update:semver-minor dependency-group: pytest ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements/dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index e2fbb2c7a9..35aada2903 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -28,7 +28,7 @@ pytest~=8.0.1 parameterized==0.9.0 pytest-xdist==3.5.0 pytest-forked==1.6.0 -pytest-timeout==2.2.0 +pytest-timeout==2.3.1 pytest-rerunfailures==13.0 # NOTE (hawflau): DO NOT upgrade pytest-metadata and pytest-json-report unless pytest-json-report addresses https://github.com/numirias/pytest-json-report/issues/89 pytest-metadata==3.1.1 From 04b629615b9abcfad9f5ce840abd39700f47a87c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 23:04:55 +0000 Subject: [PATCH 19/23] chore(deps): bump importlib-metadata in /requirements (#6799) Bumps [importlib-metadata](https://github.com/python/importlib_metadata) from 7.0.1 to 7.0.2. - [Release notes](https://github.com/python/importlib_metadata/releases) - [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst) - [Commits](https://github.com/python/importlib_metadata/compare/v7.0.1...v7.0.2) --- updated-dependencies: - dependency-name: importlib-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- requirements/reproducible-mac.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index 4d94effd23..3fd3a558f6 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -299,9 +299,9 @@ idna==3.6 \ --hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \ --hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f # via requests -importlib-metadata==7.0.1 \ - --hash=sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e \ - --hash=sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc +importlib-metadata==7.0.2 \ + --hash=sha256:198f568f3230878cb1b44fbd7975f87906c22336dba2e4a7f05278c281fbd792 \ + --hash=sha256:f4bc4c0c070c490abf4ce96d715f68e95923320370efb66143df00199bb6c100 # via flask importlib-resources==6.1.3 \ --hash=sha256:4c0269e3580fe2634d364b39b38b961540a7738c02cb984e98add8b4221d793d \ From d8c2b7a5383180b17a5c5333f41e6462ebf57c7d Mon Sep 17 00:00:00 2001 From: Wing Fung Lau <4760060+hawflau@users.noreply.github.com> Date: Fri, 8 Mar 2024 17:20:25 -0800 Subject: [PATCH 20/23] Revert "Fix bug in PR#6719" (#6800) * Revert "Fix bug in PR#6719 (#6794)" This reverts commit 39240d08253ab5d80e3da0a353bf7f83173c046e. * Revert "Handle Container Creation Failure in `local invoke`, `local start-api` and `local start-lambda` (#6719)" This reverts commit 9bcbc0435e377efd141187c4aff3bc83a2ace555. --- .../local/cli_common/invoke_context.py | 14 +---- samcli/commands/local/invoke/cli.py | 9 +-- samcli/commands/local/start_api/cli.py | 1 - samcli/commands/local/start_lambda/cli.py | 1 - samcli/commands/validate/validate.py | 50 +++++++++++++--- samcli/lib/lint.py | 60 ------------------- samcli/local/apigw/local_apigw_service.py | 3 - samcli/local/apigw/service_error_responses.py | 10 ---- samcli/local/docker/container.py | 20 +------ samcli/local/docker/exceptions.py | 6 -- .../lambda_service/lambda_error_responses.py | 26 -------- .../local_lambda_invoke_service.py | 3 - samcli/local/lambdafn/runtime.py | 6 +- tests/unit/commands/local/invoke/test_cli.py | 12 +--- .../unit/commands/local/start_api/test_cli.py | 1 - .../commands/local/start_lambda/test_cli.py | 1 - tests/unit/lib/test_lint.py | 50 ---------------- .../local/apigw/test_local_apigw_service.py | 22 ------- .../test_local_lambda_invoke_service.py | 24 -------- 19 files changed, 50 insertions(+), 269 deletions(-) delete mode 100644 samcli/lib/lint.py delete mode 100644 tests/unit/lib/test_lint.py diff --git a/samcli/commands/local/cli_common/invoke_context.py b/samcli/commands/local/cli_common/invoke_context.py index cc5412431a..9255761143 100644 --- a/samcli/commands/local/cli_common/invoke_context.py +++ b/samcli/commands/local/cli_common/invoke_context.py @@ -11,11 +11,10 @@ from typing import Any, Dict, List, Optional, TextIO, Tuple, Type, cast from samcli.commands._utils.template import TemplateFailedParsingException, TemplateNotFoundException -from samcli.commands.exceptions import ContainersInitializationException, UserException +from samcli.commands.exceptions import ContainersInitializationException from samcli.commands.local.cli_common.user_exceptions import DebugContextException, InvokeContextException from samcli.commands.local.lib.debug_context import DebugContext from samcli.commands.local.lib.local_lambda import LocalLambdaRunner -from samcli.lib.lint import get_lint_matches from samcli.lib.providers.provider import Function, Stack from samcli.lib.providers.sam_function_provider import RefreshableSamFunctionProvider, SamFunctionProvider from samcli.lib.providers.sam_stack_provider import SamLocalStackProvider @@ -101,7 +100,6 @@ def __init__( container_host_interface: Optional[str] = None, add_host: Optional[dict] = None, invoke_images: Optional[str] = None, - verbose: bool = False, ) -> None: """ Initialize the context @@ -156,8 +154,6 @@ def __init__( Optional. Docker extra hosts support from --add-host parameters invoke_images dict Optional. A dictionary that defines the custom invoke image URI of each function - verbose bool - Set template validation to verbose mode """ self._template_file = template_file self._function_identifier = function_identifier @@ -182,7 +178,6 @@ def __init__( self._aws_region = aws_region self._aws_profile = aws_profile self._shutdown = shutdown - self._verbose = verbose self._container_host = container_host self._container_host_interface = container_host_interface @@ -225,13 +220,6 @@ def __enter__(self) -> "InvokeContext": self._stacks = self._get_stacks() - try: - _, matches_output = get_lint_matches(self._template_file, self._verbose, self._aws_region) - if matches_output: - LOG.warning("Lint Error found, containter creation might fail: %s", matches_output) - except UserException as e: - LOG.warning("Non blocking error found when trying to validate template: %s", e) - _function_providers_class: Dict[ContainersMode, Type[SamFunctionProvider]] = { ContainersMode.WARM: RefreshableSamFunctionProvider, ContainersMode.COLD: SamFunctionProvider, diff --git a/samcli/commands/local/invoke/cli.py b/samcli/commands/local/invoke/cli.py index e19ab69c8d..a31d68386d 100644 --- a/samcli/commands/local/invoke/cli.py +++ b/samcli/commands/local/invoke/cli.py @@ -16,11 +16,7 @@ from samcli.commands.local.lib.exceptions import InvalidIntermediateImageError from samcli.lib.telemetry.metric import track_command from samcli.lib.utils.version_checker import check_newer_version -from samcli.local.docker.exceptions import ( - ContainerNotStartableException, - DockerContainerCreationFailedException, - PortAlreadyInUse, -) +from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse LOG = logging.getLogger(__name__) @@ -204,7 +200,6 @@ def do_cli( # pylint: disable=R0914 container_host_interface=container_host_interface, add_host=add_host, invoke_images=processed_invoke_images, - verbose=ctx.debug, ) as context: # Invoke the function context.local_lambda_runner.invoke( @@ -225,7 +220,7 @@ def do_cli( # pylint: disable=R0914 PortAlreadyInUse, ) as ex: raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex - except (DockerImagePullFailedException, DockerContainerCreationFailedException) as ex: + except DockerImagePullFailedException as ex: raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex except ContainerNotStartableException as ex: raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex diff --git a/samcli/commands/local/start_api/cli.py b/samcli/commands/local/start_api/cli.py index 7669ade219..fc42468d9d 100644 --- a/samcli/commands/local/start_api/cli.py +++ b/samcli/commands/local/start_api/cli.py @@ -253,7 +253,6 @@ def do_cli( # pylint: disable=R0914 container_host_interface=container_host_interface, invoke_images=processed_invoke_images, add_host=add_host, - verbose=ctx.debug, ) as invoke_context: ssl_context = (ssl_cert_file, ssl_key_file) if ssl_cert_file else None service = LocalApiService( diff --git a/samcli/commands/local/start_lambda/cli.py b/samcli/commands/local/start_lambda/cli.py index 9b1b136c35..275afa7f1c 100644 --- a/samcli/commands/local/start_lambda/cli.py +++ b/samcli/commands/local/start_lambda/cli.py @@ -205,7 +205,6 @@ def do_cli( # pylint: disable=R0914 container_host_interface=container_host_interface, add_host=add_host, invoke_images=processed_invoke_images, - verbose=ctx.debug, ) as invoke_context: service = LocalLambdaService(lambda_invoke_context=invoke_context, port=port, host=host) service.start() diff --git a/samcli/commands/validate/validate.py b/samcli/commands/validate/validate.py index 732608c7b5..db0a130b24 100644 --- a/samcli/commands/validate/validate.py +++ b/samcli/commands/validate/validate.py @@ -142,15 +142,49 @@ def _lint(ctx: Context, template: str) -> None: Path to the template file """ - from samcli.lib.lint import get_lint_matches + import logging + + import cfnlint.core # type: ignore + + from samcli.commands.exceptions import UserException + + cfn_lint_logger = logging.getLogger("cfnlint") + cfn_lint_logger.propagate = False EventTracker.track_event("UsedFeature", "CFNLint") - matches, matches_output = get_lint_matches(template, ctx.debug, ctx.region) - if not matches: - click.secho("{} is a valid SAM Template".format(template), fg="green") - return - if matches_output: - click.secho(matches_output) + try: + lint_args = [template] + if ctx.debug: + lint_args.append("--debug") + if ctx.region: + lint_args.append("--region") + lint_args.append(ctx.region) + + (args, filenames, formatter) = cfnlint.core.get_args_filenames(lint_args) + cfn_lint_logger.setLevel(logging.WARNING) + matches = list(cfnlint.core.get_matches(filenames, args)) + if not matches: + click.secho("{} is a valid SAM Template".format(template), fg="green") + return + + rules = cfnlint.core.get_used_rules() + matches_output = formatter.print_matches(matches, rules, filenames) + + if matches_output: + click.secho(matches_output) + + raise LinterRuleMatchedException( + "Linting failed. At least one linting rule was matched to the provided template." + ) - raise LinterRuleMatchedException("Linting failed. At least one linting rule was matched to the provided template.") + except cfnlint.core.InvalidRegionException as e: + raise UserException( + "AWS Region was not found. Please configure your region through the --region option", + wrapped_from=e.__class__.__name__, + ) from e + except cfnlint.core.CfnLintExitException as lint_error: + raise UserException( + lint_error, + wrapped_from=lint_error.__class__.__name__, + ) from lint_error diff --git a/samcli/lib/lint.py b/samcli/lib/lint.py deleted file mode 100644 index d0b20945fb..0000000000 --- a/samcli/lib/lint.py +++ /dev/null @@ -1,60 +0,0 @@ -from typing import List, Optional, Tuple - - -def get_lint_matches(template: str, debug: Optional[bool] = None, region: Optional[str] = None) -> Tuple[List, str]: - """ - Parses provided SAM template and maps errors from CloudFormation template back to SAM template. - - Cfn-lint loggers are added to the SAM cli logging hierarchy which at the root logger - configures with INFO level logging and a different formatting. This exposes and duplicates - some cfn-lint logs that are not typically shown to customers. Explicitly setting the level to - WARNING and propagate to be False remediates these issues. - - Parameters - ----------- - template - Path to the template file - debug - Enable debug mode - region - AWS region to run against - - """ - - import logging - - import cfnlint.core # type: ignore - - from samcli.commands.exceptions import UserException - - cfn_lint_logger = logging.getLogger("cfnlint") - cfn_lint_logger.propagate = False - - try: - lint_args = [template] - if debug: - lint_args.append("--debug") - if region: - lint_args.append("--region") - lint_args.append(region) - - (args, filenames, formatter) = cfnlint.core.get_args_filenames(lint_args) - cfn_lint_logger.setLevel(logging.WARNING) - matches = list(cfnlint.core.get_matches(filenames, args)) - if not matches: - return matches, "" - - rules = cfnlint.core.get_used_rules() - matches_output = formatter.print_matches(matches, rules, filenames) - return matches, matches_output - - except cfnlint.core.InvalidRegionException as e: - raise UserException( - "AWS Region was not found. Please configure your region through the --region option", - wrapped_from=e.__class__.__name__, - ) from e - except cfnlint.core.CfnLintExitException as lint_error: - raise UserException( - lint_error, - wrapped_from=lint_error.__class__.__name__, - ) from lint_error diff --git a/samcli/local/apigw/local_apigw_service.py b/samcli/local/apigw/local_apigw_service.py index 78104c0f7b..1e0f871fcd 100644 --- a/samcli/local/apigw/local_apigw_service.py +++ b/samcli/local/apigw/local_apigw_service.py @@ -30,7 +30,6 @@ from samcli.local.apigw.path_converter import PathConverter from samcli.local.apigw.route import Route from samcli.local.apigw.service_error_responses import ServiceErrorResponses -from samcli.local.docker.exceptions import DockerContainerCreationFailedException from samcli.local.events.api_event import ( ContextHTTP, ContextIdentity, @@ -731,8 +730,6 @@ def _request_handler(self, **kwargs): ) except LambdaResponseParseException: endpoint_service_error = ServiceErrorResponses.lambda_body_failure_response() - except DockerContainerCreationFailedException as ex: - endpoint_service_error = ServiceErrorResponses.container_creation_failed(ex.message) if endpoint_service_error: return endpoint_service_error diff --git a/samcli/local/apigw/service_error_responses.py b/samcli/local/apigw/service_error_responses.py index 6c19b3a2e7..42c91e22c1 100644 --- a/samcli/local/apigw/service_error_responses.py +++ b/samcli/local/apigw/service_error_responses.py @@ -101,13 +101,3 @@ def route_not_found(*args): """ response_data = jsonify(ServiceErrorResponses._MISSING_AUTHENTICATION) return make_response(response_data, ServiceErrorResponses.HTTP_STATUS_CODE_403) - - @staticmethod - def container_creation_failed(message): - """ - Constuct a Flask Response for when container creation fails for a Lambda Function - - :return: a Flask Response - """ - response_data = jsonify({"message": message}) - return make_response(response_data, ServiceErrorResponses.HTTP_STATUS_CODE_501) diff --git a/samcli/local/docker/container.py b/samcli/local/docker/container.py index a34e96c7c1..9e83e8eca0 100644 --- a/samcli/local/docker/container.py +++ b/samcli/local/docker/container.py @@ -17,23 +17,14 @@ import docker import requests -from docker.errors import ( - APIError as DockerAPIError, -) -from docker.errors import ( - NotFound as DockerNetworkNotFound, -) +from docker.errors import NotFound as DockerNetworkNotFound from samcli.lib.constants import DOCKER_MIN_API_VERSION from samcli.lib.utils.retry import retry from samcli.lib.utils.stream_writer import StreamWriter from samcli.lib.utils.tar import extract_tarfile from samcli.local.docker.effective_user import ROOT_USER_ID, EffectiveUser -from samcli.local.docker.exceptions import ( - ContainerNotStartableException, - DockerContainerCreationFailedException, - PortAlreadyInUse, -) +from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse from samcli.local.docker.utils import NoFreePortsError, find_free_port, to_posix_path LOG = logging.getLogger(__name__) @@ -236,12 +227,7 @@ def create(self): if self._extra_hosts: kwargs["extra_hosts"] = self._extra_hosts - try: - real_container = self.docker_client.containers.create(self._image, **kwargs) - except DockerAPIError as ex: - raise DockerContainerCreationFailedException( - f"Container creation failed: {ex.explanation}, check template for potential issue" - ) + real_container = self.docker_client.containers.create(self._image, **kwargs) self.id = real_container.id self._logs_thread = None diff --git a/samcli/local/docker/exceptions.py b/samcli/local/docker/exceptions.py index e22eac1583..6ff7ad3850 100644 --- a/samcli/local/docker/exceptions.py +++ b/samcli/local/docker/exceptions.py @@ -37,9 +37,3 @@ class InvalidRuntimeException(UserException): """ Raised when an invalid runtime is specified for a Lambda Function """ - - -class DockerContainerCreationFailedException(UserException): - """ - Docker Container Creation failed. It could be due to invalid template - """ diff --git a/samcli/local/lambda_service/lambda_error_responses.py b/samcli/local/lambda_service/lambda_error_responses.py index 3596828bf5..89ef7b13dc 100644 --- a/samcli/local/lambda_service/lambda_error_responses.py +++ b/samcli/local/lambda_service/lambda_error_responses.py @@ -20,7 +20,6 @@ class LambdaErrorResponses: InvalidRequestContentException = ("InvalidRequestContent", 400) NotImplementedException = ("NotImplemented", 501) - ContainerCreationFailed = ("ContainerCreationFailed", 501) PathNotFoundException = ("PathNotFoundLocally", 404) @@ -205,31 +204,6 @@ def generic_method_not_allowed(*args): exception_tuple[1], ) - @staticmethod - def container_creation_failed(message): - """ - Creates a Container Creation Failed response - - Parameters - ---------- - args list - List of arguments Flask passes to the method - - Returns - ------- - Flask.Response - A response object representing the ContainerCreationFailed Error - """ - error_type, status_code = LambdaErrorResponses.ContainerCreationFailed - return BaseLocalService.service_response( - LambdaErrorResponses._construct_error_response_body( - LambdaErrorResponses.LOCAL_SERVICE_ERROR, - message, - ), - LambdaErrorResponses._construct_headers(error_type), - status_code, - ) - @staticmethod def _construct_error_response_body(error_type, error_message): """ diff --git a/samcli/local/lambda_service/local_lambda_invoke_service.py b/samcli/local/lambda_service/local_lambda_invoke_service.py index 51030f6806..a847802b3c 100644 --- a/samcli/local/lambda_service/local_lambda_invoke_service.py +++ b/samcli/local/lambda_service/local_lambda_invoke_service.py @@ -9,7 +9,6 @@ from samcli.commands.local.lib.exceptions import UnsupportedInlineCodeError from samcli.lib.utils.stream_writer import StreamWriter -from samcli.local.docker.exceptions import DockerContainerCreationFailedException from samcli.local.lambdafn.exceptions import FunctionNotFound from samcli.local.services.base_local_service import BaseLocalService, LambdaOutputParser @@ -179,8 +178,6 @@ def _invoke_request_handler(self, function_name): return LambdaErrorResponses.not_implemented_locally( "Inline code is not supported for sam local commands. Please write your code in a separate file." ) - except DockerContainerCreationFailedException as ex: - return LambdaErrorResponses.container_creation_failed(ex.message) lambda_response, is_lambda_user_error_response = LambdaOutputParser.get_lambda_output( stdout_stream_string, stdout_stream_bytes diff --git a/samcli/local/lambdafn/runtime.py b/samcli/local/lambdafn/runtime.py index 38922f858d..83af384dcf 100644 --- a/samcli/local/lambdafn/runtime.py +++ b/samcli/local/lambdafn/runtime.py @@ -16,7 +16,7 @@ from samcli.lib.utils.packagetype import ZIP from samcli.local.docker.container import Container from samcli.local.docker.container_analyzer import ContainerAnalyzer -from samcli.local.docker.exceptions import ContainerFailureError, DockerContainerCreationFailedException +from samcli.local.docker.exceptions import ContainerFailureError from samcli.local.docker.lambda_container import LambdaContainer from ...lib.providers.provider import LayerVersion @@ -112,10 +112,6 @@ def create( self._container_manager.create(container) return container - except DockerContainerCreationFailedException: - LOG.warning("Failed to create container for function %s", function_config.full_path) - raise - except KeyboardInterrupt: LOG.debug("Ctrl+C was pressed. Aborting container creation") raise diff --git a/tests/unit/commands/local/invoke/test_cli.py b/tests/unit/commands/local/invoke/test_cli.py index 78a915c390..a033905b8c 100644 --- a/tests/unit/commands/local/invoke/test_cli.py +++ b/tests/unit/commands/local/invoke/test_cli.py @@ -6,11 +6,7 @@ from unittest.mock import patch, Mock from parameterized import parameterized, param -from samcli.local.docker.exceptions import ( - ContainerNotStartableException, - PortAlreadyInUse, - DockerContainerCreationFailedException, -) +from samcli.local.docker.exceptions import ContainerNotStartableException, PortAlreadyInUse from samcli.local.lambdafn.exceptions import FunctionNotFound from samcli.lib.providers.exceptions import InvalidLayerReference from samcli.commands.validate.lib.exceptions import InvalidSamDocumentException @@ -116,7 +112,6 @@ def test_cli_must_setup_context_and_invoke(self, get_event_mock, InvokeContextMo container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={None: "amazon/aws-sam-cli-emulation-image-python3.9"}, - verbose=self.ctx_mock.debug, ) context_mock.local_lambda_runner.invoke.assert_called_with( @@ -157,7 +152,6 @@ def test_cli_must_invoke_with_no_event(self, get_event_mock, InvokeContextMock): container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={None: "amazon/aws-sam-cli-emulation-image-python3.9"}, - verbose=self.ctx_mock.debug, ) get_event_mock.assert_not_called() @@ -269,10 +263,6 @@ def test_must_raise_user_exception_on_invalid_env_vars(self, get_event_mock, Inv PortAlreadyInUse("Container cannot be started, provided port already in use"), "Container cannot be started, provided port already in use", ), - param( - DockerContainerCreationFailedException("Container creation failed, check template for potential issue"), - "Container creation failed, check template for potential issue", - ), ] ) @patch("samcli.commands.local.cli_common.invoke_context.InvokeContext") diff --git a/tests/unit/commands/local/start_api/test_cli.py b/tests/unit/commands/local/start_api/test_cli.py index 1c1dde2d34..1860dd66c0 100644 --- a/tests/unit/commands/local/start_api/test_cli.py +++ b/tests/unit/commands/local/start_api/test_cli.py @@ -97,7 +97,6 @@ def test_cli_must_setup_context_and_start_service(self, local_api_service_mock, container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={}, - verbose=self.ctx_mock.debug, ) local_api_service_mock.assert_called_with( diff --git a/tests/unit/commands/local/start_lambda/test_cli.py b/tests/unit/commands/local/start_lambda/test_cli.py index 2a620ec194..aa779ed871 100644 --- a/tests/unit/commands/local/start_lambda/test_cli.py +++ b/tests/unit/commands/local/start_lambda/test_cli.py @@ -84,7 +84,6 @@ def test_cli_must_setup_context_and_start_service(self, local_lambda_service_moc container_host_interface=self.container_host_interface, add_host=self.add_host, invoke_images={}, - verbose=self.ctx_mock.debug, ) local_lambda_service_mock.assert_called_with(lambda_invoke_context=context_mock, port=self.port, host=self.host) diff --git a/tests/unit/lib/test_lint.py b/tests/unit/lib/test_lint.py deleted file mode 100644 index d5eda1f8aa..0000000000 --- a/tests/unit/lib/test_lint.py +++ /dev/null @@ -1,50 +0,0 @@ -from unittest import TestCase -from unittest.mock import Mock, patch - -from parameterized import parameterized - -from samcli.lib.lint import get_lint_matches - - -class TestLint(TestCase): - args_mock = Mock() - filenames_mock = Mock() - formatter_mock = Mock() - get_args_filenames_mock = Mock() - get_matches_mock = Mock() - - @parameterized.expand( - [ - (("path/to/template", None, None), ["path/to/template"]), - (("path/to/template", True, None), ["path/to/template", "--debug"]), - (("path/to/template", False, "us-east-1"), ["path/to/template", "--region", "us-east-1"]), - ] - ) - @patch("cfnlint.core") - def test_empty_matches(self, call_args, expect_called_args, cfnlint_mock): - self.get_args_filenames_mock.return_value = (self.args_mock, self.filenames_mock, self.formatter_mock) - cfnlint_mock.get_args_filenames = self.get_args_filenames_mock - self.get_matches_mock.return_value = [] - cfnlint_mock.get_matches = self.get_matches_mock - actual = get_lint_matches(*call_args) - self.get_args_filenames_mock.assert_called_with(expect_called_args) - self.get_matches_mock.assert_called_with(self.filenames_mock, self.args_mock) - self.assertEqual(actual, ([], "")) - - @patch("cfnlint.core") - def test_non_empty_matches(self, cfnlint_mock): - self.get_args_filenames_mock.return_value = (self.args_mock, self.filenames_mock, self.formatter_mock) - cfnlint_mock.get_args_filenames = self.get_args_filenames_mock - match = Mock() - self.get_matches_mock.return_value = [match] - cfnlint_mock.get_matches = self.get_matches_mock - cfnlint_mock.get_used_rules = Mock() - self.formatter_mock.print_matches = Mock() - self.formatter_mock.print_matches.return_value = "lint error" - - actual = get_lint_matches("path_to_template") - self.get_args_filenames_mock.assert_called_with(["path_to_template"]) - self.get_matches_mock.assert_called_with(self.filenames_mock, self.args_mock) - cfnlint_mock.get_used_rules.assert_called_once() - self.formatter_mock.print_matches.assert_called_once() - self.assertEqual(actual, ([match], "lint error")) diff --git a/tests/unit/local/apigw/test_local_apigw_service.py b/tests/unit/local/apigw/test_local_apigw_service.py index 54bf0da1e0..c3442aaf06 100644 --- a/tests/unit/local/apigw/test_local_apigw_service.py +++ b/tests/unit/local/apigw/test_local_apigw_service.py @@ -23,7 +23,6 @@ LambdaResponseParseException, PayloadFormatVersionValidateException, ) -from samcli.local.docker.exceptions import DockerContainerCreationFailedException from samcli.local.lambdafn.exceptions import FunctionNotFound from samcli.commands.local.lib.exceptions import UnsupportedInlineCodeError @@ -458,27 +457,6 @@ def test_request_handles_error_when_invoke_function_with_inline_code( self.assertEqual(response, not_implemented_response_mock) - @patch.object(LocalApigwService, "get_request_methods_endpoints") - @patch("samcli.local.apigw.local_apigw_service.ServiceErrorResponses") - @patch("samcli.local.apigw.local_apigw_service.LocalApigwService._generate_lambda_event") - def test_request_handles_error_when_container_creation_failed( - self, generate_mock, service_error_responses_patch, request_mock - ): - generate_mock.return_value = {} - container_creation_failed_response_mock = Mock() - self.api_service._get_current_route = MagicMock() - self.api_service._get_current_route.return_value.payload_format_version = "2.0" - self.api_service._get_current_route.return_value.authorizer_object = None - self.api_service._get_current_route.methods = [] - - service_error_responses_patch.container_creation_failed.return_value = container_creation_failed_response_mock - - self.lambda_runner.invoke.side_effect = DockerContainerCreationFailedException("container creation failed") - request_mock.return_value = ("test", "test") - response = self.api_service._request_handler() - - self.assertEqual(response, container_creation_failed_response_mock) - @patch.object(LocalApigwService, "get_request_methods_endpoints") def test_request_throws_when_invoke_fails(self, request_mock): self.lambda_runner.invoke.side_effect = Exception() diff --git a/tests/unit/local/lambda_service/test_local_lambda_invoke_service.py b/tests/unit/local/lambda_service/test_local_lambda_invoke_service.py index af5a2a5aa2..e338762db9 100644 --- a/tests/unit/local/lambda_service/test_local_lambda_invoke_service.py +++ b/tests/unit/local/lambda_service/test_local_lambda_invoke_service.py @@ -1,7 +1,6 @@ from unittest import TestCase from unittest.mock import Mock, patch, ANY, call -from samcli.local.docker.exceptions import DockerContainerCreationFailedException from samcli.local.lambda_service import local_lambda_invoke_service from samcli.local.lambda_service.local_lambda_invoke_service import LocalLambdaInvokeService, FunctionNamePathConverter from samcli.local.lambdafn.exceptions import FunctionNotFound @@ -112,29 +111,6 @@ def test_invoke_request_function_contains_inline_code(self, lambda_error_respons lambda_error_responses_mock.not_implemented_locally.assert_called() - @patch("samcli.local.lambda_service.local_lambda_invoke_service.LambdaErrorResponses") - def test_invoke_request_container_creation_failed(self, lambda_error_responses_mock): - request_mock = Mock() - request_mock.get_data.return_value = b"{}" - local_lambda_invoke_service.request = request_mock - - lambda_runner_mock = Mock() - lambda_runner_mock.invoke.side_effect = DockerContainerCreationFailedException("container creation failed") - - lambda_error_responses_mock.container_creation_failed.return_value = "Container creation failed" - - service = LocalLambdaInvokeService(lambda_runner=lambda_runner_mock, port=3000, host="localhost") - - response = service._invoke_request_handler(function_name="FunctionContainerCreationFailed") - - self.assertEqual(response, "Container creation failed") - - lambda_runner_mock.invoke.assert_called_once_with( - "FunctionContainerCreationFailed", "{}", stdout=ANY, stderr=None - ) - - lambda_error_responses_mock.container_creation_failed.assert_called() - @patch("samcli.local.lambda_service.local_lambda_invoke_service.LocalLambdaInvokeService.service_response") @patch("samcli.local.lambda_service.local_lambda_invoke_service.LambdaOutputParser") def test_request_handler_returns_process_stdout_when_making_response( From bf30d6c322a6808c1e8955f0679df0c763f855e1 Mon Sep 17 00:00:00 2001 From: sidhujus <105385029+sidhujus@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:29:52 -0700 Subject: [PATCH 21/23] feat: Display new CFN status during deploy (#6815) * Display ResourceDetailedStatus if present (#626) * fix formating --------- Co-authored-by: Jared Bentvelsen --- samcli/lib/deploy/deployer.py | 8 +++- tests/unit/lib/deploy/test_deployer.py | 61 ++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/samcli/lib/deploy/deployer.py b/samcli/lib/deploy/deployer.py index effe608001..c1786f3c99 100644 --- a/samcli/lib/deploy/deployer.py +++ b/samcli/lib/deploy/deployer.py @@ -421,8 +421,14 @@ def describe_stack_events( for new_event in new_events: row_color = self.deploy_color.get_stack_events_status_color(status=new_event["ResourceStatus"]) pprint_columns( + # Print the detailed status beside the status if it is present + # E.g. CREATE_IN_PROGRESS - CONFIGURATION_COMPLETE columns=[ - new_event["ResourceStatus"], + ( + (new_event["ResourceStatus"] + " - " + new_event["ResourceDetailedStatus"]) + if "ResourceDetailedStatus" in new_event + else new_event["ResourceStatus"] + ), new_event["ResourceType"], new_event["LogicalResourceId"], new_event.get("ResourceStatusReason", "-"), diff --git a/tests/unit/lib/deploy/test_deployer.py b/tests/unit/lib/deploy/test_deployer.py index ae505ff546..d96eb08a18 100644 --- a/tests/unit/lib/deploy/test_deployer.py +++ b/tests/unit/lib/deploy/test_deployer.py @@ -1419,3 +1419,64 @@ def test_rollback_wait_timeout(self, time_mock, log_mock): self.deployer._rollback_wait("test") self.assertEqual(log_mock.call_count, 1) + + @patch("samcli.lib.deploy.deployer.pprint_columns") + def test_show_stabilizing_status(self, patched_pprint_columns): + start_timestamp = datetime(2022, 1, 1, 16, 42, 0, 0, timezone.utc) + + self.deployer._client.get_paginator = MagicMock( + return_value=MockPaginator( + # describe_stack_events is in reverse chronological order + [ + { + "StackEvents": [ + { + "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack-name/...", + "EventId": "1", + "StackName": "my-stack-name", + "LogicalResourceId": "my-stack-name", + "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack-name/...", + "ResourceType": "AWS::CloudFormation::Stack", + "Timestamp": start_timestamp + timedelta(seconds=3), + "ResourceStatus": "CREATE_COMPLETE", + }, + { + "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack-name/...", + "EventId": "2", + "StackName": "my-stack-name", + "LogicalResourceId": "mybucket", + "PhysicalResourceId": "arn:aws:cloudformation:region:accountId:stack/test/uuid", + "ResourceType": "AWS::S3::Bucket", + "Timestamp": start_timestamp + timedelta(seconds=2), + "ResourceStatus": "CREATE_IN_PROGRESS", + "ResourceDetailedStatus": "CONFIGURATION_COMPLETE", + }, + { + "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack-name/...", + "EventId": "3", + "StackName": "my-stack-name", + "LogicalResourceId": "mybucket", + "PhysicalResourceId": "arn:aws:cloudformation:region:accountId:stack/test/uuid", + "ResourceType": "AWS::S3::Bucket", + "Timestamp": start_timestamp + timedelta(seconds=1), + "ResourceStatus": "CREATE_IN_PROGRESS", + }, + ] + }, + ] + ) + ) + self.deployer.describe_stack_events("test", utc_to_timestamp(start_timestamp)) + self.assertEqual(patched_pprint_columns.call_count, 3) + self.assertListSubset( + ["CREATE_IN_PROGRESS", "AWS::S3::Bucket", "mybucket"], + patched_pprint_columns.call_args_list[0][1]["columns"], + ) + self.assertListSubset( + ["CREATE_IN_PROGRESS - CONFIGURATION_COMPLETE", "AWS::S3::Bucket", "mybucket"], + patched_pprint_columns.call_args_list[1][1]["columns"], + ) + self.assertListSubset( + ["CREATE_COMPLETE", "AWS::CloudFormation::Stack", "my-stack-name"], + patched_pprint_columns.call_args_list[2][1]["columns"], + ) From 698585f51e3f9924081c01e90d372917a85614d0 Mon Sep 17 00:00:00 2001 From: sidhujus <105385029+sidhujus@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:38:52 -0700 Subject: [PATCH 22/23] fix: change rvm to rbenv (#6816) * change rvm to rbenv * Update appveyor-ubuntu.yml Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> * Update appveyor-ubuntu.yml Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --------- Co-authored-by: Haresh Nasit <84355507+hnnasit@users.noreply.github.com> --- appveyor-ubuntu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor-ubuntu.yml b/appveyor-ubuntu.yml index 9a16892b33..dd82e5e2f9 100644 --- a/appveyor-ubuntu.yml +++ b/appveyor-ubuntu.yml @@ -53,8 +53,8 @@ install: - sh: "mvn --version" - sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate" - - sh: "rvm reinstall ruby-3.2.2 --with-openssl-dir=/usr/lib/x86_64-linux-gnu" # reinstall ruby3.2 to fix OpenSSL issue - - sh: "rvm use 3.2.2" + - sh: "rbenv global 3.2.3" + - sh: "ruby --version" - sh: "docker info" - sh: "docker version" - sh: "nvm install ${NODE_VERSION}" From db0efecaa9bb520ef881f9b9038e96b9ab245f9d Mon Sep 17 00:00:00 2001 From: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:17:13 -0700 Subject: [PATCH 23/23] chore: bump sam cli version to 1.112.0 (#6817) --- samcli/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samcli/__init__.py b/samcli/__init__.py index c6423bbc51..37c5ab641b 100644 --- a/samcli/__init__.py +++ b/samcli/__init__.py @@ -2,4 +2,4 @@ SAM CLI version """ -__version__ = "1.111.0" +__version__ = "1.112.0"