-
Notifications
You must be signed in to change notification settings - Fork 469
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
Add DebugConfigurationProvider for debugging lambdas locally. #144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM so far, some minor questions and nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes look good up to this point. The build is failing though.
I'll wait to approve in case further code revisions are required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like some additional tests are coming to this PR. Not quite approved just yet then...
Codecov Report
@@ Coverage Diff @@
## develop #144 +/- ##
==========================================
+ Coverage 44.66% 48.17% +3.5%
==========================================
Files 49 51 +2
Lines 1359 1476 +117
Branches 189 214 +25
==========================================
+ Hits 607 711 +104
- Misses 752 765 +13
Continue to review full report at Codecov.
|
Types of changes
Description
Introduce a
DebugConfigurationProvider
that provides configurations for the built-in NodeJS debugger.template.y[a]ml
, provide two configurations: Onelaunch
to invoke the function using SAM local and attach to the container, and oneattach
configuration to attach to an existing container.launch
configuration, add a corresponding "Debug ______ Locally" task, and invoke that task as apreLaunchTask
from thelaunch
configuration.Known issues:
NodeDebugConfigurationProvider
, I will update the PR with these tests tomorrow.template.y[a]ml
are detected (@awschristou is working in parallel on detect-from-source). Once Utility class to detect Typescript functions that can possibly be used as Lambda Function Handlers. #142 is merged, I will integrate detection-from-source.Motivation and Context
VS Code users configure their debugger using the file
launch.json
. When the user first createslaunch.json
we provide default configurations for each of the user's local lambda functions. Additionally, when the user decides to add another configuration, VS Code presents a list of presets that includes our configurations (among others).The simplest end-to-end workflows are:
If the user has not previously set up their debug configurations.
sam init
, or bring your own. Open the root folder of the app in VS Code.If the user has already set up some debug configurations.
Lambda: Invoke MyFunction locally
.Related Issue(s)
#134.
Testing
Testing is currently (Oct 28) incomplete. This PR should not be merged until it is complete.
Screenshots (if appropriate)
Checklist
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.