Gen2 migrations - support node 20 and 22 in functions#14140
Gen2 migrations - support node 20 and 22 in functions#14140abhi7cr merged 3 commits intomigrationsfrom
Conversation
| assert.match(source, /name: /); | ||
| }); | ||
| it('does render runtime property', () => { | ||
| test.each([[Runtime.nodejs16x], [Runtime.nodejs18x], [Runtime.nodejs20x], [Runtime.nodejs22x]])( |
There was a problem hiding this comment.
Thinking out loud, could we also pass the expectedRuntime of 16, 18, 20, 22 along with this and use it directly instead of parsing like const expectedRuntime = nodejsRuntime.split('nodejs')[1].split('.')[0]; What do you think?
There was a problem hiding this comment.
Good callout! The main reasoning for doing it this way in the test was to make sure we are deriving the expected version from the runtime string itself (as a source of truth). In this way, we can catch any regressions if we change the mapping in the actual switch case. Otherwise, we would need to maintain additional mapping in the test file, which could be prone to errors. Let me know what you think !
There was a problem hiding this comment.
Hmm, using the Runtime enum string from the lambda sdk as a source of truth. Yes, that makes sense.
Description of changes
add node 20 and 22 version support for functions.
Description of how you validated changes
unit tests
Checklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.