Repository navigation
Persist self references with "${self:}" and restore it correctly - #3527
Conversation
c9efe32 to
33a93e7
Compare
|
@erikerikson The pure implementation is finished. Can you verify that it works as expected? |
|
@gwsii can look into this |
|
PR finalized |
pmuens
left a comment
There was a problem hiding this comment.
Thank you very much for the fix @HyperBrain 🥇
Just tested it with the following config:
service: self-reference
provider:
name: aws
runtime: nodejs4.3
custom:
newService: ${self:}
exportName: ${self:custom.newService.service}-export
functions:
hello:
handler: handler.hello
resources:
Outputs:
selfExport:
Value: 'A Value To Export'
Export:
Name: ${self:custom.exportName}
OptExport:
Value: 'Exported option variable'
Export:
Name: ${opt:}
EnvExport:
Value: 'Exported env variable'
Export:
Name: ${env:}I ran serverless package and serverless package --foo bar and looked into the compiled template which is written to disk.
Works on my machine. Therefore --> LGTM ![]()
|
@HyperBrain ❤️ ❤️ ❤️ ❤️ |
|
@pmuens @HyperBrain @erikerikson I just published a patch release (v1.12.1) that includes this fix. @erikerikson please confirm that everything is now ok on your end 😊 |
|
Confirmed! Thank you @HyperBrain @eahefnawy @pmuens!!! You guys rock! 🎸 |
|
Thanks for confirming and the warm words @erikerikson 💯 Good to see that it's working again! |
What did you implement:
This is work-in-progress!
Closes #3509
Self references created with
${self:}are now persisted as${self:}and will be restored properly on state restoration.How did you implement it:
In
saveServiceState()a deep search for self references is done now (the FQ property paths are extracted) and all refs are replaced with "${self:}".How can we verify it:
Create a service that contains
Run a package and then a deploy.
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO