Commit graph

366 commits

Author SHA1 Message Date
Ian Wahbe 208c6ec44d
Add flag for input registration to the go schema (#8198)
* Add flag

* Update CHANGELOG_PENDING.md

* Add this feature to an orthogonal test
2021-10-12 10:15:24 -07:00
Ian Wahbe 28528ba26b
Fix default package name (#8187)
* Fix default pacakge name

* Update changelog

* Generalize naming functions
2021-10-11 15:28:11 -07:00
iamjekyun 1bb85ca98c
Only prune the trailing spaces in Python automation result (#8160) 2021-10-11 10:26:22 -07:00
Ian Wahbe 20287afdd7
Iwahbe/8000/uprgade go versions (#8171)
* Upgrade the pulumi cli to go1.17.1

* Run go mod tidy

* Update CHANGELOG_PENDING.md

* Update pkg/go.mod for go1.17

* Update sdk and tests
2021-10-11 09:47:08 -07:00
Komal a9a62bd761
Determine secretness by checking raw string for the secret sentinel (#8179) 2021-10-08 14:43:10 -07:00
Justin Van Patten 789e392194
[codegen/go] Emit input type registrations (#7959)
Register an appropriate input type with the runtime for each object
type and composite thereof (e.g. pointer, array, etc.). This does not
cover registrations for enum and resource input types, which will be
added with future changes.

Co-authored-by: Pat Gavlin <pat@pulumi.com>
2021-10-07 15:26:24 -07:00
Anton Tayanovskyy 6f8d411bc4
5758 for Node JS (#8047)
* Implement 5758 for Node JS

* Codegen tests

* Remove typo
2021-10-07 15:39:19 -04:00
Ian Wahbe e1f0976667
Use importBasePath before name if specified (#8159)
* Use importBasePath before name if specified

This is a go specific code change. We should clarify in the docs how
`name`, `importBasePath` and `rootPackageName` interact.

* Update CHANGELOG_PENDING.md

* Test package naming

* Explain test and remove debugging print

* Comply with linter
2021-10-07 11:56:44 -07:00
Anton Tayanovskyy 32695f7022
Minimally extend .NET SDK to support 5758 (#8142)
* Minimally extend .NET SDK to support 5758

* Retract CodegenUtilities

* Add CHANGELOG_PENDING
2021-10-07 09:51:24 -04:00
Emiliza Gutierrez 9d0c224b35
cleanup changelog pending (#8152) 2021-10-06 12:02:14 -07:00
Komal b6c6108edd
[sdk/python] - Python 3.10 compatibility (#8130) 2021-10-05 11:43:52 -07:00
Anton Tayanovskyy 1ee85d8d2f
Fix 8110 (#8116)
* 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
2021-10-04 17:26:49 -04:00
Jeremy Dartigalongue 25f396bf49
Fix Go automation API --target / --replace args (#8109) 2021-10-04 11:55:23 -07:00
Paul Stack 09a8cc7079
[cli] Add the ability to control auto-refresh of stacks by Pulumi.yaml (#8071)
Co-authored-by: Komal Ali <komal@pulumi.com>
2021-09-29 12:43:48 +03:00
Ian Wahbe 9df8d3a028
Bold in-progress diffs diffrently (#7918)
* Initial take on coloring in-progress diffs

* Update CHANGELOG_PENDING.md

* Add high and low color levels

* Don't print functions

* Change colorprogress to bold

* Fix @komalali's nits.

* Restore background colors comment
2021-09-28 15:16:09 -07:00
Komal 4765f98d0c
Release cleanup (#8094) 2021-09-28 11:46:04 -07:00
Pat Gavlin 0a45f8d3ab
[codegen/go] Rewrite cyclic types. (#8049)
When computing the type name for a field of an object type, we must
ensure that we do not generate invalid recursive struct types. A struct
type T contains invalid recursion if the closure of its fields and its
struct-typed fields' fields includes a field of type T. A few examples:

Directly invalid:

    type T struct { Invalid T }

Indirectly invalid:

    type T struct { Invalid S }

    type S struct { Invalid T }

In order to avoid generating invalid struct types, we replace all
references to types involved in a cyclical definition with *T. The
examples above therefore become:

(1) type T struct { Valid *T }

(2) type T struct { Valid *S }

    type S struct { Valid *T }

We do this using a rewriter that turns all fields involved in reference
cycles into optional fields.

These changes also include an enhancement to the SDK codegen test
driver in the interest of making iterating and debugging more convenient:  if the -sdk.no-checks flag is passed, the driver will not run post-generation checks.
2021-09-28 07:33:14 -07:00
Justin Van Patten 6de2890046
Prepare for v3.13.2 release (#8087) 2021-09-27 22:56:31 -07:00
Justin Van Patten 49e1b0c38c
Prepare for v3.13.1 release (#8083) 2021-09-27 20:28:42 -07:00
Komal 74dfa83de5
[codegen/nodejs] - Fix provider enum with env var (#8051)
* Add failing test

* Fix

* PR feedback
2021-09-24 15:02:56 -07:00
Justin Van Patten 3027d01f25
Enable output values by default (#8014)
* Enable output values by default

Enable output values by default in the resource monitor and change the polarity of the envvar from `PULUMI_ENABLE_OUTPUT_VALUES` to `PULUMI_DISABLE_OUTPUT_VALUES`.

* Marshal unknown as unknown string when `!KeepOutputValues`

Marshal all unknown output values as `resource.MakeComputed(resource.NewStringProperty(""))` when not keeping output values, which is consistent with what the SDKs do.

Otherwise, when `v.OutputValue().Element` is nil, `resource.MakeComputed(v.OutputValue().Element)` will be marshaled as a null value rather than as an unknown sentinel.

* Add MarshalOptions.DontSkipOutputs and use where needed

Before we expanded the meaning of `resource.Output`, `MarshalProperties` always skipped output values:

```go
if v.IsOutput() {
    logging.V(9).Infof("Skipping output property for RPC[%s]: %v", opts.Label, key)
}
```

As part of expanding the meaning of `resource.Output`, I'd adjusted `MarshalProperties` to only skip output values when the value was unknown and when not keeping output values:

```go
if v.IsOutput() && !v.OutputValue().Known && !opts.KeepOutputValues {
    logging.V(9).Infof("Skipping output property for RPC[%s]: %v", opts.Label, key)
}
```

However, this doesn't work the way we want when marshaling properties that include unknown output values to a provider that does not accept outputs. In that case, `opts.KeepOutputValues` will be `false` because we want the marshaler to fall back to returning non-output-values (e.g. unknown sentinel value for unknown output values), but instead of getting the intended fallback values, the unknown output values are skipped (not what we want).

I suspect we may be able to delete the output value skipping in `MarshalProperties` altogether (it's odd that it is skipping `resource.Output` but not `resource.Computed`), but to avoid any unintended side effects of doing that, instead, this commit introduces a new `MarshalOptions.DontSkipOutputs` option that can be set to `true` to opt-in to not skipping output values when marshaling. The check in `MarshalProperties` now looks like this:

```go
if !opts.DontSkipOutputs && v.IsOutput() && !v.OutputValue().Known {
    logging.V(9).Infof("Skipping output property for RPC[%s]: %v", opts.Label, key)
}
```

`opts.DontSkipOutputs` is set to `true` when marshaling properties for calls to a provider's `Construct` and `Call`.

* [sdk/nodejs] Deserialize output values

This commit adds support for deserializing output values, which is needed in some cases when serialized inputs are returned as outputs in the SDK.

* [sdk/python] Deserialize output values

This commit adds support for deserializing output values, which is needed in some cases when serialized inputs are returned as outputs in the SDK.
2021-09-24 08:57:04 -07:00
Justin Van Patten 1e09626bc7
[sdk/{nodejs,python}] Fix errors when testing remote components with mocks (#8053)
v3.13.0 introduces support for serializing outputs in inputs as special output value objects in the Node.js and Python SDKs when serializing inputs for remote components and method calls. This functionality is currently disabled by default in the engine (setting the `PULUMI_ENABLE_OUTPUT_VALUES` envvar to a truthy value enables it).

However, unit testing remote components with mocks results in errors being raised in v3.13.0, related to the new output value support. This is due to the mock monitor implementation saying it supports all features (which now includes output values), so the SDK serializers are serializing outputs as output values, which the mock monitor can't handle correctly.

This change addresses the issue by updating the mock monitor implementation in the Node.js and Python SDKs to indicate the specific features that are supported, excluding support for output values. New tests with mocks fail before the change and pass after.
2021-09-24 06:08:13 -07:00
Komal b8b6f3dd70
[codegen/go] - Resolve type name collisions (#7985) 2021-09-23 15:42:48 -07:00
Komal 41b8882fe8
[codegen/nodejs] - Don't import types for functions if they don't exist (#8038)
* Add failing test

* Fix

* Update changelog

* Existing tests are sufficient
2021-09-23 10:12:27 -07:00
Ian Wahbe c9b719c6c0
Revert "Emit schema.Package.Version when possible (#7938)" (#8035)
* Revert "Emit schema.Package.Version when possible (#7938)"

This reverts commit 906dce73a1.

* Remove dotnet SDK compile checks

* Add to changelog
2021-09-22 19:39:07 -07:00
Komal 212ac89366
[auto/python] - Fix a bug in printing stack. (#8032) 2021-09-22 16:49:03 -07:00
Komal aa79322b46
post-release (#8028) 2021-09-22 16:22:58 -04:00
Komal 3d42198991
Clean up diagnostic messages in event log (#7998)
* Don't escape characters in event log.

* Respect NO_COLOR
2021-09-21 17:22:39 -07:00
Pat Gavlin 236ce54269
[schema] Add the Pulumi Package metaschema. (#7952)
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.
2021-09-20 12:00:42 -07:00
Ian Wahbe c338876b9f
iwahbe/7858/fix nodejs hypen imports (#7993)
* Add pascal name case

* Add test to prevent regressions

* Update CHANGELOG_PENDING.md

* Give node/tsc more memory

* Use camelcase instead of snake case

* Add clearer comments
2021-09-20 10:11:44 -07:00
Ian Wahbe 906dce73a1
Emit schema.Package.Version when possible (#7938)
* Emit schema.Package.Version when possible

* Update CHANGELOG_PENDING.md

* Correctly interpret python versions (I hope)

* Update PLUGIN_VERSION to the package version

* Modify tests to conform with master merge
2021-09-17 23:11:54 -07:00
Ian Wahbe 7f90e12886
Validate Name, Version and Enviroment (#7896)
* Validate Name, Version and Enviroment

For the full path:
Package.Name
Package.Version
Package.Property.Default

* Update tests

* Update CHANGELOG_PENDING.md

* Add more versions to tests

* Add another "Version" field

* Even more "version" tags

* One more "version" tag added

* Update test results from codegen

* Fix py codegen tests

* Fix doc test

* Remove `version` validation

* Unformat json files

* Fail only on errors
2021-09-17 12:12:22 -07:00
Justin Van Patten 1a4f36e97b
[sdk/go] Add RegisterInputType and register built-in types (#7928)
This change adds a `RegisterInputType` function (similar to the existing `RegisterOutputType`) that is used to register an input interface's type and its associated input type, and adds registrations for the built-in input types.

This will be used when copying inputs to an args struct for multi-lang components. When a field is typed as the input interface (e.g. `StringMapInput`) and doesn't need to be an `Output`, we can use this to lookup the non-Output type that implements the interface (e.g. `StringMap`) so it can be instantiated.

A subsequent change will update the Go SDK codegen to produce input type registrations for a provider's input types.
2021-09-15 21:12:49 -07:00
Ian Wahbe 054b3f9edc
Iwahbe/7881/thread replace on chages through sdks (#7967)
* Thread replaceOnChanges through the Go SDK

* Add replaceOnChanges to the .NET SDK

* Update CHANGELOG_PENDING.md

* Fix null error

* Update CHANGELOG_PENDING.md

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-09-15 14:29:13 -07:00
Ian Wahbe 3b7d78c126
Use json.Unmarshal instead of custom parser (#7954)
* Use json.Unmarshal instead of custom parser

* Update CHANGELOG_PENDING.md
2021-09-13 10:49:57 -07:00
Justin Van Patten 0c0684af5c
Initial support for (un)marshaling output values (#7861)
This change expands the definition of `resource.Output` in the Go SDK with additional information about the output, i.e. dependencies and secretness, and adds support in the core Go RPC code for (un)marshaling output values.

Output values are marshaled as special objects ala archives, assets, and resource refs and are unmarshaled as `resource.Output` values.

Subsequent PRs will add:
 - A monitor feature for output values, which will initially be disabled by default but available to turn on via an envvar
 - Support for (un)marshaling output values in each language SDKs
 - A way for providers to indicate support for receiving output values
 - E2E tests
 - Turn the monitor feature on by default (w/ env var to disable) (Note: the current plan is to initially scope this to only be used when marshaling inputs to a multi-language component)
2021-09-13 09:05:31 -07:00
Benjamin Schiborr 77867f9ce4
feat: Improve error messages for (un)marshalling (#7936)
Currently whenever an issue occurs in `UnmarshalProperties` and
`MarshalProperties` the offending property is hidden and very difficult
to track down.

This commit changes the behavior. For `Assets` and `Archives` the error
message now includes the URI and for other properties it includes the
key of the `PropertyMap`.
2021-09-10 13:18:08 -07:00
Pat Gavlin 2296dc791b Prepare for v3.12.0 release 2021-09-08 14:41:25 -07:00
Anton Tayanovskyy c247f6e283
Fix 7913 Python codegen issue with double-quote inside docstrings (#7914)
* Introduce a test that showcases the invalid generated code

* Use shared printComment function

* Check for triple quote escaping

* Accept go

* Accept dotnet

* Accept nodejs

* Move codegen exampe into an existing schema

* Add CHANGELOG entry
2021-09-08 14:52:54 -04:00
Ian Wahbe 08b428ae96
Add replaceOnChange to schema (#7874)
* Add replaceOnChange to schema

* replaceOnChange at generate time for resources

* ReplaceOnChanges sees through optional types

* Correctly deal with map,array,object,resource type

This is responding to PR clarifications from @justinvp and @lblackstone.

* Update CHANGELOG_PENDING.md

* Detect recursively defined objects

* Display recursion warning

* Check which recursive structures fail

* Add internal logic tests for replaceOnChanges

* Add tests
2021-09-07 22:23:30 -07:00
Ian Wahbe 2f0b370a67
Fix CHANGELOG_PENDING.md spelling (#7919)
One of these is mine. Sorry
2021-09-07 16:08:38 -07:00
Anton Tayanovskyy d7b9c01999
Fix 7862 (#7887)
* Fix 7862

* Add a unit test that reproduces the timeout

* Add a CHANGELOG entry
2021-09-07 11:30:39 -04:00
Luke Hoban f89e9a29f5
Revert "Allow Python dynamic provider resources to be constructed outside of __main__ (#7755)" (#7889)
This reverts commit ebb0e6aaed.

The changes in #7755 introduced a regression tracked in #7795.  It is not yet clear how to retain the desired behaviour introduced in #7755 while avoiding this regression, so for now we will revert those changes, and re-open #7453 to track a deeper fix.  That fix may require making changes to upstream `dill` to properly support these serialization requirements.

Fixes #7795.
2021-09-01 20:49:04 -07:00
Vivek Lakshmanan 233b396f29
Merge pull request #7877 from pulumi/vl/FixAuto
[auto/go] Fix stack config loading
2021-08-31 11:32:05 -07:00
Vivek Lakshmanan 59b24bd449 Add changelog 2021-08-30 21:28:57 -07:00
Ian Wahbe a2250cc9ef
Merge branch 'master' into iwahbe/2715/add-pulumi-about-command 2021-08-30 22:50:51 -04:00
Pat Gavlin 76ee1b8ccf
[codegen/schema] Add a schema checker (#7865)
- Change the schema package to report semantic errors as diagnostics
  rather than Go errors
- Add a `pulumi schema check` command to the CLI for static checking of
  package schemas

The semantic checker can be extended in the future to add support for
target-specific checks.
2021-08-30 19:29:24 -07:00
Ian Wahbe ea43fa2437
Merge branch 'master' into iwahbe/2715/add-pulumi-about-command 2021-08-30 21:57:20 -04:00
Anton Tayanovskyy 4380a63ad9
Implement 5758 {fn}_output codgen for Python (#7825)
* Implement 5758 {fn}_output codgen for Python

* Fix lint issues

* Accept codegen changes in expected examples

* Test and fix positional arg handling

* Add parameter descriptions to illustrate docstring codegen

* Generate docstrings

* Accept doc changes in expected go codegen file

* Use platform-agnostic API to drive Python tests
2021-08-30 16:52:58 -04:00
Ian Wahbe 4022108287
Merge branch 'master' into iwahbe/make-lint-status-code 2021-08-28 00:39:50 -04:00
Ian Wahbe 67f5b0a246 Update changelog 2021-08-28 00:38:35 -04:00
Ian Wahbe 878ab50044 Merge branch 'master' into iwahbe/2715/add-pulumi-about-command 2021-08-27 04:50:50 -04:00
Emiliza Gutierrez f54e4a720f
Cleanup after v3.11.0 release (#7843) 2021-08-25 15:19:02 -07:00
Anton Tayanovskyy d6db21dd55
Avoid repeatedly invoking pip show in Python lang host (#7831)
* Avoid repeatedly invoking `pip show` in Python lang host

The Python language host invokes `pip show` for each Pulumi package in a
project at startup. But `pip show` is quite slow in large projects: it
takes 2+ seconds per invocation in a project at @MaterializeInc.

`pip show` is invoked to compute the installed location of each plugin
package. But it turns out `pip list` takes a `-v` flag that can supply
this information in one shot, avoiding the need to ever invoke `pip
show`.

This patch shaves about 20s off our boot time for `pulumi up`.

(There's probably a separate bug in Pip that causes `pip show` to be so
slow, because `pip list` is an order of magnitude faster and does a lot
more work, but I didn't bother tracking that down.)

* Test and fix issue with parsing non-JSON trailer returned by pip

* Fix issues found by Go lint

* CHANGELOG entry

Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
2021-08-25 11:40:58 -04:00
Justin Van Patten 8112872b61
[sdk/dotnet] Support for calling methods (#7582) 2021-08-24 20:17:05 -07:00
Ian Wahbe bee803a970
Merge pull request #7824 from pulumi/iwahbe/7775/allow-hyphen-in-schema-path
Allow hyphen in schema path
2021-08-24 14:48:32 -07:00
Ian Wahbe 98d88f0899
Update CHANGELOG_PENDING.md
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-08-24 14:48:04 -07:00
Josh Studt 51b4f3d9bd
[auto/dotnet] - plugin installation options: exact version, server (#7796)
* add additional plugin install options

* update changelog

* slight re-name properties to be more idiomatic

* Apply suggestions from code review

Co-authored-by: Justin Van Patten <jvp@justinvp.com>

* Add support for old install plugin overload, and move unshipped api changes to shipped

* add breaking note to changelog

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-08-24 16:04:33 -04:00
Ian Wahbe cb5824593e Update changelog 2021-08-23 13:54:44 -07:00
Anton Tayanovskyy eef208633c
5758 for Go (#7784)
* Go support for 5758 - resurrect stale PR

* Fix listStorageAccountKeys test

* Check err so linter is satisfied

* Use all the examples

* Accept codegen results

* Regenerate with PULUMI_IGNORE_AMBIENT_PLUGINS=1

* Compile and test generated code as part of the test suite

* Add a CHANGELOG entry

* Remove temp test marker

* Shorten output type name

* Simplify code

* Add issue link

* Accept more codegen changes

* Use the suggested format for linking an issue
2021-08-23 16:46:09 -04:00
Ian Wahbe 2ccc8e2539 Merge branch 'master' of https://github.com/pulumi/pulumi into iwahbe/2715/add-pulumi-about-command 2021-08-23 10:36:58 -07:00
Justin Van Patten ac2ba6aadd
Avoid missing go.sum entry for module for new Go projects (#7808)
Change `pulumi new` to use `go mod tidy` rather than `go mod download` when installing Go project dependencies, to ensure the project is fully prepared to be used by `pulumi up`, avoiding `missing go.sum entry for module` errors.
2021-08-23 07:54:56 -07:00
Ian Wahbe e4e2b7c9d5 Limit plugins to project only + Nits
Change copywrite dates.
2021-08-20 16:53:14 -07:00
Ian Wahbe aff79e1a6b Update the changelog with PR # 2021-08-20 12:30:47 -07:00
stack72 d196fc0279 Cleanup after v3.10.3 release 2021-08-19 12:01:10 +03:00
Luke Hoban e0035a9cd2
Include transitive children in dependency list for deletes (#7788)
Fixes deletion order issues outlined in #7780 related to dependencies on multi language components not ensuring that all (transitive) children of the dependency are treated as dependencies.

Since the state file is not guaranteed to include all transitive dependencies explicitly specified (because dependencies on multi-langauge components will only include the dependency on the component itself, not all of it's transitive children), this PR enlightens the computation of dependencies for deletion ordering to expand the transitive dependency to include transitive children of direct dependencies.
2021-08-18 18:26:36 -07:00
Evan Boyle a0e402118f
[codegen/go] Fix generation of nested collection types and remove invalid args types (#7779) 2021-08-18 10:04:07 -07:00
Jan Češpivo e67334db1d
Added support for custom naming of dynamic provider resource (#7633)
Now there is not possible to change a name of dynamic provider resource without copying a code of the `pulumi.sdk.python.lib.pulumi.dynamic.dynamic.Resource` and changing the hard-coded name `"pulumi-python:dynamic:Resource"`. I successfully uses this proposal to make it possible.

Usage:
```python
class CustomResource(
    Resource, name="my-custom-provider:CustomResource"
):
   ...
```

Co-authored-by: Pat Gavlin <pgavlin@gmail.com>
2021-08-17 14:15:53 -07:00
Anton Tayanovskyy 2223c6b8b9
Fix null exceptions when reading unknown outputs (#7762)
* Fix null exceptions when reading unknown outputs

* Fix test compilation

* Add a test reproducing the actual problem

* Revert the change in behavior that was not clearny an improvement

* Unique resource UUID

* Add a CHANGELOG entry
2021-08-17 09:30:54 -04:00
Pat Gavlin d454e42b1d
Prepare for v3.10.2 (#7771) 2021-08-16 19:36:38 -05:00
Pat Gavlin 8f9a13a76f
[sdk/go] Fix a typo in marshaling. (#7768)
A few identically-typed variables got confused with the changes in #7737.
The confusion caused empty property values to be included in resources
that had any dependencies on other resources, which confused the
unmarshaling code for Go multi-language components. These changes fix
the typo and restore the original behavior, which is to omit empty
property values.

Co-authored-by: Emiliza Gutierrez <emiliza@pulumi.com>
2021-08-16 19:01:20 -05:00
PND b5ee840b16
[sdk/nodejs] Prevent Pulumi from overriding tsconfig.json options. (#7068) 2021-08-15 18:58:43 -07:00
Anton Tayanovskyy 5069a8fca8
Fixes 5642 for Go: allow DependsOn accepting inputs and outputs (#7584)
* Work in progress, first passing tests

* Test unknown dep prop similar to Python

* Test fixes

* Fix lint

* Nit fix

* CHANGELOG

* Add ResourceInputArray and simplify the API

* Adopt urnSet
2021-08-13 11:13:23 -04:00
Anton Tayanovskyy cd885bded5
Re-introduce the fix for 7734 and mitigate CI hangs (#7746)
* Revert the revert

* Fix exception bleed from one test suite to another

* Fix typos
2021-08-13 11:07:13 -04:00
JasonWhall 93be963d6e
Stop printing value if it looks like a secret (#7327)
Stop printing secret value on `pulumi config set` if it thinks it may be a secret value. Instead, print the config key name.
2021-08-13 06:07:52 -07:00
Luke Hoban ebb0e6aaed
Allow Python dynamic provider resources to be constructed outside of __main__ (#7755)
The underlying library `dill` that we use for serializing dynamic providers into Pulumi state for Python dynamic providers serializes classes differently depending on whether they are in `__main__` or in another module.  We need the by-value serialization to be applied in all cases.

https://github.com/uqfoundation/dill/issues/424 is tracking adding the ability into `dill` to specify this by-value serialization explicitly, but until then, we will temporarily re-write the `__module__` of a provder class prior to serialization, so that `dill` behaves as we need for the dynamic provider use case.

Fixes #7453.
2021-08-12 20:02:17 -07:00
Emiliza Gutierrez 85c15b05e4
Cleanup from v3.10.1 release (#7753) 2021-08-12 12:32:12 -07:00
Pat Gavlin ecb98b66fd
[sdk/python] Transitive component dependencies. (#7732)
Implement Node/.NET-style dependency semantics for component resources.
Depending on a component implicitly depends on all of the component's
children. The exact set of children depends on exactly when the
component resource is observed.

Part of #7542.
2021-08-11 21:52:16 -05:00
Pat Gavlin 2d70324b56
[sdk/go] Transitive component dependencies. (#7737)
Implement Node/.NET-style dependency semantics for component resources.
Depending on a component implicitly depends on all of the component's
children. The exact set of children depends on exactly when the
component resource is observed.

Part of #7542.
2021-08-11 21:51:23 -05:00
Evan Boyle 7361e719dc
prepare for 3.10.0 release (#7748) 2021-08-11 18:44:32 -07:00
Anton Tayanovskyy ea333681ab
Revert "Fix hangs in core SDK when monitor unavailable (#7734)" (#7744)
This reverts commit e567b4762f.
2021-08-11 17:13:37 -04:00
Justin Van Patten 0b782ea884
[sdk/python] Fix pulumi.property's default value handling (#7736)
We were incorrectly setting the name of the attribute rather than the intended default value.
2021-08-11 09:15:46 -07:00
Anton Tayanovskyy e567b4762f
Fix hangs in core SDK when monitor unavailable (#7734)
* Fix hangs in core SDK when monitor unavailable

* merged
2021-08-11 10:50:27 -04:00
Pat Gavlin 64696b42b8
[sdk/providers] Fix update previews (#7560)
Do not return the inputs as the state for update previews that use an
unconfigured provider. Returning the inputs as the state allows the
language SDKs to incorrectly treat unknown properties as known (because
we can't call `Update` on an unconfigured provider, we can't know which
properties are unknown). Users can re-enable the existing behavior by
setting the `PULUMI_LEGACY_PROVIDER_PREVIEW` environment variable to a
truthy value (e.g. `1`, `true`, etc.).

Most users will be unaffected by these changes. The most common programs
that may be affected are those that combine the creation of a managed
Kubernetes cluster with the deployment of applications to that cluster. These
programs generally need to configure a k8s provider instance by constructing
a kubeconfig from the output of the managed k8s cluster. Any changes to the
cluster that cause the kubeconfig to be unknown then cause the provider to
go unconfigured at runtime. Prior to these changes, resources managed by the
k8s provider would have some known outputs in this scenario, as the engine
would treat the resource's input values as its output values. After these changes,
the resource's outputs will be treated as unknown. The most frequent affect
that this has is that applies/stack outputs that depend on the outputs of
a k8s resource managed by a provider with an unknown kubeconfig will not
run/be displayed as `output`s during previews, respectively.

We might be able to improve on this by taking advantage of schema
information and filling in unknown values for properties that do not
exist in the inputs.

Fixes #7521.

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
Co-authored-by: Luke Hoban <luke@pulumi.com>
2021-08-10 19:44:15 -05:00
Horace Lee a92a005d68
Use ESlint instead of TSlint (#7719)
Migrated TSlint configs to ESlint ones using [tslint-to-eslint-config](https://github.com/typescript-eslint/tslint-to-eslint-config) tool, and refined the configs to better match the current coding style.

Changes:
- [member-delimiter-style](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md#options) that as suggested default for type definition to be  with `semicolon`
- Indentation fixes that is enforced by [eslint-indent](https://eslint.org/docs/rules/indent#options)
- Added dependencies for ESlint with Typescript
- Removed TSlint
2021-08-10 11:31:59 -07:00
Evan Boyle 8b918e544e
[sdk/nodejs] Account for outstanding async work done in prepareResource (#7704) 2021-08-04 10:27:38 -07:00
Nikhil Benesch 442cdf5743
python: Use Sequence rather than List in Resource fields (#7700)
Similar to #5282, but for core SDK types. The tl;dr is that because
Sequence[T] is covariant, constructing resources becomes much more
ergonomic.

Fix #7693.
2021-08-03 14:03:42 -07:00
yarinm 013036064f
Add force flag for RemoveStack (#7523) 2021-08-02 12:54:46 -07:00
svangordon-fruit 29fa23d6d9
Accept git remotes with periods in hostname (#7386)
Fix `cloudSourceControlSSHRegex` so that it will match git remotes with periods or hyphens in the hostname. However, `azureSourceControlSSHRegex` _does_ match hostnames with a period. As a result, `TryGetVCSInfo` will treat these sorts of remotes as Azure source control remotes and drop the first group. This causes updates to have an incorrect `"vcs.kind"` field. For example, an update with a Git remote of `github.foo.acme.com` will have a `"vcs.kind"` field of `foo.acme.com`. This occurs if a user is using a self-hosted GH enterprise instance.
2021-08-01 10:47:44 -07:00
Anton Tayanovskyy ab7d4263b4
Fix IDE completion issues for lazy imports (#7487)
* Improve codegen import code completion python experience

* Accept codegen changes
2021-07-30 16:35:02 -04:00
Justin Van Patten b2cf037bd4
Cleanup CHANGELOG_PENDING after a release (#7689) 2021-07-30 08:21:58 -04:00
Chris Smith 883bb76a69
Paginate backend list operations (#7600)
* Paginate backend::List*

* Update filestate backend

* Update httpstate backend

* Update pulumi CLI commands

* Rebase with 'master', fix merge conflict in CHANGELOG_PENDING.md

* Resolve merge conflicts / errors
2021-07-29 13:37:17 -07:00
Justin Van Patten 74ab9e0869
[sdk/python] Handle unknown results from methods (#7677)
This fixes handling of unknown results from methods in the Python SDK. Node.js and Go were already handling this appropriately.
2021-07-29 11:11:52 -07:00
Anton Tayanovskyy 5788befcf4
Fixing WaitGroup related panics in the Go SDK (#7661)
* Add tests reproducing the panics

* Add v2 of the test

* Use tailor-made workGroup to mimic sync.WaitGroup

* Lint

* CHANGELOG
2021-07-29 12:39:28 -04:00
Evan Boyle f4efb7564b
Respect provider aliases (#7166) 2021-07-28 12:12:53 -07:00
Anton Tayanovskyy 5b2fdb27d3
Cleanup CHANGELOG_PENDING after a release (#7668) 2021-07-28 14:12:56 -04:00
Anton Tayanovskyy bc96ac799d
Inputty depends_on support for Python (#7559)
* Inputty depends_on support for Python

* Fix circular import

* Add a test, fix bugs found by test

* Fix typo

* Minimize loss of dep information in presence of unks to match Node behavior

* Add CHANGELOG entr

* Update sdk/python/lib/pulumi/output.py

Co-authored-by: Justin Van Patten <jvp@justinvp.com>

* Update sdk/python/lib/test/test_resource.py

Co-authored-by: Justin Van Patten <jvp@justinvp.com>

* Fix _is_prompt

* Enhance tests, found out a gap against Node impl

* Add non-listy case

* Internal functional combinators

* Do not use all/deep await when merging

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-07-28 09:49:07 -04:00
Komal ae87b86e25
Include children when targeting components. (#7605) 2021-07-27 19:17:54 -07:00
Luke Hoban fa6375999e
[backend/filestate] Allow pulumi stack ls to see all stacks regardless of passphrase (#7660)
* [backend/filestate] Allow `pulumi stack ls` to see all stacks regardless of passphrase

The information exposed via `pulumi stack ls` does not require being able to decrypt state files, but the existing logic for `pulumi stack ls` with the filestate backend was to fully decrypt the state file anyway, silently skipping any stacks that could not be decrypted.  This led to surprising results from `pulumi stack ls`.

After these changes, `pulumi stack ls` with the filestate backend will list *all* stacks that are available.  Notably, because there is no notion of "project" scoping in the fielstate backend (yet), `pulumi stack ls` will list all stacks independent of the project name.

Fixes #4798.
2021-07-27 18:37:25 -07:00
Anton Tayanovskyy 148df112d7
Revert flag parse ordering change (#7640)
* Revert flag parse ordering change

* Add a simple unit test

* CHANGELOG
2021-07-27 12:42:52 -04:00