Commit graph

6043 commits

Author SHA1 Message Date
Matt Stratton b506dfbc75
Update to "learning in public" on CoC
Suggested by @katcosgrove
2021-07-06 11:03:19 -05:00
Matt Stratton b0871078df
Add some minor changes to CoC 2021-06-30 09:53:00 -05:00
Matt Stratton 424612e23a
Draft updates to Code of Conduct for guidelines 2021-06-30 08:55:02 -05:00
Justin Van Patten e966c65f69
Fix pylint issues (#7389) 2021-06-29 21:35:25 -07:00
Pat Gavlin 398fb2f852
Preliminary fix for #7359. (#7369)
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.
2021-06-28 16:04:21 -07:00
Komal e0902d2489
[codegen/python] - Include python enum docstrings (#7374) 2021-06-28 15:06:50 -05:00
Evan Boyle c37cbc998b
Fix a hang in nodejs remote components when an error is thrown within an apply (#7365) 2021-06-25 18:41:54 -07:00
Paul Stack 3cdfbf2a71
Ensure releases are announced to GitHub discussions (#7356) 2021-06-26 00:07:00 +01:00
Evan Boyle 634e97cd55
Include config secret info in Construct calls (#7358) 2021-06-24 15:38:01 -07:00
James Nugent d525a8b331
Add complete third-party Python module and fix setup.py indentation (#7362)
Co-authored-by: Komal <komalsali@gmail.com>
2021-06-24 16:01:49 -05:00
Pat Gavlin 7b1d6ec1ac
Reify Input and Optional types in the schema type system. (#7059)
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.
2021-06-24 09:17:55 -07:00
Levi Blackstone 98d9430486
[sdk/go] Add Contains method to PropertyPath (#7354) 2021-06-24 08:49:09 -06:00
Anton Tayanovskyy b16d50085b
Fix hanging deployments and improve errmsgs for programs with incorrect typings for output values (#7049)
* 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>
2021-06-23 11:27:17 -04:00
Evan Boyle a850648504
detect nodejs side by side pulumi for inline automation programs and fail fast (#7349) 2021-06-23 07:57:36 -07:00
Paul Stack 414367963f
[codegen/python] Update Python codegen to use a non-conflicting property name (#7239) 2021-06-23 14:55:23 +03:00
Komal 0f97a9bdfa
Fix python module nesting (#7353) 2021-06-22 15:43:21 -07:00
Pat Gavlin 2cc89defbc
Read passphrase from the terminal when rotating. (#7347)
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.
2021-06-22 11:13:57 -07:00
Komal a41ed75942
Fix watch command in macos arm64 builds (#7345) 2021-06-21 14:33:30 -07:00
Josh Studt 22669d70fc
[sdk/dotnet] - Fix swallowed nested exceptions with inline program so they correctly bubble to consumer (#7323)
* 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
2021-06-21 15:45:26 -04:00
James Nugent d4180d9f61
Print actionable information on assertion failure (#7344)
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.
2021-06-21 11:30:08 -06:00
Justin Van Patten 48bbc28d9e
[sdk/go] Specify known when creating outputs for construct (#7343)
If an input is an unknown value or contains unknowns, specify `false` for `known` when creating the output.
2021-06-21 09:51:41 -07:00
Adrian Smijulj 98211718ad
Watch Command - Added --path Argument (#7247) 2021-06-21 17:34:21 +10:00
Pat Gavlin 4da051a799
Add a convert-trace command. (#7319)
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>
2021-06-17 14:46:05 -07:00
Levi Blackstone ed64c4f671
Cleanup post v3.5.1 release (#7331) 2021-06-17 22:16:24 +03:00
stack72 d6f11cf650 Temporarily remove release post to GitHub Discussions 2021-06-17 02:34:37 +01:00
stack72 e3430f8c8b Prepare for v3.5.1 release 2021-06-17 00:42:16 +01:00
stack72 43f3705e64 Update GitHub Discussion Name to be Announcements 2021-06-17 00:40:09 +01:00
Levi Blackstone c79bddfd9c
Prepare for v3.5.0 release (#7321) 2021-06-16 15:45:55 -06:00
Justin Van Patten 258fb00bc2
[codegen/schema] Fix intermittent failing test (#7304)
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.
2021-06-16 07:14:53 -07:00
Josh Studt 2f4d10d541
[sdk/dotnet] - bug fix resources destroyed after exception thrown during inline program (#7299)
* resolve issue with resources being destroyed if an exception is thrown during an inline program dotnet sdk

* update changelog
2021-06-15 18:17:54 -04:00
Paul Stack cadbade4ba
Ensure we announce the release to GitHub Discussions (#7236) 2021-06-15 22:03:29 +03:00
Anton Tayanovskyy 30e999ff1a
Tracing enhancements for CLI perf metrics capture (#7279)
* Allow ProgramTest Tracing flag to expand {command}

* Fix comment typos

* Memory stats collection
2021-06-15 13:25:03 -04:00
Pat Gavlin af87128fb5
Add an option to skip resource typechecking. (#7305)
More testing has found further issues with incorrect attribute shapes
generated by tf2pulumi. This knob will allow us to continue to generate
examples until those bugs are fixed.
2021-06-15 10:22:57 -07:00
Pat Gavlin 5867fa84ce
[codegen/pcl] Allow missing object properties. (#7297)
Add an option to allow missing object properties. This will prevent us
from losing examples once resource typechecking is fixed (it is
currently unintentionally disabled because the resource inputs object
type has an unexpected shape).
2021-06-15 09:09:16 -07:00
Luke Hoban 965d23ba2a
[sdk/python] Ensure Output objects are not iterable (#7288)
Although `Output` objects can never correct support iteration, Python will see the implementation of `__getitem__` and try to iterate the object, leading to an infinite loop.  To prevent this, we need to explicitly implement `__iter__` and make it return a `TypeError` to prevent iteration (and offer a useful error message).

Fixes #5028.
2021-06-15 09:25:24 +10:00
Justin Van Patten 63e129a386
[sdk/python] Reduce log.debug calls for improved performance (#7295)
`log.debug` messages are part of an update and get sent to the service. Reducing the number of `log.debug` calls can significantly improve the performance of a program. This commit changes the debug logging in the Python SDK to be similar to the debug logging in the Node.js SDK.

 - An `excessive_debug_output` variable has been added (that can be set to `True` during debugging), but otherwise will avoid a large number of `log.debug` calls.
- Some unhelpful/redundant `log.debug` calls have been deleted.
2021-06-14 10:24:01 -07:00
Justin Van Patten 4156df31f7
[codegen/python] Cache the package version (#7293)
Every time a resource is created (without an explicit provider version specified), `_utilities.get_version()` is called to determine the package version. This call is expensive and can measurably impact performance, especially for programs with many resources. This change caches the value so it is only determined once.
2021-06-14 10:22:57 -07:00
Sean Fausett 7820d2c17b
Support microsoft logging extensions with inline programs (#7117)
* Demystify serilog logger messages
https://github.com/benaadams/Ben.Demystifier

* Update changelog
2021-06-10 23:06:57 -04:00
Anton Tayanovskyy 7ff1491397
Add trace proxying to fix sub-process trace collection into files (#7248)
* Add trace proxying to fix sub-process trace collection when tracing to files

* Better func naming in test

* Avoid dealing with Windows path nightmare

* On Windows it is go.exe of course

* Rename operation to component to better align with existing trace output
2021-06-10 22:57:18 -04:00
Komal 470be8c2b8
[cli/import] - Handle panic during import codegen (#7265) 2021-06-10 19:24:15 -07:00
Justin Van Patten 4e9e017cd2
[codegen/python] Rename conflicting ResourceArgs classes (#7171)
Python resource constructor overloads were recently added that accept a
`<Resource>Args` class for input properties, as an alternative to the
other constructor overload that accepts keyword arguments. The name of
the new args class is the name of the resource concatenated with an
`Args` suffix.

Some providers (e.g. Kubernetes, Azure Native, and Google Native) have
input types with the same name as resources in the same module, which
results in two different `<Resource>Args` classes in the same module.

When you try to use the new args class with the constructor, e.g.:

```python
pulumi_kubernetes.storage.v1.StorageClass(
            resource_name='string',
            args=pulumi_kubernetes.storage.v1.StorageClassArgs(...),
            opts=pulumi.ResourceOptions(...),
)
```

You run into an error, because
`pulumi_kubernetes.storage.v1.StorageClassArgs` is actually referring to
the existing input type rather than the intended `StorageClassArgs`
class for the constructor arguments.

Having the duplicate classes hasn't broken existing usage of the input
type because we "export" all the input types for a module _after_ all
the resources and resource args classes are exported, so the input type
just ends up "overwriting" the duplicate resource args class.

Other languages don't have this problem because the input type is either
in it's own module/namespace (e.g. Node.js and .NET) or a different name
is used for the input type (Go). But with Python, the input types and
resources are all available in the same module.

To address this for Python, when there is an input type in the same
module with the same name as the resource, the args class for the
resource will be emitted as `<Resource>InitArgs` instead of
`<Resource>Args`.
2021-06-10 10:41:49 -07:00
Justin Van Patten de871cec8e
Add schema support for methods (#7141) 2021-06-10 09:47:25 -07:00
Sean Fausett c4e55a7107
[dotnet/sdk] Add create unknown to output utilities (#7173)
* Add create unknown to output utilities

* Update changelog

* Tweaks based on review

Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
2021-06-10 10:54:16 -04:00
Sean Fausett 3530ba3205
[dotnet] Fix Resharper code issues (#7178)
* Fix resharper code issues for language usage opportunities

* Fix resharper code issues for common practices and code improvements

* Fix resharper code issues for potential code quality issues

* Fix resharper code issues for redundancies in code

* Fix xunit test output

* Update changelog

* Fix resharper code issues for compiler warnings

* Fix resharper code issues for inconsistent naming

* Add resharper solution settings file

* Fix resharper code issues for potential code quality issues

* Fix resharper code issues for redundancies in code

* Fix resharper code issues for redundancies in symbol declarations
2021-06-10 10:32:33 -04:00
Mikhail Shilkov 3e170f6f80
Merge pull request #7256 from pulumi/mikhailshilkov/set-ops
Add helper methods to StringSet
2021-06-10 10:35:13 +02:00
Paul Stack 57347188fb
[sdk/python] Fix linting errors due to missing types files (#7257) 2021-06-09 19:14:59 +03:00
Mikhail Shilkov af0054093a Add helper methods to StringSet 2021-06-09 12:02:32 +02:00
Luke Hoban 26e252f241
Ensure Output.from_input({}) returns {} instead of [] (#7254)
Fixes #7252.
2021-06-09 19:48:10 +10:00
James Nugent 601396c673
Include props which have underlying strings on Go SDK providers (#7230)
This commit modifies the work in #7058 to permit properties which do not
pass the test of being strings directly, but which have an underlying
type of string.

When applied to `pulumi-aws`, this results in the following diff:

```
diff --git a/sdk/go/aws/provider.go b/sdk/go/aws/provider.go
index c32ad2367..8b4c9fd0a 100644
--- a/sdk/go/aws/provider.go
+++ b/sdk/go/aws/provider.go
@@ -21,6 +21,8 @@ type Provider struct {
 	AccessKey pulumi.StringPtrOutput `pulumi:"accessKey"`
 	// The profile for API operations. If not set, the default profile created with `aws configure` will be used.
 	Profile pulumi.StringPtrOutput `pulumi:"profile"`
+	// The region where AWS operations will take place. Examples are us-east-1, us-west-2, etc.
+	Region pulumi.StringPtrOutput `pulumi:"region"`
 	// The secret key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console.
 	SecretKey pulumi.StringPtrOutput `pulumi:"secretKey"`
 	// The path to the shared credentials file. If not set this defaults to ~/.aws/credentials.
```

The primary purpose this is desirable is to expose Region from instances
of the AWS provider.
2021-06-08 13:05:31 -07:00
Luke Hoban c5907962d6
Render logs consistently in watch and logs (#7235)
We were trimming trailing newlines from log messages in `pulumi logs` but not in `pulumi watch`.  The latter was seeing many empty lines in logs as a result of this.  This change consistently trims trailing newlines in all log rendering.
2021-06-08 11:20:59 +10:00