Skip to content

Commit c91f5f8

Browse files
Merge from aws/aws-sam-cli/develop
2 parents df7dff3 + 327a4a3 commit c91f5f8

File tree

267 files changed

+13213
-988
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+13213
-988
lines changed

.github/workflows/integration-tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
- local-invoke
5252
- local-start1
5353
- local-start2
54+
- durable-functions
5455
- other-and-e2e
5556
exclude:
5657
# no-container mode only applies to build-integ test suites
@@ -66,6 +67,8 @@ jobs:
6667
test_suite: local-start1
6768
- container_runtime: no-container
6869
test_suite: local-start2
70+
- container_runtime: no-container
71+
test_suite: durable-functions
6972
- container_runtime: no-container
7073
test_suite: other-and-e2e
7174

@@ -374,13 +377,16 @@ jobs:
374377
pytest -vv tests/integration/sync -n 6 --reruns 3 --dist loadscope --json-report --json-report-file=TEST_REPORT-integration-sync-${{ matrix.container_runtime }}.json
375378
;;
376379
"local-invoke")
377-
pytest -vv --reruns 3 tests/integration/local/invoke tests/integration/local/generate_event --json-report --json-report-file=TEST_REPORT-integration-local-invoke-${{ matrix.container_runtime }}.json
380+
pytest -vv --reruns 3 tests/integration/local/invoke tests/integration/local/generate_event --ignore tests/integration/local/invoke/test_invoke_durable.py --json-report --json-report-file=TEST_REPORT-integration-local-invoke-${{ matrix.container_runtime }}.json
378381
;;
379382
"local-start1")
380-
pytest -vv --reruns 3 tests/integration/local/start_api --ignore tests/integration/local/start_api/test_start_api_with_terraform_application.py --json-report --json-report-file=TEST_REPORT-integration-local-start1-${{ matrix.container_runtime }}.json
383+
pytest -vv --reruns 3 tests/integration/local/start_api --ignore tests/integration/local/start_api/test_start_api_with_terraform_application.py --ignore tests/integration/local/start_api/test_start_api_durable.py --json-report --json-report-file=TEST_REPORT-integration-local-start1-${{ matrix.container_runtime }}.json
381384
;;
382385
"local-start2")
383-
pytest -vv --reruns 3 tests/integration/local/start_lambda tests/integration/local/start_api/test_start_api_with_terraform_application.py --json-report --json-report-file=TEST_REPORT-integration-local-start2-${{ matrix.container_runtime }}.json
386+
pytest -vv --reruns 3 tests/integration/local/start_lambda tests/integration/local/start_api/test_start_api_with_terraform_application.py --ignore tests/integration/local/start_lambda/test_start_lambda_durable.py --json-report --json-report-file=TEST_REPORT-integration-local-start2-${{ matrix.container_runtime }}.json
387+
;;
388+
"durable-functions")
389+
pytest -vv --reruns 3 tests/integration/local/invoke/test_invoke_durable.py tests/integration/local/start_api/test_start_api_durable.py tests/integration/local/start_lambda/test_start_lambda_durable.py tests/integration/local/callback/test_callback.py tests/integration/local/execution/test_execution.py --json-report --json-report-file=TEST_REPORT-integration-durable-functions-${{ matrix.container_runtime }}.json
384390
;;
385391
"other-and-e2e")
386392
pytest -vv -n 4 --reruns 4 --dist loadgroup tests/integration tests/end_to_end --ignore=tests/integration/buildcmd --ignore=tests/integration/delete --ignore=tests/integration/deploy --ignore=tests/integration/package --ignore=tests/integration/sync --ignore=tests/integration/local --json-report --json-report-file=TEST_REPORT-integration-others-${{ matrix.container_runtime }}.json

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,7 @@ samcli/lib/init/templates/cookiecutter-aws-sam-hello-java-gradle/**/.gradle/
422422
.build
423423

424424
.kiro
425-
mise.toml
425+
mise.toml
426+
427+
# Durable executions
428+
**/.durable-executions-local/

requirements/base.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
chevron~=0.12
22
click==8.1.8
33
Flask<3.2
4-
boto3[crt]==1.42.0
4+
boto3[crt]==1.42.1
55
jmespath~=1.0.1
66
ruamel_yaml~=0.18.16
77
PyYAML~=6.0
88
cookiecutter~=2.6.0
9-
aws-sam-translator==1.104.0
9+
aws-sam-translator==1.105.0
1010
#docker minor version updates can include breaking changes. Auto update micro version only.
1111
docker~=7.1.0
1212
dateparser~=1.2
@@ -31,7 +31,7 @@ regex!=2021.10.8
3131
tzlocal==5.3.1
3232

3333
#Adding cfn-lint dependency for SAM validate
34-
cfn-lint~=1.41.0
34+
cfn-lint~=1.42.0
3535

3636
# Type checking boto3 objects
3737
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]>=1.41.0

requirements/reproducible-linux.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ aws-lambda-builders==1.60.0 \
2222
--hash=sha256:518b668130e550a4c88968432fba344a36aa965cca89bf8a30456f991053ae0e \
2323
--hash=sha256:c61d49dd80ee00a484bea3754ff55fd45e6ec5cd3c56169a6eb8767882187dbd
2424
# via aws-sam-cli (setup.py)
25-
aws-sam-translator==1.104.0 \
26-
--hash=sha256:907c50e812f88514fa8f41b8adcb37ba0ee28e1b8c0144b011c4985471b1201d \
27-
--hash=sha256:d873a064df52a7e6426e34cb55ee737085757114776b6ea03e58416f6976d975
25+
aws-sam-translator==1.105.0 \
26+
--hash=sha256:395930e3caa0a67e2432bf09199fa5a60edb71c2b8f05ab4b03a6f6b3fb758b7 \
27+
--hash=sha256:472829abf114e7c47112d88f9b3c27585e9c9b44f9d090d1ab9bc4d235bc12b7
2828
# via
2929
# aws-sam-cli (setup.py)
3030
# cfn-lint
@@ -78,19 +78,19 @@ blinker==1.9.0 \
7878
--hash=sha256:b4ce2265a7abece45e7cc896e98dbebe6cead56bcf805a3d23136d145f5445bf \
7979
--hash=sha256:ba0efaa9080b619ff2f3459d1d500c57bddea4a6b424b60a91141db6fd2f08bc
8080
# via flask
81-
boto3[crt]==1.42.0 \
82-
--hash=sha256:9c67729a6112b7dced521ea70b0369fba138e89852b029a7876041cd1460c084 \
83-
--hash=sha256:af32b7f61dd6293cad728ec205bcb3611ab1bf7b7dbccfd0f2bd7b9c9af96039
81+
boto3[crt]==1.42.1 \
82+
--hash=sha256:137fbea593a30afa1b75656ea1f1ff8796be608a8c77f1b606c4473289679898 \
83+
--hash=sha256:9a8f9799afff600ff5cb43f57a619a5375ea71077ec958bda70e296378da7024
8484
# via
8585
# aws-sam-cli (setup.py)
8686
# aws-sam-translator
8787
boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.41.0 \
8888
--hash=sha256:74d138f2d2f5f48140be81d680722b0194e09bcdf8d2080a914c21d277c2cfe3 \
8989
--hash=sha256:9e373ac5f9c721c5e615ef694a992c333480c71905d3b8e940175dd7265eef93
9090
# via aws-sam-cli (setup.py)
91-
botocore[crt]==1.41.6 \
92-
--hash=sha256:08fe47e9b306f4436f5eaf6a02cb6d55c7745d13d2d093ce5d917d3ef3d3df75 \
93-
--hash=sha256:963cc946e885acb941c96e7d343cb6507b479812ca22566ceb3e9410d0588de0
91+
botocore[crt]==1.42.1 \
92+
--hash=sha256:3337df815c69dd87c314ee29329b8ea411ad3562fb6563d139bbe085dac14ce0 \
93+
--hash=sha256:9d49f5197487f9f71daa9c5397f81484ffcc0dc1cf89a63e94ae3e5a27faa98c
9494
# via
9595
# boto3
9696
# s3transfer
@@ -188,9 +188,9 @@ cffi==2.0.0 \
188188
--hash=sha256:fc7de24befaeae77ba923797c7c87834c73648a05a4bde34b3b7e5588973a453 \
189189
--hash=sha256:fe562eb1a64e67dd297ccc4f5addea2501664954f2692b69a76449ec7913ecbf
190190
# via cryptography
191-
cfn-lint==1.41.0 \
192-
--hash=sha256:6feca1cf57f9ed2833bab68d9b1d38c8033611e571fa792e45ab4a39e2b8ab57 \
193-
--hash=sha256:cd43f76f59a664b2bad580840827849fac0d56a3b80e9a41315d8ab5ff6b563a
191+
cfn-lint==1.42.0 \
192+
--hash=sha256:0bd373d34451e396c14a95be03fe4bcba8d2c00b2a4c61697a04deaa79ab67ed \
193+
--hash=sha256:431523d3bc32f2db411451b8010ccaf770556bebfe44d6df75c1a17ecf957496
194194
# via aws-sam-cli (setup.py)
195195
chardet==5.2.0 \
196196
--hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \

requirements/reproducible-mac.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ aws-lambda-builders==1.60.0 \
2222
--hash=sha256:518b668130e550a4c88968432fba344a36aa965cca89bf8a30456f991053ae0e \
2323
--hash=sha256:c61d49dd80ee00a484bea3754ff55fd45e6ec5cd3c56169a6eb8767882187dbd
2424
# via aws-sam-cli (setup.py)
25-
aws-sam-translator==1.104.0 \
26-
--hash=sha256:907c50e812f88514fa8f41b8adcb37ba0ee28e1b8c0144b011c4985471b1201d \
27-
--hash=sha256:d873a064df52a7e6426e34cb55ee737085757114776b6ea03e58416f6976d975
25+
aws-sam-translator==1.105.0 \
26+
--hash=sha256:395930e3caa0a67e2432bf09199fa5a60edb71c2b8f05ab4b03a6f6b3fb758b7 \
27+
--hash=sha256:472829abf114e7c47112d88f9b3c27585e9c9b44f9d090d1ab9bc4d235bc12b7
2828
# via
2929
# aws-sam-cli (setup.py)
3030
# cfn-lint
@@ -78,19 +78,19 @@ blinker==1.9.0 \
7878
--hash=sha256:b4ce2265a7abece45e7cc896e98dbebe6cead56bcf805a3d23136d145f5445bf \
7979
--hash=sha256:ba0efaa9080b619ff2f3459d1d500c57bddea4a6b424b60a91141db6fd2f08bc
8080
# via flask
81-
boto3[crt]==1.42.0 \
82-
--hash=sha256:9c67729a6112b7dced521ea70b0369fba138e89852b029a7876041cd1460c084 \
83-
--hash=sha256:af32b7f61dd6293cad728ec205bcb3611ab1bf7b7dbccfd0f2bd7b9c9af96039
81+
boto3[crt]==1.42.1 \
82+
--hash=sha256:137fbea593a30afa1b75656ea1f1ff8796be608a8c77f1b606c4473289679898 \
83+
--hash=sha256:9a8f9799afff600ff5cb43f57a619a5375ea71077ec958bda70e296378da7024
8484
# via
8585
# aws-sam-cli (setup.py)
8686
# aws-sam-translator
8787
boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.41.0 \
8888
--hash=sha256:74d138f2d2f5f48140be81d680722b0194e09bcdf8d2080a914c21d277c2cfe3 \
8989
--hash=sha256:9e373ac5f9c721c5e615ef694a992c333480c71905d3b8e940175dd7265eef93
9090
# via aws-sam-cli (setup.py)
91-
botocore[crt]==1.41.6 \
92-
--hash=sha256:08fe47e9b306f4436f5eaf6a02cb6d55c7745d13d2d093ce5d917d3ef3d3df75 \
93-
--hash=sha256:963cc946e885acb941c96e7d343cb6507b479812ca22566ceb3e9410d0588de0
91+
botocore[crt]==1.42.1 \
92+
--hash=sha256:3337df815c69dd87c314ee29329b8ea411ad3562fb6563d139bbe085dac14ce0 \
93+
--hash=sha256:9d49f5197487f9f71daa9c5397f81484ffcc0dc1cf89a63e94ae3e5a27faa98c
9494
# via
9595
# boto3
9696
# s3transfer
@@ -188,9 +188,9 @@ cffi==2.0.0 \
188188
--hash=sha256:fc7de24befaeae77ba923797c7c87834c73648a05a4bde34b3b7e5588973a453 \
189189
--hash=sha256:fe562eb1a64e67dd297ccc4f5addea2501664954f2692b69a76449ec7913ecbf
190190
# via cryptography
191-
cfn-lint==1.41.0 \
192-
--hash=sha256:6feca1cf57f9ed2833bab68d9b1d38c8033611e571fa792e45ab4a39e2b8ab57 \
193-
--hash=sha256:cd43f76f59a664b2bad580840827849fac0d56a3b80e9a41315d8ab5ff6b563a
191+
cfn-lint==1.42.0 \
192+
--hash=sha256:0bd373d34451e396c14a95be03fe4bcba8d2c00b2a4c61697a04deaa79ab67ed \
193+
--hash=sha256:431523d3bc32f2db411451b8010ccaf770556bebfe44d6df75c1a17ecf957496
194194
# via aws-sam-cli (setup.py)
195195
chardet==5.2.0 \
196196
--hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \

