Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for nodejs22.x runtime #1837

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Conversation

bchew
Copy link
Contributor

@bchew bchew commented Nov 25, 2024

Description

Add support for Node.js 22 runtime

Motivation and Context

AWS Lambda now supports Node.js 22:

Related PR in Serverless Framework: serverless/serverless#12916

How Has This Been Tested?

Screenshots (if appropriate):

@throrin19
Copy link

It is possible to made it for serverless-offline 13 and 14 ? Not only serverless-offline 14 ?

@alexw23
Copy link

alexw23 commented Nov 26, 2024

Currently a blocker for us, looking forward to the patch.

@bchew
Copy link
Contributor Author

bchew commented Nov 26, 2024

It is possible to made it for serverless-offline 13 and 14 ? Not only serverless-offline 14 ?

Correct me if I'm wrong but serverless framework v3 does not support node 22 currently (serverless/serverless#12922), and serverless-offline 13 has a peer dep of serverless v3

@throrin19
Copy link

@bchew No worries with version 3 of serverless: I've been able to publish my lambdas in node22.x on AWS but I can't manage it locally with serverless-offline.

@alexw23
Copy link

alexw23 commented Nov 27, 2024

@throrin19 I wasn't game enough to push without testing yet, so got stuck at not being able to launch locally.

Edit: actually, looking again it wasn't a failure, just a warning (on 13.3.4):

Warning: Invalid configuration encountered
  at 'provider.runtime': must be equal to one of the allowed values [dotnet6, go1.x, java17, java11, java8, java8.al2, nodejs14.x, nodejs16.x, nodejs18.x, nodejs20.x, provided, provided.al2, provided.al2023, python3.7, python3.8, python3.9, python3.10, python3.11, ruby2.7, ruby3.2]

@throrin19
Copy link

throrin19 commented Nov 27, 2024

@alexw23 I understand, I revert the runtime until it is ready here.

After test yes the message is a warning but the offline lambda is not executed

@bchew
Copy link
Contributor Author

bchew commented Nov 27, 2024

Created a PR to v13 branch: #1838

@DorianMazur
Copy link
Collaborator

Amazing work, thanks!

@bchew
Copy link
Contributor Author

bchew commented Dec 3, 2024

@DorianMazur seems like all the tests are failing due to serverless v4 enforcing logins:

✖ Error: You must sign in or use a license key with Serverless Framework V.4 and later versions. Please use "serverless login".
    at Authentication.getAuthenticatedData (file:///home/runner/.serverless/releases/4.4.13/package/dist/sf-core.js:686:10535)
    at async Authentication.resolverAuthenticate (file:///home/runner/.serverless/releases/4.4.13/package/dist/sf-core.js:688:20566)
    at async _Meta.authenticate (file:///home/runner/.serverless/releases/4.4.13/package/dist/sf-core.js:696:12102)
    at async _Meta.authenticateAndResolve (file:///home/runner/.serverless/releases/4.4.13/package/dist/sf-core.js:696:11523)
    at async route (file:///home/runner/.serverless/releases/4.4.13/package/dist/sf-core.js:1010:14685)
    at async Object.run2 [as run] (file:///home/runner/.serverless/releases/4.4.13/package/dist/sf-core.js:1010:15173)
    at async run3 (file:///home/runner/.serverless/releases/4.4.13/package/dist/sf-core.js:1010:16435)

I assume a login is required to set access keys for GitHub Actions CI? #1835 has also the same failures in tests

@DorianMazur
Copy link
Collaborator

Yes, I am waiting for @dherault to respond. We need to find a way to run tests. They are failing because GitHub Secrets are not accessible in PR forks.

@dherault
Copy link
Owner

dherault commented Dec 3, 2024

@DorianMazur What should I do?

@DorianMazur
Copy link
Collaborator

DorianMazur commented Dec 3, 2024

@dherault I messaged you elsewhere, but I'll copy it here:

image

If I understand it correctly, then we can enable "Send secrets to workflows from fork pull requests". The SERVERLESS_ACCESS_KEY isn’t a highly sensitive secret. I just created a free account on Serverless and generated this auth key, so there’s nothing to worry about. We can also configure it to always require approval for workflows on PRs- "Require approval for all outside collaborators".

image

@dherault
Copy link
Owner

dherault commented Dec 3, 2024

I cannot seem to find this option, like it says it's only available to private repos.
image

The other one is already set.

@DorianMazur
Copy link
Collaborator

Okay @dherault
I have a better and safer idea. Please check out> #1840

@alexw23
Copy link

alexw23 commented Dec 3, 2024

Is it not possible to just add the ACCESS_KEY to your forked repo for now? At least then we can get this PR through?

@DorianMazur DorianMazur merged commit 1b21934 into dherault:master Dec 4, 2024
8 of 9 checks passed
@edwinparejas
Copy link

edwinparejas commented Dec 5, 2024

The current version of serverless-offline 14.3.4 does not have support for nodejs22.x. When will you release a new version that supports nodejs22.x?

@DorianMazur
Copy link
Collaborator

@edwinparejas Yes, this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants