Skip to content

Vendor the load function from the Lambda runtime #238

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

Merged
merged 4 commits into from
Oct 20, 2021
Merged

Conversation

nhinsch
Copy link
Contributor

@nhinsch nhinsch commented Oct 19, 2021

What does this PR do?

Copy the load function (and its supporting code) from the Lambda runtime directly into our library.

Motivation

We rely on the load function to load the customer's Lambda function from within our wrapper function. Unfortunately it's not safe to import this function directly from the Lambda runtime, as it is not necessarily stable. In order to avoid introducing a breaking change and to ensure all edge cases are handled correctly, I copied the code directly from the runtime.

Testing Guidelines

Integration tests show that the code is still loaded correctly.

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2021

Codecov Report

Merging #238 (73d6ddc) into main (4738b4a) will decrease coverage by 5.33%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
- Coverage   86.91%   81.57%   -5.34%     
==========================================
  Files          32       35       +3     
  Lines        1253     1335      +82     
  Branches      266      283      +17     
==========================================
  Hits         1089     1089              
- Misses         96      178      +82     
  Partials       68       68              
Impacted Files Coverage Δ
src/handler.ts 0.00% <0.00%> (ø)
src/runtime/errors.ts 0.00% <0.00%> (ø)
src/runtime/index.ts 0.00% <0.00%> (ø)
src/runtime/user-function.ts 0.00% <0.00%> (ø)

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 4738b4a...73d6ddc. Read the comment docs.

@nhinsch nhinsch marked this pull request as ready for review October 19, 2021 21:42
@nhinsch nhinsch requested a review from a team as a code owner October 19, 2021 21:42
Copy link
Contributor

@DarcyRaynerDD DarcyRaynerDD left a comment

Choose a reason for hiding this comment

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

LGTM, but let's make sure the AWS runtime repo is in the 3rd-party license file as well.

@nhinsch nhinsch merged commit 8dfb457 into main Oct 20, 2021
@nhinsch nhinsch deleted the ngh/vendor-load branch October 20, 2021 19:02
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.

3 participants