requirements/reproducible-win.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ aws-lambda-builders==1.60.0 \
2222
--hash=sha256:518b668130e550a4c88968432fba344a36aa965cca89bf8a30456f991053ae0e \
2323
--hash=sha256:c61d49dd80ee00a484bea3754ff55fd45e6ec5cd3c56169a6eb8767882187dbd
2424
# via aws-sam-cli (setup.py)
25-
aws-sam-translator==1.104.0 \
26-
--hash=sha256:907c50e812f88514fa8f41b8adcb37ba0ee28e1b8c0144b011c4985471b1201d \
27-
--hash=sha256:d873a064df52a7e6426e34cb55ee737085757114776b6ea03e58416f6976d975
25+
aws-sam-translator==1.105.0 \
26+
--hash=sha256:395930e3caa0a67e2432bf09199fa5a60edb71c2b8f05ab4b03a6f6b3fb758b7 \
27+
--hash=sha256:472829abf114e7c47112d88f9b3c27585e9c9b44f9d090d1ab9bc4d235bc12b7
2828
# via
2929
# aws-sam-cli (setup.py)
3030
# cfn-lint
@@ -78,19 +78,19 @@ blinker==1.9.0 \
7878
--hash=sha256:b4ce2265a7abece45e7cc896e98dbebe6cead56bcf805a3d23136d145f5445bf \
7979
--hash=sha256:ba0efaa9080b619ff2f3459d1d500c57bddea4a6b424b60a91141db6fd2f08bc
8080
# via flask
81-
boto3[crt]==1.42.0 \
82-
--hash=sha256:9c67729a6112b7dced521ea70b0369fba138e89852b029a7876041cd1460c084 \
83-
--hash=sha256:af32b7f61dd6293cad728ec205bcb3611ab1bf7b7dbccfd0f2bd7b9c9af96039
81+
boto3[crt]==1.42.1 \
82+
--hash=sha256:137fbea593a30afa1b75656ea1f1ff8796be608a8c77f1b606c4473289679898 \
83+
--hash=sha256:9a8f9799afff600ff5cb43f57a619a5375ea71077ec958bda70e296378da7024
8484
# via
8585
# aws-sam-cli (setup.py)
8686
# aws-sam-translator
8787
boto3-stubs[apigateway,cloudformation,ecr,iam,kinesis,lambda,s3,schemas,secretsmanager,signer,sqs,stepfunctions,sts,xray]==1.41.0 \
8888
--hash=sha256:74d138f2d2f5f48140be81d680722b0194e09bcdf8d2080a914c21d277c2cfe3 \
8989
--hash=sha256:9e373ac5f9c721c5e615ef694a992c333480c71905d3b8e940175dd7265eef93
9090
# via aws-sam-cli (setup.py)
91-
botocore[crt]==1.41.6 \
92-
--hash=sha256:08fe47e9b306f4436f5eaf6a02cb6d55c7745d13d2d093ce5d917d3ef3d3df75 \
93-
--hash=sha256:963cc946e885acb941c96e7d343cb6507b479812ca22566ceb3e9410d0588de0
91+
botocore[crt]==1.42.1 \
92+
--hash=sha256:3337df815c69dd87c314ee29329b8ea411ad3562fb6563d139bbe085dac14ce0 \
93+
--hash=sha256:9d49f5197487f9f71daa9c5397f81484ffcc0dc1cf89a63e94ae3e5a27faa98c
9494
# via
9595
# boto3
9696
# s3transfer
@@ -188,9 +188,9 @@ cffi==2.0.0 \
188188
--hash=sha256:fc7de24befaeae77ba923797c7c87834c73648a05a4bde34b3b7e5588973a453 \
189189
--hash=sha256:fe562eb1a64e67dd297ccc4f5addea2501664954f2692b69a76449ec7913ecbf
190190
# via cryptography
191-
cfn-lint==1.41.0 \
192-
--hash=sha256:6feca1cf57f9ed2833bab68d9b1d38c8033611e571fa792e45ab4a39e2b8ab57 \
193-
--hash=sha256:cd43f76f59a664b2bad580840827849fac0d56a3b80e9a41315d8ab5ff6b563a
191+
cfn-lint==1.42.0 \
192+
--hash=sha256:0bd373d34451e396c14a95be03fe4bcba8d2c00b2a4c61697a04deaa79ab67ed \
193+
--hash=sha256:431523d3bc32f2db411451b8010ccaf770556bebfe44d6df75c1a17ecf957496
194194
# via aws-sam-cli (setup.py)
195195
chardet==5.2.0 \
196196
--hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \

