* 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>
Add a new `IsOverlay` option to schema types and functions that allows providers to document overlays in the schema. This makes it easier to generate API docs consistently, even for code that is generated outside of the typical codegen process.
* Improve corrupt workspace settings experience
This improvement comes in two parts.
1. The error message for a corrupt workspace settings file now clearly
indicates both the file and the parsing error.
2. Writing the workspace settings is now atomic. This prevents
corruption from multiple concurrent calls.
* Use builtin atomic write
* Use builtin ioutil.TempFile
* Change tmp file dir
* Run make ensure on devcontainer creation
Added an ensure target to the dotnet makefile to run `dotnet restore`.
* Add dotnet test explorer and set default vscode settings for it
* Ensure PULUMI_LOCAL_NUGET exists
* Add missing mkdirs
* Use the display name from the schema, if available
* Update comment on the titleLookup map
* Add examples of reserved labels that can be used with the Keywords array in the schema
* Validate python version
Note: we do this at the language plugin level because extremely old
version of python (python2) have different syntax, and we don't want
parse errors to occlude our version message. Similarly, if we rely on a
3.7 feature during an import, we will have the same problem.
* Set minimum python version to 3.7.0
* Fix displayed recommended version
* Toward doc gen of fn.Output version signatures
* Fixup Python docgen, and reorder forms so the direct form comes firs
* Respect go opt-out flag
* Fix tempalte bug with unbalanced HTML tags
* Edit CHANGELOG_PENDING.md
* Merge codeblocks in the function template
* Accept docs changes
Something has changed in the base image such that the directory
/etc/sudoers.d doesn't exist. Simple fix, `mkdir -p` that directory
before we write to it.
When importing a resource in Go, we change resource names with hyphens to snake_case. This happens because we introduced a change that converts the resource name to a valid Go identifier so it can be used as a local variable. But we were also using this converted name as the string resource name, which causes problems with import: the imported resource in the state file has the original resource name, but the generated program uses the converted name, causing Pulumi to delete and recreate the resource when adopting the generated import code.
This change fixes the issue by maintaining the original resource name, and only using the converted name for variables.
Fixes two bugs in how padding was calculated in PrintTable.
Firstly we remove all ANSI escape codes from the string before measuring
how wide it is. Secondly we measure glyph count (using rivo/uniseg) not
byte or rune count of the string.
Together these fix the padding/alignment issues I saw when using
PrintTable with plan output. They also slightly change the layout of
"pulumi stack", for example the below is printed with current master and
has 6 characters of space for padding between SecurityGroup and
web-secgrp:
```
Current stack resources (4):
TYPE NAME
pulumi:pulumi:Stack aws-cs-webserver-test
├─ aws:ec2/securityGroup:SecurityGroup web-secgrp
├─ aws:ec2/instance:Instance web-server-www
└─ pulumi:providers:aws default_4_25_0
```
While printed with this commit you only get 2 characters of space for
padding (which is correct, the column gap is set to " "):
```
Current stack resources (4):
TYPE NAME
pulumi:pulumi:Stack aws-cs-webserver-test
├─ aws:ec2/securityGroup:SecurityGroup web-secgrp
├─ aws:ec2/instance:Instance web-server-www
└─ pulumi:providers:aws default_4_25_0
```