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

Don't package non-node functions (fix for #644) #663

Merged
merged 2 commits into from
Feb 3, 2021

Conversation

jgrantr
Copy link

@jgrantr jgrantr commented Dec 3, 2020

What did you implement:

Most of serverless-webpack already deals with not packaging non-node functions. There is only one section that is still problematic. This fix deals with the issue where a runtime may be defined for an individual function or for a provider. It will default to a runtime of "nodejs" if no runtime is specified at either the function or provider level.

Closes #644

How did you implement it:

When processing the async config, implemented an extra step before mapping the functions to filter out functions that don't have a node runtime.

How can we verify it:

Add a function (in my case it was a Rust function) that uses a non-node runtime and the app should still package correctly.

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@j0k3r
Copy link
Member

j0k3r commented Feb 1, 2021

Could you rebase against the master? Thanks!

@j0k3r
Copy link
Member

j0k3r commented Feb 1, 2021

Also, could you add some tests to cover your changes?

Copy link
Member

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test to cover that update? Thanks 🙏

lib/validate.js Show resolved Hide resolved
@j0k3r j0k3r added this to the 5.4.0 milestone Feb 2, 2021
@jgrantr
Copy link
Author

jgrantr commented Feb 2, 2021

Could you add a test to cover that update? Thanks 🙏

Yes, I've been looking at the unit tests to figure out where to put it and what to check (as I would have expected the existing unit tests to fail, but they aren't). I think I've got that figured out, so I will try and get that in today.

@jgrantr
Copy link
Author

jgrantr commented Feb 2, 2021

Ok, I added a new function to the testFunctionsConfig. Without my fix in there, I get five failures. With my fix, all the tests pass.
Screen Shot 2021-02-02 at 2 46 03 PM

Copy link
Member

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

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.

Error with multiple runtimes
2 participants