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
Enable execution of SAM from existing template #314
Conversation
Codecov Report
@@ Coverage Diff @@
## master #314 +/- ##
============================================
- Coverage 48.77% 42.62% -6.15%
- Complexity 254 277 +23
============================================
Files 92 94 +2
Lines 2282 2442 +160
Branches 295 332 +37
============================================
- Hits 1113 1041 -72
- Misses 1072 1284 +212
- Partials 97 117 +20
Continue to review full report at Codecov.
|
val element = context.psiLocation ?: return false | ||
val parent = element.parent |
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.
Why does setup require the parent, yet isConfigfromContext doesnt?
Are the contexts not equal?
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.
good catch - added a test and fixed the logic.
val keyValue = element as? YAMLKeyValue ?: return null | ||
val value = keyValue.value as? YAMLMapping ?: return null | ||
val type = value.getKeyValueByKey("Type")?.valueText ?: return null | ||
if (type != FUNCTION_TYPE) { |
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.
Should we support AWS::Lambda::Function too, since that can also be used inside a SAM template?
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.
yes - #318
} | ||
|
||
private void updateComponents() { | ||
|
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.
extra line
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.
fixed
|
||
private void updateFunctionModel(List<SamFunction> functions) { | ||
functionModels.removeAllElements(); | ||
if (functions.size() == 0) { |
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.
functions.setEnabled(!functions.isEmpty())
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.
fixed
@@ -0,0 +1,15 @@ | |||
AWSTemplateFormatVersion: '2010-09-09' |
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.
What test uses this?
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.
nothing it's just the dummy file that i often use as a manual test project
49840b3
to
ce88cdd
Compare
ce88cdd
to
fb2c905
Compare
fb2c905
to
bbc1bf7
Compare
Types of changes
Description
Current SAM workflows generate a dummy template on the fly, this feature enables the use of an existing template from within the project.
One can also create run configurations from the YAML template directly.
Motivation and Context
Best practice is to define functions as part of an infrastructure template - this enables debugging locally from such a template.
Related Issue(s)
#261
Testing
New tests added.
Screenshots (if appropriate)
Checklist
gradlew check
succeedsLicense
I confirm that my contribution is made under the terms of the Apache 2.0 license.