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
```
* Add a test demonstrating the problem
* Fix the bug
* Accept changes over the example set
* Accept go changes
* Accept python codegen; avoid nil lang info panic
* Accept .NET changes, compile
* Accept docs changes
* Add changelog notes
* Fix lint
* Add parens sparingly
* Flatten unions
* PR feedback
The Pulumi Package metaschema is a JSON schema definition that describes
the format of a Pulumi Package schema. The metaschema can be used to
validate certain basic properties of a Pulumi Package schema, including
(but not limited to):
- data types (e.g. is this property a string?)
- data formats (e.g. is this string property a valid regex?)
- object shapes (e.g. is this object missing required properties?)
The schema binder has been updated to use the metaschema as its first
validation pass.
In addition to its use in the binder, the metaschema has its own page in
the developer documentation. This page is generated using a small tool,
jsonschema2md.go.
These changes add support for unmarshaling and marshaling package
schemas using YAML instead of JSON. Language-specific data is
canonically JSON. Users of the `*Spec` types will need to update the
types of the the their `Language` values to use the new
`schema.RawMessage` type instead of `json.RawMessage`: the former has
support for YAML while the latter does not.
Rotating a passphrase requires that the old passphrase is available via
one of the `PULUMI_CONFIG_PASSPHRASE` or `PULUMI_CONFIG_PASSPHRASE_FILE`
environment variables. This confuses `readPassphrase` when reading a new
passphrase, since that function checks the aforementioned environment
variables prior to reading from the console. The overall effect is that
it is impossible to rotate the passphrase for a stack using the
passphrase provider. These changes fix this by always reading from the
console when rotating a passphrase.
This command converts an appdash trace into a pprof file for use with
`go tool pprof`. Spans are converted into stacks by sampling each root
span at a given rate and recording the stack of subspans at each sample.
These changes also replace the conditional addition of experimental and
debug commands with conditional visibility. Experimental and debug
commands will always be available, but will be hidden unless the
appropraite environment variables are set.
Co-authored-by: Levi Blackstone <levi@pulumi.com>