<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
We've got a few "Set" types written up from before generics. We should
be able to replace them all with just one generic set container now.
This replaces `graph.ResourceSet` (which is only used in pkg) with a
generic set type (github.com/deckarep/golang-set).
The 0.5 release of rapid exposes a generics-based API
instead of `interface{}` and casting everywhere.
This makes for much cleaner usage.
There are a handful of cases where strongly typed generators,
e.g. `Generator[bool]`, need to be turned into `interface{}` (`any`),
which is doable with `AsAny()`.
API changes:
The only non-test changes to the SDK package are in
go/common/resource/testing, which contains testing utiltiies.
Functions that previously returned the old, untyped `Generator`
now return a strongly typed `Generator[T]`.
Add comment + fix tests
We had two problems here.
1. Our graph rapid tests didn't encode the `includeChildren` flag as
transitive, which it should be. Looking at the call sites of
`DependingOn` confirms this.
2. `TestDeleteProtected` was sharing variables between threads (causing
flakey results). This was fixed.
* Implement the --exclude-protected feature
This piggybacks on the same machinery used by the --target flag. By
examining the stack, we find a list of all resources managed by
Pulumi (in that stack). We then form them into a DAG, and mark all
resources as either protected or unprotected.
A resource is protected it has the `Protect` flag set or is has a child
with the `protect` flag set. It is unprotected otherwise.
We then pass the urns of unprotected resources to the update options
passed to the destroy operation in the same way that `--target` does.
* Update changelog
* Handle providers correctly
* Add integration test
* Protect dependencies of protected resources
* Handle --exclude-protected in separate function
* Simplify implementation via DependencyGraph
* Add TransitiveDependenciesOf
* Cleanup unused functions
* Gate printed message behind !jsonDisplay
* Ensure provider is not `""`
* Clean up documentation (and some code)