pulumi/sdk/go/common
Fraser Waters 40eee5868e
Preview of update plans (#8448)
* Implement resource plans in the engine

* Plumb plans through the CLI.

* Update wording

* plan renderer

* constraints

* Renames

* Update message

* fixes for rebase breaks and diffs

* WIP: outputs in plans

* fix diff

* fixup

* Liniting and test fixing

* Test and fix PropertyPath.String()

* Fix colors

* Fix cmdutil.PrintTable to handle non-simple strings

* More tests

* Readd test_plan.go

* lint

* Test expected deletes

* Test expected delete

* Test missing create

* Fix test for missing creates

* rm Paths()

* property set shrink test

* notes

* More tests

* Pop op before constraint check

* Delete plan cmd, rename arguments to preview and up

* Hide behind envvars

* typo

* Better constraint diffs

* Adds/Deletes/Updates

* Fix aliased

* Check more constraints

* fix test

* revert stack changes

* Resource sames test

* Fix same resource test

* Fix more tests

* linting

* Update pkg/cmd/pulumi/up.go

Co-authored-by: Alex Mullans <a.mullans@pulumi.com>

* Update pkg/cmd/pulumi/preview.go

Co-authored-by: Alex Mullans <a.mullans@pulumi.com>

* Auto refresh if using plans

* Fix TestGetRefreshOption

* Fix TestExplicitDeleteBeforeReplace

* lint

* More copying in tests because I do not trust myself to get mutation correct

* Small preview plan test

* Add TestPlannedUpdateChangedStack

* Revert auto-refresh changes

* Validate outputs don't change

* omitempty

* Add manifest to plan

* Add proper Plan type

* wip config work

* Config and manifest serder

* linting

* Asset NoError

* Actually check error

* Fix clone

* Test diag message

* Start on more tests

* Add String and GoString to Result

I got fed up assert errors in tests that looked like:
```
Expected nil, but got: &result.simpleResult{err:(*errors.fundamental)(0xc0002fa5d0)}
```

It was very hard to work out at a glance what had gone wrong and I kept
having to hook a debugger just to look at what the error was.

With GoString these now print something like:
```
Expected nil, but got: &simpleResult{err: Unexpected diag message: <{%reset%}>resource violates plan: properties changed: -zed, -baz, -foo<{%reset%}>
}
```

Which is much more ussful.

* Add test error text

* Fix reporting of unseen op errors

* Fix unneeded deletes

* Fix unexpected deletes

* Fix up tests

* Fix merge conflict

* lint

* Fix nil map error

* Fix serialisation typo

* Diff against old inputs

* Diff against checked goal

* Diff against empty for creates

* Fix test

* inputs not outputs

* Seperate PlanDiff type

* Add properties

* Fix input diffs

* Handle creates

* lint

* Add plan message

* Clone plan for update preview

* Save and serialise env vars in plans

* lint

* pretty print json

* input output difference test

* test alias

* fix typo in for loop

* Handle resource plans with nil goal

* go mod tidy

* typo

* Auto use plans from up previews in experimental mode

* Don't preview if we have plan

* Don't run previews with plans now

* fixing tests

* Handle diffs and goals

* Update copystructure

* tests/go.sum

* Revert mod changes

* Add copystructure to tests/go.sum

* includeUnknowns

* go mod tidy

* Make plans for imports

* Remove unused function

* Move code more locally

* Handle nil in serialize

* Handle empty output diffs

* Add test for dropping computed values

* Allow computed properties to become deletes

* if out the generation of plans unless experimental mode is opt'd into

* lint

* typo

* Revert back to plans not skipping previews, this is orthognal to --skip-preview

* Trying to work out non-determinism

* Remove notes.txt

* Hacking with check idea

* Pass checked inputs back to Check from plan file

* Include resource urn in constraint error

* Give much more informative errors when plans fail

* lint

* Update expected diag strings in tests

* Remove unused code

* Duplicate Diff and DeepEquals methods for plans

* Add comment about check ops with failures

* Fix CheckedInputs comment

* OutputDiff doesn't need to be a pointer

* Fix checks against computed

* diffStringSets

* lint

* lint pkg

* Use 4 space indent

* Don't wrap Buffer in Writer

* Mark flags hidden rather than disabled

* Remove envvars from plans

* Assert MarkHidden error

* Add to changelog

* Note plan/save-plan is experimental

Co-authored-by: Pat Gavlin <pat@pulumi.com>
Co-authored-by: Alex Mullans <a.mullans@pulumi.com>
2022-01-31 10:31:51 +00:00
..
apitype Preview of update plans (#8448) 2022-01-31 10:31:51 +00:00
constant expose execution kind via update metadata (#5258) 2020-08-31 09:07:59 -07:00
diag Allow disabling default providers (#8829) 2022-01-26 18:08:36 +01:00
encoding Improve error message and add test for #1440 (#8268) 2021-10-26 16:55:52 +01:00
resource Preview of update plans (#8448) 2022-01-31 10:31:51 +00:00
testing Toward replacing MSBuild with make+bash on Windows (#8617) 2022-01-07 22:27:14 -05:00
tokens Make PackageName just a QName (#8807) 2022-01-21 19:23:14 +00:00
tools Toward replacing MSBuild with make+bash on Windows (#8617) 2022-01-07 22:27:14 -05:00
util Toward replacing MSBuild with make+bash on Windows (#8617) 2022-01-07 22:27:14 -05:00
version move pkg/version -> sdk/go/common/version 2020-03-18 15:25:25 -07:00
workspace Add support for overriding plugin download URLs (#8798) 2022-01-21 09:04:10 -08:00