-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix: Don't delete stack outputs on failed deployments #15754
Conversation
Changelog[uncommitted] (2024-03-25)Bug Fixes
|
If an update fails, update any stack outputs that were updated, but otherwise leave existing stack outputs as-is. In other words, don't delete stack outputs if the stack didn't successfully run to completion. Implementation note: when we receive a RegisterResourceOutputsEvent for the stack resource, we defer processing it until the end of the deployment, to know whether the deployment ran to completion without errors.
Now that we run `ExecuteRegisterResourceOutputs` for the stack at the end of the deployment, it changes the behavior of snapshot writing, which requires an update to this test. Before, we'd mutate the state for the stack's outputs in the middle of the deployment, causing the state to be saved in the middle of the deployment and then later when the deployment was complete, the stack would be saved again due to `hasElidedWrites` being true. With the change to run `ExecuteRegisterResourceOutputs` at the end of the deployment, we're only saving the state once for this stack. All prior save attempts had `hasElidedWrites` being true, and then a final single save for the stack outputs, meaning there's no need for a second save. Because of this, we now don't have `.json.gz.bak` file to check in this test. To fix, we run `pulumi up` twice, to ensure the `.json.gz.bak` file is available to assert.
5d0a385
to
b1bf40a
Compare
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.
Looks reasonable. I'd say the integration tests should probably be conformance tests. Means no Go coverage to start with but that should be coming online soon I'd hope, and you've already tested with these changes that it does work.
Maybe leave just the Go integration tests if we're feeling cautious.
Happy to try converting this to conformance tests, although, would really like to get this long-standing P1 landed. Would you be comfortable if that was done as a fast follow-up? |
...gelog/pending/20231205--engine--fix-update-stack-outputs-only-on-successful-deployments.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
Tentative changelog: ### Features - [docs] Implement constructor syntax examples for every resource in typescript, python, csharp and go [#15624](#15624) - [engine] Send output values with property dependency information to transform functions [#15637](#15637) - [engine] Add a --continue-on-error flag to pulumi destroy [#15727](#15727) - [sdk/go] Make `property.Map` keyed by `string` not `MapKey` [#15767](#15767) - [sdk/python] Improve the error message when depends_on is passed objects of the wrong type [#15737](#15737) ### Bug Fixes - [auto/{go,nodejs,python}] Make sure to read complete lines before trying to deserialize them as engine events [#15778](#15778) - [cli/plugin] Fix installing local language plugins on Windows [#15715](#15715) - [engine] Don't delete stack outputs on failed deployments [#15754](#15754) - [engine] Fix a panic when updating provider version in a run using --target [#15716](#15716) - [engine] Handle that Assets & Archives can be returned from providers without content. [#15736](#15736) - [engine] Fix the engine trying to delete a protected resource caught in a replace chain [#15776](#15776) - [sdkgen/docs] Add missing newline for `Coming soon!` [#15783](#15783) - [programgen/dotnet] Fix generated code for a list of resources used in resource option DependsOn [#15773](#15773) - [programgen/{dotnet,go}] Fixes emitted code for object expressions assigned to properties of type Any [#15770](#15770) - [sdk/go] Fix lookup of plugin and program dependencies when using Go workspaces [#15743](#15743) - [sdk/nodejs] Export automation.tag.TagMap type [#15774](#15774) - [sdk/python] Wait only for pending outputs in the Python SDK, not all pending asyncio tasks [#15744](#15744) ### Miscellaneous - [sdk/nodejs] Reorganize function serialization tests [#15753](#15753) - [sdk/nodejs] Move mockpackage tests to closure integration tests [#15757](#15757)
Tentative changelog: ### Features - [docs] Implement constructor syntax examples for every resource in typescript, python, csharp and go [#15624](#15624) - [docs] Implement YAML constructor syntax examples in the docs [#15791](#15791) - [engine] Send output values with property dependency information to transform functions [#15637](#15637) - [engine] Add a --continue-on-error flag to pulumi destroy [#15727](#15727) - [sdk/go] Make `property.Map` keyed by `string` not `MapKey` [#15767](#15767) - [sdk/nodejs] Make function serialization work with typescript 4 and 5 [#15761](#15761) - [sdk/python] Improve the error message when depends_on is passed objects of the wrong type [#15737](#15737) ### Bug Fixes - [auto/{go,nodejs,python}] Make sure to read complete lines before trying to deserialize them as engine events [#15778](#15778) - [cli/plugin] Fix installing local language plugins on Windows [#15715](#15715) - [engine] Don't delete stack outputs on failed deployments [#15754](#15754) - [engine] Fix a panic when updating provider version in a run using --target [#15716](#15716) - [engine] Handle that Assets & Archives can be returned from providers without content. [#15736](#15736) - [engine] Fix the engine trying to delete a protected resource caught in a replace chain [#15776](#15776) - [sdkgen/docs] Add missing newline for `Coming soon!` [#15783](#15783) - [programgen/dotnet] Fix generated code for a list of resources used in resource option DependsOn [#15773](#15773) - [programgen/{dotnet,go}] Fixes emitted code for object expressions assigned to properties of type Any [#15770](#15770) - [sdk/go] Fix lookup of plugin and program dependencies when using Go workspaces [#15743](#15743) - [sdk/nodejs] Export automation.tag.TagMap type [#15774](#15774) - [sdk/python] Wait only for pending outputs in the Python SDK, not all pending asyncio tasks [#15744](#15744) ### Miscellaneous - [sdk/nodejs] Reorganize function serialization tests [#15753](#15753) - [sdk/nodejs] Move mockpackage tests to closure integration tests [#15757](#15757)
If an update fails, update any stack outputs that were updated, but otherwise leave existing stack outputs as-is. In other words, don't delete stack outputs if the stack didn't successfully run to completion.
Implementation note: when we receive a RegisterResourceOutputsEvent for the stack resource, we defer processing it until the end of the deployment, to know whether the deployment ran to completion without errors.
Fixes #14621