Merge main to develop#3928
Conversation
Release 1.110.0 (to main)
aws-sam-cli-bot
left a comment
There was a problem hiding this comment.
Code Review Results
Reviewed: 4f81f22..48ad584
Files: 7
Comments: 2
Comments on lines outside the diff:
[samtranslator/model/api/api_generator.py:1592] [BUG] This back-merge silently removes the sam_expect(domain_access_association, self.logical_id, "Domain.AccessAssociation").to_be_a_map() guard that was added on develop, and also deletes the corresponding test fixtures (tests/translator/input/error_api_domain_access_association_not_dict.yaml and tests/translator/output/error_api_domain_access_association_not_dict.json).
Without this validation, when a user supplies a non-map value for Domain.AccessAssociation (for example a bare VPCE id string, as in the deleted test input), the very next line — domain_access_association.get("VpcEndpointId") — will raise AttributeError: 'str' object has no attribute 'get'. CloudFormation surfaces that as the opaque "Internal transform failure" message, which was the exact regression the deleted code (and its inline comment) was put in place to prevent.
If the intent of the back-merge from main is to reset develop to the released 1.110.0 state, please confirm this regression is acceptable; otherwise the validation and its test fixtures should be re-applied on top of the merge so the user-facing error message is preserved and the regression test stays in place.
[samtranslator/swagger/swagger.py:478] [BUG] The same back-merge removes the dict-type guard from add_authorizers_security_definitions:
if not isinstance(self.security_definitions, dict):
raise InvalidTemplateException("securityDefinitions must be a dictionary.")and deletes its tests (tests/translator/input/error_api_securitydefinitions_not_dict.yaml / tests/translator/output/error_api_securitydefinitions_not_dict.json).
After this change, if a user's DefinitionBody supplies securityDefinitions as a YAML list rather than a map (which is valid YAML but invalid per the Swagger 2.0 spec), the loop body that follows — self.security_definitions[authorizer_name] = authorizer.generate_swagger() — will raise TypeError: list indices must be integers or slices, not str (or Py27UniStr), again surfaced by CloudFormation as "Internal transform failure" with no actionable detail.
Please confirm this is an intentional reset to the 1.110.0 release surface; if not, restore the isinstance check and its test cases so user templates with malformed securityDefinitions continue to fail with a clear InvalidTemplateException.
This PR & commit is automatically created by aws-sam-cli-bot for SamTranslator@1.110.0 release.