The map of property dependencies the Python SDK receives from the
engine uses `camelCase` property keys, but the SDK performs lookups
using `snake_case` property keys. Fix this by translating the map's keys
from `camelCase` to `snake_case` prior to performing any lookups.
Rather than duplicating the list of tests and codegen driver across each
SDK, move its definition into `pkg/codegen/internal/test`. This has a
few notable benefits:
- All SDK code generators will be tested against each test. Though some
tests may exercise a particular code generator more than others, the
extra coverage will be generally beneficial.
- Adding a new test is simpler, as only a single file needs to be
changed.
- All SDKs now honor the `PULUMI_ACCEPT` environment variable for
updating baselines.
- Codegen tests now validate all generated files instead of only a
particular subset.
Adds a new resource option to force replacement when certain properties report changes, even if the resource provider itself does not require a replacement.
Fixes#6753.
Co-authored-by: Levi Blackstone <levi@pulumi.com>
Adds initial support for resource methods (via a new `Call` gRPC method similar to `Invoke`), with support for authoring methods from Node.js, and calling methods from Python.
These changes contain a preliminary fix for #7359 in the Go SDK. The fix
handles input values that are nested one level deep within maps and
arrays, but does not handle other cases of nested input types.
These changes support arbitrary combinations of input + plain types
within a schema. Handling plain types at the property level was not
sufficient to support such combinations. Reifying these types
required updating quite a bit of code. This is likely to have caused
some temporary complications, but should eventually lead to
substantial simplification in the SDK and program code generators.
With the new design, input and optional types are explicit in the schema
type system. Optionals will only appear at the outermost level of a type
(i.e. Input<Optional<>>, Array<Optional<>>, etc. will not occur). In
addition to explicit input types, each object type now has a "plain"
shape and an "input" shape. The former uses only plain types; the latter
uses input shapes wherever a plain type is not specified. Plain types
are indicated in the schema by setting the "plain" property of a type spec
to true.
* Do not hang but propagate exception when it happens in resolve_outputs
* Add an integration test for the issue
* Better error message
* Add CHANGELOG_PENDING entry
* Update sdk/python/lib/pulumi/runtime/rpc.py
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
* Address PR feedback and tighten path param typing
* Given Windows builder is failing, allow 2x time for the test
* Give some more time to the Windows runner
* Attempt to solve differently
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
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.
* resolve issue with exit code not bubbling up and inflight tasks swallowing exceptions
* update changelog
* refacter to reduce and centralize inline program exception flow complexity
* quick comments on new pulumi function return type
This commit moves from simply asserting on the assignability of types to
using `Assertf` to print the types in question. This provides more
information to a user whose code is panicking because of
non-assignability.
Ultimately it would likely be better to surface this via error messages
instead of via panic, but this at least improves the debuggability in
the meantime.
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>
The `bad-methods-2.json` test ensures there is an error when trying to use a function as a method twice.
The schema looks like:
```
"methods": {
"bar": "xyz:index:Foo/bar",
"baz": "xyz:index:Foo/bar"
}
```
And the expected error is:
> function xyz:index:Foo/bar for method baz is already a method
However, when the schema is unmarshalled into a map, the keys in the map are unordered (just as JSON keys in objects are unordered), so occaisonally we'd see an error mentioning method `bar` rather than `baz`:
> function xyz:index:Foo/bar for method bar is already a method
To address this, we'll fix the portion of the code that is generating the error to walk the map in a deterministic order, and we'll also return the list of methods in the same deterministic order as well.