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

`invoke local` support for Ruby lambdas #5559

Merged
merged 4 commits into from Dec 5, 2018

Conversation

Projects
None yet
3 participants
@dholdren
Copy link
Contributor

dholdren commented Dec 4, 2018

What did you implement:

Adds Ruby lambda support for invoke local
Closes #5545

How did you implement it:

I followed the pattern for calling Python lambda's via invoke local

How can we verify it:

mkdir aws-ruby-example
cd aws-ruby-example
serverless create --template aws-ruby
serverless invoke local -f hello

Here's my result, using a local checkout of this branch:

➜  aws-ruby-example ~/work/serverless/bin/serverless invoke local -f hello
{"statusCode":200,"body":"\"Go Serverless v1.0! Your function executed successfully!\""}

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

@dholdren dholdren force-pushed the dholdren:ruby_invokeLocal branch 2 times, most recently from 5e144d5 to 28f7e9b Dec 4, 2018

@dholdren dholdren force-pushed the dholdren:ruby_invokeLocal branch from 28f7e9b to d147db9 Dec 4, 2018

@dschep
Copy link
Member

dschep left a comment

Thanks @dholdren Awesome work!! LGTM, but I'm gonna get a review from @shortjared too before merging since I don't really know Ruby.

@dschep dschep requested a review from shortjared Dec 4, 2018

Show resolved Hide resolved lib/plugins/aws/invokeLocal/invoke.rb Outdated
Show resolved Hide resolved lib/plugins/aws/invokeLocal/invoke.rb Outdated
Show resolved Hide resolved lib/plugins/aws/invokeLocal/invoke.rb Outdated
Show resolved Hide resolved lib/plugins/aws/invokeLocal/invoke.rb Outdated
@dschep

This comment has been minimized.

Copy link
Member

dschep commented Dec 4, 2018

Thanks for the review @rupakg!

@dholdren dholdren force-pushed the dholdren:ruby_invokeLocal branch from 4cb9a45 to f8d23fc Dec 4, 2018

@dholdren

This comment has been minimized.

Copy link
Contributor

dholdren commented Dec 4, 2018

since AWS supports both a top-level method via filebasename.foo or a class method filebasename.MyMod::MyClass.foo (https://docs.aws.amazon.com/lambda/latest/dg/ruby-handler.html) I just added support for both.

@rupakg I think I also addressed your other concerns

@dholdren dholdren force-pushed the dholdren:ruby_invokeLocal branch from f8d23fc to 99c4256 Dec 4, 2018

@dschep

dschep approved these changes Dec 5, 2018

@dschep dschep merged commit a493ce0 into serverless:master Dec 5, 2018

1 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dschep dschep referenced this pull request Dec 12, 2018

Merged

v1.35.0 release! #5592

end

def memory_limit_in_mb
return '1024'

This comment has been minimized.

@rupakg

rupakg Dec 15, 2018

Contributor

@dholdren minor nitpick - remove the unnecessary return from following 4 methods.

@rupakg

This comment has been minimized.

Copy link
Contributor

rupakg commented Dec 15, 2018

Awesome work @dholdren Thanks for getting invoke local Ruby integrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment