Repository navigation
Resolve profile before performing aws-sdk dependent actions - #5744
Conversation
1374dd0 to
318296e
Compare
| _.assign({ name: 'stage' }, provider.getStageSourceValue()), | ||
| _.assign({ name: 'profile' }, { | ||
| value: this.service.provider.profile, | ||
| path: 'serverless.service.provider.profile' |
There was a problem hiding this comment.
And test will be green!
| path: 'serverless.service.provider.profile' | |
| path: 'serverless.service.provider.profile', |
There was a problem hiding this comment.
Looks good from a code perspective 👍
I read through the comments re: breaking changes, but it looks like this is just an addition, so we should be fine here.
I'm not sure how important this PR is. We could merge it right away but I'd love to have a unit test covering this (won't "Request changes") to not block here...
(Or is this already covered by a test 🤔...)
|
Agreed, the switch to be additive rather than replacing avoidsthis being a breaking change except in extreme circumstances that I think we accept. Agreed there's a need for tests. Something like a variable resolving to a valid value then being used by an SSM, S3, whatever variable which will fail but we can catch that expected failure and ensure the profile resolved properly. |
|
Otherwise, this is a really nice change. Lifting the limitation on profile is super useful and increases the consistency for users. Great work @dschep! |
|
Note, the test coverage switches from setting the option to setting the config. AFAIK variables in options aren't actually a supported (or documented) feature of sls (and was explicitly not implemented for this profile change) |
What did you implement:
closes #4311
closes #4725
How did you implement it:
AwsProviderto check theaws-profileoption instead ofprofilesince that's what's actually implemented(afaik).getProfileSourceValuereturn value to be more like that of thegetStageSourceValueandgetRegionSourceValueHow can we verify it:
set
profileto a variable and try tosls printwith stable install and then again with this branchTodos:
Write documentationIs this ready for review?: YES
Is it a breaking change?: NO