A number of our integration tests set up sample projects that contain
`package.json` files. These files aren't actually needed to run the
tests, so this commit removes them to clean up the repository a bit.
Co-authored-by: Will Jones <will@sacharissa.co.uk>
It appears that a large number of tests were using references
to main fields which don't currently exist. The runtime didn't
produce an error because package.json was being ignored.
* Fix issue with --target deletion dependant calculation
The code that computed --target deletion dependants was not correct.
It used parent/child component relationships, but did not respect actual
DAG dependencies. As a result, it could erroneously leave hanging
references to resources that no longer exist after performing a
`pulumi destroy --target X` operation. This manifested in bugs like
https://github.com/pulumi/pulumi/issues/6283, which is fixed by this
change. The solution is to compute the (transitive!) dependency graph
correctly, factoring in both parent/child, as well as explicit and
implicit, dependencies. The existing logic does the correct thing once
we do this. I've also added tests for this area, including regression
tests that cover transitive dependency relationships, as well as ones
that would cause an infinite loop given a naive implementation.
* Add a changelog entry
* Fix failing test to include all destroyed targets
Unless I'm missing something, the entire tree should be deleted
in this test case because A is the ancestor for the entire tree.
* Use DependencyGraph to compute dependents
Per code review feedback from @pgavlin.
Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>