Commit graph

6025 commits

Author SHA1 Message Date
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
Anton Tayanovskyy 6596cf5fde
Fix MarshalProperties handling of list-nested unknowns (#7214)
* Fix MarshalProperties handling of list-nested unknowns

* Lint
2021-06-07 16:30:52 -04:00
Matt Stratton 1135892dc7
Update CoC to include GH Discussions and Slack (#7233)
This adds to the scope of the Code of Conduct to be inclusive of GitHub Discussions forum as well as the Community Slack 

Signed-off-by: Matt Stratton <matt.stratton@gmail.com>
2021-06-07 22:06:08 +03:00
Anton Tayanovskyy add5ea1d53
Edit doc comment (#7215)
* Edit doc comment

* Fix invalid XML
2021-06-07 13:02:16 -04:00
stack72 eeb6f6237d Cleanup post v3.4.0 release 2021-06-06 18:26:04 +01:00
stack72 f48e108e57 Prepare for v3.4.0 release 2021-06-05 23:54:22 +01:00
Paul Stack 9d6a2d05c4
[build] ensure downstream codegen tests run go mod tidy (#7222) 2021-06-06 01:36:52 +03:00
Luke Hoban adcf4ea28c
Fix typo (#7216) 2021-06-05 09:40:28 +10:00
Sean Fausett dc994deabd
[dotnet/sdk] Add get value async to output utilities (#7170)
* Add get value async to output utilities

asdasd

* Update changelog

* Move public apis from unshipped to shipped

Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
2021-06-04 18:22:00 -04:00
Justin Van Patten f1fa3a141d
[codegen/dotnet] Fix plain properties (#7180)
Fix the generated C# code for plain properties:

- Value types should not be initialized with `= null!`
- Arrays and maps should be `List<T>` and `Dictionary<string, TValue>`
2021-06-04 09:25:20 -07:00
Anton Tayanovskyy 3e1dc52851
Fixes 6608: unusable venv after template copy, python not executable (#6623)
* Fixes 6608: unusable venv after template copy, python not executable

* Add changelog entry
2021-06-04 10:03:04 -04:00
Paul Stack 3f73230ec7
[cli] Protect against panic when using incorrect token type in pulumi import (#7202)
Fixes: #6990
2021-06-04 15:08:40 +03:00
Mike Metral 672feff428
Fix Go init.go codegen to be govet compliant (#7195)
Co-authored-by: Mike Metral <mmetral@apple.com>
2021-06-04 13:57:04 +03:00
Emiliza Gutierrez 8dda59d10f
Bumping version of go-cloud to v.0.23.0 (#7204)
* updating to go-cloud 0.23.0

* referencing go-cloud directly, remove fork reference

* updating dependencies from make ensure

* updating changelog
2021-06-03 15:28:33 -07:00
Paul Stack 07ad69dfe6
Adding a workflow dispatch to GHA to test master builds from branches (#7203) 2021-06-03 23:24:49 +03:00
Praneet Loke dbea8058a2
Bump the Pulumi Service API version header to 7 (#7193)
* Version 7 indicates to the Pulumi Service that the CLI supports setting required headers for policy pack publishing

* Add bumping the Pulumi Service API version to the PR checklist
2021-06-02 11:32:52 -07:00
Evan Boyle 6ae6cc45b7
skip installing dev dependencies for nodejs plugin setup (#7188) 2021-06-02 11:09:03 -07:00
Luke Hoban bd6410e2fb
[sdk/python] Avoid exponential complexity for from_input/all (#7175)
These mutually recursive functions unintentionally had exponential complexity in nesting depth of objects, arg types and most likely arrays.

Remove the exponential complexity by avoiding direct recursion of from_input on itself, and relying on mutual recursion with all alone to reduce nested substructure.

Also simplify the implementation to aid readability.

Fixes pulumi/pulumi-kubernetes#1597.
Fixes pulumi/pulumi-kubernetes#1425.
Fixes pulumi/pulumi-kubernetes#1372.
Fixes #3987.
2021-06-01 13:11:22 +10:00
Komal 9c1964e622
[automation/nodejs] - Only log, don't error on unparsed events (#7162) 2021-05-28 09:15:45 -07:00