* Run make ensure on devcontainer creation
Added an ensure target to the dotnet makefile to run `dotnet restore`.
* Add dotnet test explorer and set default vscode settings for it
* Ensure PULUMI_LOCAL_NUGET exists
* Add missing mkdirs
* Don't throw on type mismatches in the dotnet sdk
Fixes#7329
The converter will no longer throw if resource providers return data
that does not match the expected type declared in the dotnet sdk.
Instead a warning will be logged for the resource and the value will be
set to `default(T)`.
While our CI seems happy with this line of code on master, my machine
with the 3.1 sdk is resolving it to non-nullable type and complaining
about the "= null" line later.
```
LocalWorkspace.cs(389,27): error CS8600: Converting null literal or
possible null value to non-nullable type.
[/workspaces/pulumi/sdk/dotnet/Pulumi.Automation/Pulumi.Automation.csproj]
```
Quick fix to just not use "var" here.
* .NET & python SDKs parity for bad pulumi versions
They handle invalid Pulumi CLI version gracefully.
* Make python version property lazy
* Clarify .NET logic
* Add python test for validate_pulumi_version
* Add tests for invalid versions
* Fix python test
* Fix typo
* Fix tests
* Have _validate_pulumi_version handle parsing
* Modify python and .NET to parseAndValidate
* Modify typescript and go to parseAndValidate
* fix name
* Fix race condition in TaskMonitoringHelper
Fixes#8163
TaskMonitoringHelper was using two seperate trackers for Idle and
FirstException and then calling WhenAny on both to see which state
happened first. This was racy as you could end up completing a task with
an exception but getting the idle tracker fire first, resulting in
TaskMonitoringHelper thinking no exception had happened.
I've combined the two trackers into TaskMonitoringHelper now. At each
task completion we check for exceptions and then idleness.
* Add changelog
* 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>
* 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>
* 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
* 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
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.
* 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>
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.
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>
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>
* 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
* 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>
Temporarily disable the new config secret warning to avoid unactionable warnings from provider `config` modules. We'll re-enable the warning when we've addressed that issue.
* Propagate workspace.Project metadata to plugin init
* Get to a working fix
* Propagate Root via plugin context
* Propagate root instead of yaml path
* Revert out unnecessary parameter propagation
* Root is now always absolute at this point; simplify code and docs
* Drop python conditional and propagate unused -root to all lang hosts
* Add tests that fail before and pass after
* Lint
* Add changelog entry
The Pulumi .NET SDK does not currently await all outstanding asynchronous
work associated with a Pulumi program. Because all relevant asynchronous
work is created via the Pulumi SDK, we can track this asynchronous work
and ensure that it has all completed prior to returning from
`Deployment.RunAsync`.
The implementation here is simpler than that in #6983, and re-uses the
existing support for tracking outstanding RPCs. If this proves to
negatively impact performance (which is a very real possibility for
programs that create many `Output` instances), we can simplify this
using a semaphore and a counter (essentially Go's `sync.WaitGroup`).
This fixes the .NET portion of #3991.