samcli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
SAM CLI version
33
"""
44

5-
__version__ = "1.149.0"
5+
__version__ = "1.150.0"

samcli/cli/lazy_group.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""
2+
LazyGroup implementation for Click CLI performance optimization
3+
"""
4+
5+
import importlib
6+
7+
import click
8+
from click import ClickException
9+
10+
11+
class LazyGroup(click.Group):
12+
def __init__(self, *args, lazy_subcommands=None, **kwargs):
13+
super().__init__(*args, **kwargs)
14+
# lazy_subcommands is a map of the form:
15+
# {command-name} -> {module-name}.{command-object-name}
16+
self.lazy_subcommands = lazy_subcommands or {}
17+
18+
def list_commands(self, ctx):
19+
base = super().list_commands(ctx)
20+
lazy = sorted(self.lazy_subcommands.keys())
21+
return base + lazy
22+
23+
def get_command(self, ctx, cmd_name):
24+
if cmd_name in self.lazy_subcommands:
25+
return self._lazy_load(cmd_name)
26+
return super().get_command(ctx, cmd_name)
27+
28+
def _lazy_load(self, cmd_name):
29+
# lazily loading a command, first get the module name and attribute name
30+
import_path = self.lazy_subcommands[cmd_name]
31+
modname, cmd_object_name = import_path.rsplit(".", 1)
32+
# do the import
33+
try:
34+
mod = importlib.import_module(modname)
35+
except ImportError as e:
36+
raise ClickException(f"Failed to load command '{cmd_name}': {str(e)}")
37+
# get the Command object from that module
38+
try:
39+
cmd_object = getattr(mod, cmd_object_name)
40+
except AttributeError:
41+
raise ClickException(f"Command '{cmd_name}' not found in module '{modname}'")
42+
# check the result to make debugging easier
43+
if not isinstance(cmd_object, click.Command):
44+
raise ClickException(f"Lazy loading of {import_path} failed by returning a non-command object")
45+
return cmd_object

samcli/cli/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def cli(ctx):
142142
if ctx and getattr(ctx, "command_path", None) == "samdev":
143143
from samcli.cli.import_module_proxy import attach_import_module_proxy
144144

145-
LOG.info("Attaching import module proxy for analyzing dynamic imports")
145+
LOG.debug("Attaching import module proxy for analyzing dynamic imports")
146146
attach_import_module_proxy()
147147

148148
gc = GlobalConfig()

samcli/cli/types.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,23 @@ def convert(
633633
return {resource_id: [excluded_path]}
634634

635635

636+
class DurableExecutionArnType(click.ParamType):
637+
"""
638+
Custom Parameter Type for Durable Execution ARN validation.
639+
"""
640+
641+
name = "string"
642+
pattern = (
643+
r"^arn:([a-zA-Z0-9-]+):lambda:([a-zA-Z0-9-]+):(\d{12}):function:([a-zA-Z0-9_-]+):"
644+
r"(\$LATEST(?:\.PUBLISHED)?|[0-9]+)/durable-execution/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$"
645+
)
646+
647+
def convert(self, value, param, ctx):
648+
if not re.match(self.pattern, value):
649+
raise click.BadParameter(f"Invalid Durable Execution ARN format: {value}")
650+
return value
651+
652+
636653
class TextWithSpaces:
637654
def __init__(self, text) -> None:
638655
self.text = text

0 commit comments

Comments
 (0)