Repository navigation
Variables: Expose variable resolver function to variable source resolvers - #9368
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9368 +/- ##
=======================================
Coverage 86.96% 86.97%
=======================================
Files 317 317
Lines 11855 11865 +10
=======================================
+ Hits 10310 10319 +9
- Misses 1545 1546 +1
Continue to review full report at Codecov.
|
pgrzesik
reviewed
Apr 27, 2021
pgrzesik
left a comment
Contributor
There was a problem hiding this comment.
Looks great, I only have two minor comments
| - `env:SOME_ENV_VAR, null` (end with `, null`, if missing value at the variable source should be resolved with `null`, and not with a thrown error) | ||
|
|
||
| Example, of how to obtain a value of AWS region that will be used by Serverless Framework: | ||
| Example on how to obtain some Serverless Framework configuratioon values: |
| resolveVariable: async (variableString) => { | ||
| variableString = `\${${ensureString(variableString, { | ||
| Error: ServerlessError, | ||
| name: 'variableString', |
Contributor
There was a problem hiding this comment.
Let's add code to ServerlessError via errorCode
Contributor
Author
There was a problem hiding this comment.
Good point, addressed 👍
medikoo
force-pushed
the
0420-access-source-resolvers-in-file-resolvers
branch
from
April 27, 2021 10:36
3e07f3b to
b560b45
Compare
pgrzesik
approved these changes
Apr 27, 2021
pgrzesik
left a comment
Contributor
There was a problem hiding this comment.
Looks great, well done 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #9112
After all, instead of introducing
resolveSource(name, { params, address }), I decided to introduceresolveVariable(variableString)as that feels way more convenient, and I believe more simple to use (it's also a bit more powerful, as supports fallback sources in same manner as when variables are configured into properties).