Skip to content

Commit de44f7e

Browse files
authored
Merge branch 'develop' into tmp/1678832631/main
2 parents 1e5b158 + ce02bf3 commit de44f7e

File tree

162 files changed

+9275
-1141
lines changed

Some content is hidden

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

162 files changed

+9275
-1141
lines changed

.cfnlintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,4 @@ ignore_checks:
125125
- E2531 # Deprecated runtime; not relevant for transform tests
126126
- W2531 # EOL runtime; not relevant for transform tests
127127
- E3001 # Invalid or unsupported Type; common in transform tests since they focus on SAM resources
128+
- W2001 # Parameter not used

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- "feat-*"
88
pull_request:
99
workflow_dispatch:
10+
merge_group:
11+
types: [checks_requested]
1012

1113
jobs:
1214
build:
@@ -22,6 +24,7 @@ jobs:
2224
- "3.8"
2325
- "3.9"
2426
- "3.10"
27+
- "3.11"
2528
steps:
2629
- uses: actions/checkout@v3
2730
- uses: actions/setup-python@v4

.github/workflows/check_compatibility.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Check compatibility
22

33
on:
44
pull_request:
5+
merge_group:
6+
types: [checks_requested]
57

68
jobs:
79
check-compatibility:

.github/workflows/codeql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ on:
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [ "develop" ]
20+
merge_group:
21+
types: [checks_requested]
2022
schedule:
2123
- cron: '43 23 * * 2'
2224

bin/_file_formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def config_additional_args(cls) -> None: # noqa: empty-method-without-abstract-
4545
"""Optionally configure additional args to arg parser."""
4646

4747
def process_file(self, file_path: str) -> None:
48-
with open(file_path, "r", encoding="utf-8") as f:
48+
with open(file_path, encoding="utf-8") as f:
4949
file_str = f.read()
5050
try:
5151
formatted_file_str = self.format_str(file_str)

bin/add_transform_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import shutil
77
import subprocess
88
import sys
9+
from copy import deepcopy
910
from pathlib import Path
1011
from typing import Any, Dict
1112

@@ -74,7 +75,7 @@ def replace_aws_partition(partition: str, file_path: str) -> None:
7475
def generate_transform_test_output_files(input_file_path: str, file_basename: str) -> None:
7576
output_file_option = file_basename + ".json"
7677

77-
with open(os.path.join(input_file_path), "r") as f:
78+
with open(os.path.join(input_file_path)) as f:
7879
manifest = yaml_parse(f) # type: ignore[no-untyped-call]
7980

8081
transform_test_output_paths = {
@@ -86,7 +87,8 @@ def generate_transform_test_output_files(input_file_path: str, file_basename: st
8687
for partition, (region, output_path) in transform_test_output_paths.items():
8788
# Set Boto Session Region to guarantee the same hash input as transform tests for API deployment id
8889
ArnGenerator.BOTO_SESSION_REGION_NAME = region
89-
output_fragment = transform(manifest, {}, ManagedPolicyLoader(iam_client))
90+
# Implicit API Plugin may alter input template file, thus passing a copy here.
91+
output_fragment = transform(deepcopy(manifest), {}, ManagedPolicyLoader(iam_client))
9092

9193
if not CLI_OPTIONS.disable_api_configuration and partition != "aws":
9294
output_fragment = add_regional_endpoint_configuration_if_needed(output_fragment)

bin/sam-translate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"--output-template",
4141
help="Location to store resulting CloudFormation template [default: transformed-template.json].",
4242
type=Path,
43-
default=Path("transformed-template.yaml"),
43+
default=Path("transformed-template.json"),
4444
)
4545
parser.add_argument(
4646
"--s3-bucket",
@@ -102,7 +102,7 @@ def package(input_file_path, output_file_path): # type: ignore[no-untyped-def]
102102

103103

104104
def transform_template(input_file_path, output_file_path): # type: ignore[no-untyped-def]
105-
with open(input_file_path, "r") as f:
105+
with open(input_file_path) as f:
106106
sam_template = yaml_parse(f) # type: ignore[no-untyped-call]
107107

108108
try:

integration/combination/test_api_settings.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
import hashlib
2+
from pathlib import Path
23
from unittest.case import skipIf
34

4-
from integration.config.service_names import REST_API
5-
from integration.helpers.resource import current_region_does_not_support
6-
7-
try:
8-
from pathlib import Path
9-
except ImportError:
10-
from pathlib2 import Path
11-
125
from parameterized import parameterized
136

7+
from integration.config.service_names import REST_API
148
from integration.helpers.base_test import BaseTest
9+
from integration.helpers.resource import current_region_does_not_support
1510

1611

1712
@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")

integration/combination/test_api_with_authorizer_apikey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def verify_authorized_request(
8585
status = response.status_code
8686
if status != expected_status_code:
8787
raise StatusCodeError(
88-
"Request to {} failed with status: {}, expected status: {}".format(url, status, expected_status_code)
88+
f"Request to {url} failed with status: {status}, expected status: {expected_status_code}"
8989
)
9090

9191
if not header_key or not header_value:

integration/combination/test_api_with_authorizers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def verify_authorized_request(
444444

445445
if status != expected_status_code:
446446
raise StatusCodeError(
447-
"Request to {} failed with status: {}, expected status: {}".format(url, status, expected_status_code)
447+
f"Request to {url} failed with status: {status}, expected status: {expected_status_code}"
448448
)
449449

450450
if not header_key or not header_value:

0 commit comments

Comments
 (0)