fix lambda layer version compatibility with Python 3.11#9020
Conversation
joe4dev
left a comment
There was a problem hiding this comment.
Nice fix, refactoring, and clarifying comments 👍
nit: Adding a comment pointing to the IMAGE_MAPPING (and/or vice-versa) would help to catch this update chore the next time.
I agree that adding new runtimes is currently too much brittle error-prone manual work. Moving forward, the best solution would be to pick up specification-based validations again as suggested by Thomas a while back: #7675 (comment)
Thank you for adding the validated test @alexrashed 🚀
|
Thanks, @joe4dev for the review and the feedback! I added comments to both ( |
joe4dev
left a comment
There was a problem hiding this comment.
Great idea with the unit test 👍
LGTM 🚀
(agree that splitting these variables across api_utils and lambda_models is not the best idea)

Motivation
This PR fixes an issue where Lambda layer compatibility check failed for the
python3.11runtime:Changes
This PR adds
python3.11to the list of supported runtimes for Lambda layer validation.Testing
A snapshot verified test creating a Lambda layer with all possible validations.
However, this test does not save us from the same mistake happening again, because it uses the list of
RUNTIMESwhich is used by the validation.Initially, I wanted to use the keys of the
IMAGE_MAPPINGdict (which is described as the dict where newly supported runtimes should be added), but this mapping is contained inlambda_models(even though I think it's not a model).We could move this mapping from there and directly use it for the runtime validation, then this issue could not happen in the future again. Happy for any feedback!