Commit graph

6363 commits

Author SHA1 Message Date
James Nugent 11fc7e7f2b
Add provider.MainWithOptions helper function (#7598)
This commit adds a new counterpart to `ComponentMain` which accepts
an options struct for specifying callback functions. Currently it
supports `construct` (for components) and `call` (for methods), but is
extensible in a non-breaking fashion in future to support all other
provider methods as they become useful to implement.

The original `ComponentMain` still exists, though it may be desirable to
deprecate it in future in favor of `MainWithOptions`.
2021-07-29 10:31:09 -07:00
Justin Van Patten 88305ba896
Update test data for docs template change (#7678) 2021-07-29 10:15:03 -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
Pat Gavlin 1409d88438
[codegen/*] Add join and toBase64 functions. (#5012)
Co-authored-by: Komal Ali <komal@pulumi.com>
2021-07-28 20:41:23 -07:00
Anton Tayanovskyy ba70b3fdba
Attempt to avoid triple-building projects in the solution (#7638) 2021-07-28 20:31:11 -04:00
David Wrede 878af7aecf
Updating doc links to align with changes in docs #4707 (#6157)
Co-authored-by: David Wrede <dave@pulumi.com>
2021-07-28 14:14:48 -07: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 0215a4fb51
Prepare for v3.9.0 release (#7667) 2021-07-28 14:10:05 -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
Komal fddeea8a88
[codegen] Unify program codegen testing (#7657)
* ProgramGen test driver

* Refactor to avoid exporting hcl2 entities
2021-07-27 18:00:39 -07:00
Justin Van Patten 1141dd4c98
[codegen/dotnet] Emit resource methods (#7606) 2021-07-27 16:42:17 -07:00
James Nugent 4a035c44aa
Allow setting plugin name and version for Node.js (#7631)
This commit adds two new fields to the Node package info struct to
permit setting the plugin name if it differs from the package name, and
the version if it differs from the package version. This was already
supported by the loader.
2021-07-27 11:34:22 -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
Justin Van Patten 42a1896bf9
[codegen/python] Delete dead code around casing tables (#7647)
Coincident with the release of Pulumi 3.0, we updated the provider SDK codegen for Python to no longer use casing tables for translating Python snake_case names to Pulumi camelCase names (and vice versa). Instead, the mapping is encoded in decorators applied on class properties.

Some of the code that was used to generate and use the casing tables has persisted. This commits removes this code, as it's no longer necessary, and will improve the quality of our generated examples.
2021-07-27 08:37:49 -07:00
Anton Tayanovskyy 3aa97a4b7d
Fanout build experiment (#7628)
* Experiment with gotestsum and test timings

* Fix to locating the helper script

* Fix the code for installing gotestsum

* Try alternative installation method

* Use go to compute test stats; Python fails parsing time values

* Try version without v

* Try with fixed gorelaser config

* Fix test time correlation

* Try a stable test stat sort finally

* Use more accurate test duration aggregation

* Include python and auto-api tests in the Go timing counts

* Bring back TESTPARALLELISM

* Fix test compilation

* Only top 100 slow tests

* Try to fracture build matrix to fan out tests

* Do not run Publish Test Results on unsuppored Mac

* Auto-create test-results-dir

* Fix new flaky test by polling for logs

* Try to move native tests to their own config

* Actually skip

* Do not fail on empty test-results folder

* Try again

* Try once more

* Integration test config is the crit path - make it smaller

* Squash underutilized test configurations

* Remove the test result summary box from PR - counts now incorrec

* Remove debugging step
2021-07-27 10:07:15 -04:00
Justin Van Patten a05c3a4e9b
Set the package on DependencyProviderResource (#7630)
When initializing `DependencyProviderResource`, pass the package to the base constructor instead of an empty string s.t. the provider is usable when its package is read.
2021-07-27 06:50:24 -07:00
Pat Gavlin 91683242d0
[codegen/go] Unify input method generation. (#7643)
The code for input method generation was duplicated. These changes
remove the duplicated code.

This is prep for fixing #7595.
2021-07-26 19:23:17 -07:00
Anton Tayanovskyy babedf5171
Ignore logflow args in Node providers (#7644)
* Ignore logflow args in Node providers

* Add unit test, handle --tracing

* Add missing files

* Add CHANGELOG

* Lint
2021-07-26 19:52:59 -04:00
Emiliza Gutierrez a2e0b4a3ad
Add resolution label to stale issues about to be closed (#7639) 2021-07-26 10:23:59 -07:00
Anton Tayanovskyy fbf44bfa39
Fix new flaky test by polling for logs (#7627) 2021-07-23 18:49:18 -04:00
Justin Van Patten e8bd8e5e1f
Rehydrate provider resources in Construct (#7624)
Previously, any provider resource passed to multi-lang components would be instantiated as a `DependencyProviderResource` inside `Construct`, which prevents the component from being able to easily access the provider's state as an instance of of the provider (e.g. `*aws.Provider`).

This change attempts to rehydrate the provider resource in the same way that resource references are rehydrated, if it's been registered, s.t. the specific provider resource type is instantiated with its state. Otherwise falling back to returning `DependencyProviderResource`.
2021-07-23 14:10:06 -07:00
Emiliza Gutierrez 13a606d54e
Actually close the issue after being marked as stale (#7626) 2021-07-23 13:44:13 -07:00
Alex Mullans 6c59644bf6
Add issue management Actions (#7476)
* Create issue-management.yml

* Update issue-management.yml
2021-07-23 14:07:06 +03:00
Anton Tayanovskyy 697cf3161e
Timeout of 1min for the slow task (#7619) 2021-07-22 19:11:39 -04:00
Chae SeungWoo bd208df180
[sdk/go] Add stack output helpers for numeric types (#7410) 2021-07-22 15:48:47 -07:00
Pat Gavlin a4ee050afc
[sdk/dotnet] Fix collections in input unions. (#7601)
Collection types nested inside of Input<Union<...>> types need to abide
by the usual rules for collection types nested inside of input types.
These changes replace the use of the generic SimplifyInputUnion with a
.NET-specific simplifyInputUnion that does not remove Input types
inside of a union if those Input types wrap collection types. Retaining
these Input types allows the usual logic for handling
Input<Collection<...> types in typeString to kick in.

Fixes #7569.
2021-07-22 13:11:33 -07:00
Komal 0b1a985bbf
Release cleanup (#7614) 2021-07-22 12:34:11 -07:00
Komal 8afccf60ab
Prep for 3.8.0 release (#7613) 2021-07-22 12:27:04 -07:00
Evan Boyle a659b3565c
reenable concurrent update test (#7609) 2021-07-22 10:06:44 -07:00
Anton Tayanovskyy b0f51a6b2c
Fixes for C# concurrency bugs in 7492 (#7529)
* Reproduce the issue in a failing test

* Fix

* Tentative fix

* Update sdk/dotnet/Pulumi/Deployment/TaskMonitoringHelper.cs

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

* Update sdk/dotnet/Pulumi/Deployment/TaskMonitoringHelper.cs

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

* Update sdk/dotnet/Pulumi/Deployment/TaskMonitoringHelper.cs

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

* Update sdk/dotnet/Pulumi/Deployment/Deployment.Runner.cs

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

* Do not allocate TaskCompletionSource when not needed

* Update sdk/dotnet/Pulumi/Deployment/Deployment.Runner.cs

Co-authored-by: Josh Studt <32800478+orionstudt@users.noreply.github.com>

* Fix warning

* Cache delegate

* Simplify with named tuples

* Test early exception termination

* Test logging

* Remove the smelly method of suppressing engine exceptions

* Update sdk/dotnet/Pulumi/Deployment/TaskMonitoringHelper.cs

Co-authored-by: Josh Studt <32800478+orionstudt@users.noreply.github.com>

* Fix typo; check in xml docs

* Try CI again

* Add CHANGELOG entry

* Dedup exceptions before reporting

* Lock access to _exceptions list

* Fix typos

* Version of HandleExceptionsAsync that accepts N exceptions

* Do not aggregate exceptions prematurely

* Rename private members

* Formatting

* Summary markers

* Short-circuit return

* Stylistic fixes

* Strengthen test

* Check that we have only 1 exception

* Remove defensive clause about AggregateException from the test

* Simplify TerminatesEarly test

* Remove EmptyStack

* Notes on the regression nature of the WorksUnderStress test

* Remove race condition repro as it is a poor repro, impossible to trigger from user code

* Brace style

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
Co-authored-by: Josh Studt <32800478+orionstudt@users.noreply.github.com>
2021-07-22 12:49:14 -04:00
Justin Van Patten 30311405ca
[sdk/go] Fix methods panic when marshaling self (#7604) 2021-07-22 05:28:46 -07:00
Sean Fausett 12217bd0dc
Fix async await warnings (#7537)
* Revert remove redundant async await
* Fix resharper code issues
* Update changelog
2021-07-21 18:44:10 -04:00
Komal 131ac1ba61
[cli] - Don't escape special characters when printing JSON (#7593)
Co-authored-by: Pat Gavlin <pat@pulumi.com>
2021-07-21 15:16:49 -07:00
Pat Gavlin ece9f2fb30
[sdk/{go,dotnet] Unmarshal invalid assets. (#7579)
The two more strongly-typed Pulumi SDKs curently fail with an error
during unmarshaling when attempting to marshal a value that is not an
asset into an asset-typed location (e.g. an asset-typed resource
output property). While this behavior is reasonable on its face, it
gives rise to practical challenges when dealing with TF-provider-backed
resources that have asset-typed properties. When such a resource is
refreshed, the values of its asset-typed properties are replaced with
non-asset values, as the TF bridge can't currently create a resonable
stand-in asset value.

For example, consider an S3 bucket object:

```
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const bucket = new aws.s3.Bucket("my-bucket");
new aws.s3.BucketObject("my-object", {
    source: new pulumi.FileAsset("some/file"),
});
```

Upon creation, the value of the input property `source` will be a file
asset backed by the path `some/file`. The bridge will propagate this
value to the `source` output property; this propagation is safe because
the resource was just created and so the output property must have the
value that was passed by the program.

Now, let some actor apply out-of-band changes to the contents of the
bucket object s.t. the `source` property changes when the object is
refreshed. In that case, the `source` property will be a string value
which the bridge is unable to interpret as an asset. The next time the
Pulumi program is run, the Go or .NET SDK will attempt to deserialize
the string into an asset-typed property and will fail.

With these changes, the deserialization would not fail, and would
instead create an asset or archive value that will fail to marshal if
passed to another resource. Users can avoid these errors by not passing
asset or archive outputs to other resources/stack outputs.

These changes unblock users who are hitting
https://github.com/pulumi/pulumi-aws/issues/1521.
2021-07-21 13:40:36 -07:00
Sean St. Quentin 81f87b0c6a
Fix the Go Automation API's Target and Replace CLI options (#7426)
* Add missing Sprintf calls

* Fix target and replace options change

Co-authored-by: Komal <komal@pulumi.com>
2021-07-20 17:43:01 -07:00
Hossam Barakat 3fabf45542
Set PULUMI_CONFIG_PASSPHRASE for Automation Tests (#7502) 2021-07-20 17:18:30 -07:00
Komal a1b7f64bdd
[docgen/go] - Fix go docgen links for pulumi types (#7558) 2021-07-20 15:57:48 -07:00
Komal 5de09409f6
[codegen/dotnet] - Dynamic provider config getters (#7549) 2021-07-20 10:22:45 -07:00
Mikhail Shilkov 6fbe6ad651
Set UseSharedCompilation to false (#7577) 2021-07-20 15:50:37 +02:00
Justin Van Patten 68458bfab3
[sdk/python] Support for implementing methods in provider (#7555) 2021-07-19 14:58:55 -07:00
Justin Van Patten 8c4a56acb7
[sdk/dotnet] Clean obj & bin dirs when building (#7562) 2021-07-19 11:22:08 -07:00
stack72 a710c98437 Cleanup after v3.7.1 release 2021-07-19 18:09:30 +01:00
stack72 4e4fe65b36 Prepare for v3.7.1 release 2021-07-19 11:35:50 +01:00
Luke Hoban 9b17afe350
Fix CHANGELOG for 7541 (#7563) 2021-07-18 09:00:41 +01:00
Luke Hoban 0bcca3883e
[sdk] Wait on remote component dependencies (#7541)
When a resource `dependsOn` a remote component, we were not correctly waiting on it, because we were skipping over waiting on comoponents, and only waiting on their custom resource children.  For remote components, we do not know the children, but waiting on the remote component will always wait on all children.

Co-authored-by: Mike Metral <1112768+metral@users.noreply.github.com>
2021-07-16 16:11:34 -07:00
Pat Gavlin 28b1a25629
[codegen/python] Improve program gen perf. (#7547)
- Only build casing tables once per package
- Right-size buffers in name generation

These changes lead to a significant speedup in example gen for
azure-native.
2021-07-16 15:45:00 -07:00
Nikhil Benesch c782a298a1
Make Output[T] covariant in Python SDK (#7483)
In short, this allows subtyping to correctly "propagate" through an Output;
if Cow is a subtype of Animal, this commit makes it so Output[Cow] is
treated as a subtype of Output[Animal].

Without this change, users of the Python SDK occasionally contend with a
confusing error message that is resolved by adding a call to
`.apply(lambda x: x)` to satisfy mypy.

Touches #3767.
Fix #6843.
2021-07-16 12:30:04 -07:00