Add a "PromiseTracker" to the Variables class. It provides tracking and reporting of pending variable resolutions during service populations.
Decompose populateObject and populateProperty into smaller pieces that are easier to understand.
Additionally, remove the immediate recursive resolution of variables, recursing only at the Object or Property entry point (when changes have been made). This avoids a problem where the resolved value, prior to being replaced in the containing object or value refers to itself and thereby is waiting on its own resolution before it will resolve itself.
Return the given value in warnIfNotFound so that it can chain.
Delete bucket was still using them
Hopefully all :)
Further test fixes.
.... worked too long yesterday
Fixed Variable tests
Remove not used parameters from request() and add options with warning
1. add tests that validate string value defaults in overrides.
2. add test of behavior when a javascript's export does not contain the attribute declared in the variable.
3. add tests of behavior when an SSM parameter is not found and the request to the SSM service fails.
add returns to tests that weren't returning their promises (and were thereby risking false positives.
Increase name consistency
Improve names to be-what-they-are
Reduce cyclomatic complexity
Include overrides population fix
Add variable methods documentation
Add more tests around significant variable patterns/risky cases
Make sure that requests are throttled. Use a queue for the requests.
Added new expected parameter to request() call in variables test
Added request cache tests
Check that request is indeed called 1000 times
Cache promises, not values
Use request cache for AWS variable requests
Use fromCallback instead of "new Promise" anti-pattern.
Added request cache to AWS provider
Check for the expected error message in the case the SSM parameter
does not exist and return `undefined`. Any other (unexpected) error
message still throws an exception.
When we define a cf variable in serverless.yml and that variable wasn't output from the Cloudformation Outputs
a useless error was throw:
> Cannot read property 'OutputValue' of undefined
Now the error give more information:
> Trying to request a non variable from Cloudformation.
> Stack name: "some-stack" Requested variable: "DoestNotExist"