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

Fixed Lambda handler for compiled languages #7129

Merged
merged 16 commits into from
Dec 4, 2021
Merged

Conversation

leo
Copy link
Contributor

@leo leo commented Dec 3, 2021

Interpreted languages deployed to AWS Lambda use the following format for the handler of a Lambda:

<file-name-without-extension>.<method-name>

Compiled languages, on the other hand, use this format:

<file-name>

The latter previously wasn't supported at all, but after this change, it will be.

The logic does not rely on actually knowing whether a compiled or interpreted language is used. Instead, it just checks if the handler exists as-is on the file system, and if it does, it's considered a compiled language. If that's not the case, the first format is assumed and used instead.

After this change, the error shown on the "Errors" tab of this Deployment should disappear.

It works with vercel-plugin-go, vercel-plugin-ruby, and vercel-plugin-python.

Tests

  • The code changed/added as part of this PR has been covered with tests
  • All tests pass locally with yarn test-unit

Code Review

  • This PR has a concise title and thorough description useful to a reviewer
  • Issue from task tracker has a link to this PR

@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #7129 (28ed23f) into main (5f5e50c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #7129   +/-   ##
=======================================
  Coverage   51.49%   51.49%           
=======================================
  Files         128      128           
  Lines        4979     4979           
  Branches     1212     1212           
=======================================
  Hits         2564     2564           
  Misses       2403     2403           
  Partials       12       12           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f5e50c...28ed23f. Read the comment docs.

Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

Looks good but it should add a new test, perhaps for Go, to prove it works correctly

@leo
Copy link
Contributor Author

leo commented Dec 4, 2021

Sounds great — I'll add some tests for all three shortly, once they work in production.

@leo leo merged commit c3ea019 into main Dec 4, 2021
@leo leo deleted the fixed-handler-for-compiled branch December 4, 2021 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants