pulumi/pkg/engine
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
..
lifeycletest Preview of update plans (#8448) 2022-01-31 10:31:51 +00:00
deployment.go Preview of update plans (#8448) 2022-01-31 10:31:51 +00:00
destroy.go Preview of update plans (#8448) 2022-01-31 10:31:51 +00:00
diff.go Bold in-progress diffs diffrently (#7918) 2021-09-28 15:16:09 -07:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
engine.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
errors.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
events.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
eventsink.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
import.go Preview of update plans (#8448) 2022-01-31 10:31:51 +00:00
journal.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
plugin_host.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
plugins.go Pipe serverURL through register resource (#8544) 2021-12-17 14:52:01 -08:00
plugins_test.go Pipe serverURL through register resource (#8544) 2021-12-17 14:52:01 -08:00
project.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
query.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
refresh.go Preview of update plans (#8448) 2022-01-31 10:31:51 +00:00
snapshot.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
update.go Preview of update plans (#8448) 2022-01-31 10:31:51 +00:00
update_test.go Toward replacing MSBuild with make+bash on Windows (#8617) 2022-01-07 22:27:14 -05:00