Commit graph

31 commits

Author SHA1 Message Date
Justin Van Patten
dab47e9b40
[sdk/dotnet] RegisterResourceOutputs: Check for resource ref support (#6172)
.NET's implementation of RegisterResourceOutputs was always serializing resources as resource references, regardless of the monitor's reported support. This change fixes .NET to check if the monitor supports resource references, which is consistent with all the other languages, and with serialization code elsewhere in the .NET SDK.
2021-01-21 17:04:21 -08:00
Levi Blackstone
4d48ee0517
Enable resource reference feature by default (#5905)
* Enable resource reference feature by default

Unless the PULUMI_DISABLE_RESOURCE_REFERENCES flag
is explicitly set to a truthy value, the resource reference feature is now
enabled by default.

* Set AcceptResources in the language SDKs

This can be disabled by setting the `PULUMI_DISABLE_RESOURCE_REFERENCES` environment variable to a truthy value.

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2020-12-10 11:21:05 -07:00
Mikhail Shilkov
cab39dcfa0
[dotnet] Resource package registration in .NET (attributes) (#5875)
* Resource package registration in .NET
* Refactor to attribute-based discovery
* Refactor to derived attributes
2020-12-09 23:28:58 +01:00
Nathan Winder
0bdf73341b
Enable creation of TStack using IServiceProvider (#5723)
* Enable creation of TStack using IServiceProvider to enable dependency injection.

* fixed line endings

* update change log

* Added PR link to change log

* fixed change log

* Added integration test

* Review adjustments

Co-authored-by: Mikhail Shilkov <github@mikhail.io>
2020-11-30 16:43:18 +01:00
Mikhail Shilkov
ebb4ddb86a
Add support for getResource to the .NET SDK (#5817) 2020-11-23 20:55:03 +01:00
Pat Gavlin
44376738f6
Add resource modules. (#5645)
This is necessary due to the way we've factored the libraries imported
by users into modules. The primary alternative is to ensure that each
child module imports the root module for a package and registers itself
with that package where necessary to prevent circular dependencies. This
simplifies the core SDKs slightly at the cost of greater complications
in the generated SDKs; the approach taken by these changes seems like a
more maintainable option.

Contributes to #2430.

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2020-11-04 10:24:41 -08:00
Pat Gavlin
3d2e31289a
Add support for serialized resource references. (#5041)
Resources are serialized as their URN, ID, and package version. Each
Pulumi package is expected to register itself with the SDK. The package
will be invoked to construct appropriate instances of rehydrated
resources. Packages are distinguished by their name and their version.

This is the foundation of cross-process resources.

Related to #2430.

Co-authored-by: Mikhail Shilkov <github@mikhail.io>
Co-authored-by: Luke Hoban <luke@pulumi.com>
Co-authored-by: Levi Blackstone <levi@pulumi.com>
2020-10-27 10:12:12 -07:00
Mikhail Shilkov
4f07891595
[dotnet] Add a lock around child resource manipulation (#5563)
[dotnet] Add a lock around child resource manipulation to prevent hashset concurrency issue

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2020-10-13 19:28:57 +02:00
Justin Van Patten
df75f0ed95
Support remote components in .NET (#5485) 2020-10-06 10:19:22 -07:00
Mikhail Shilkov
f0386bec8d
Prevent concurrency issues when completing tasks (#5324)
* Prevent concurrency issues when completing tasks
2020-09-11 14:34:43 +02:00
Mikhail Shilkov
fe66a0ba6d
Speed up .NET programs with large number of resources (#5015)
* Speed up .NET programs with large number of resources
2020-07-21 10:50:14 +02:00
Justin Van Patten
653dcf8f1f
Don't call IMocks.NewResourceAsync for the root stack resource (#4527) 2020-04-30 10:38:48 -07:00
komal
2776a80a14 remove unneeded types 2020-04-23 17:58:17 -07:00
komal
6a869fa0f3 fix c# channel option 2020-04-23 17:30:23 -07:00
Komal Ali
9cf635ad5a pr changes 2020-04-23 11:16:36 -07:00
Komal Ali
64f3c4a02a update sdks with new max message size 2020-04-23 11:16:36 -07:00
CyrusNajmabadi
66bd3f4aa8
Breaking changes due to Feature 2.0 work
* Make `async:true` the default for `invoke` calls (#3750)

* Switch away from native grpc impl. (#3728)

* Remove usage of the 'deasync' library from @pulumi/pulumi. (#3752)

* Only retry as long as we get unavailable back.  Anything else continues. (#3769)

* Handle all errors for now. (#3781)


* Do not assume --yes was present when using pulumi in non-interactive mode (#3793)

* Upgrade all paths for sdk and pkg to v2

* Backport C# invoke classes and other recent gen changes (#4288)

Adjust C# generation

* Replace IDeployment with a sealed class (#4318)

Replace IDeployment with a sealed class

* .NET: default to args subtype rather than Args.Empty (#4320)

* Adding system namespace for Dotnet code gen

This is required for using Obsolute attributes for deprecations

```
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'ObsoleteAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'Obsolete' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
```

* Fix the nullability of config type properties in C# codegen (#4379)
2020-04-14 09:30:25 +01:00
Mikhail Shilkov
46dababc28
Add additional RunAsync overloads (#4286) 2020-04-09 16:43:43 +02:00
Mikhail Shilkov
a95a4d1195
Unit testing in .NET (#3696)
Mock-based testing in .NET
2020-03-11 23:10:01 +01:00
CyrusNajmabadi
ee6b545358
Be resilient to duplicate tasks in our inflight task list. (#3887) 2020-02-06 15:29:41 -08:00
Mikhail Shilkov
169a1e6a70
Dictionary resource in .NET (#3828)
Dictionary resource for Kubernetes YAML support
2020-02-05 21:22:30 +01:00
Mikhail Shilkov
66de4a48b7
First-class Stack component for .NET (#3618)
First-class Stack component for .NET
2019-12-23 08:31:12 +01:00
Justin Van Patten
a83a5d9605
.NET: Treat warnings as errors (#3650)
Fix the following warning and turn on "treat warnings as errors" for our .NET projects.

```
Deployment/InvokeOptions.cs(6,60): warning CS1574: XML comment has cref attribute 'InvokeAsync{T}(string,
```
2019-12-12 17:13:26 +00:00
CyrusNajmabadi
eedd277cd7 Update copyrights (#3557) 2019-11-21 22:46:14 +01:00
CyrusNajmabadi
57421c1ab3
Allow arguments to Invokes to be non-inputs. (#3544) 2019-11-21 00:40:38 -05:00
Mikhail Shilkov
6f55e1a82a
Tests for .NET aliases (#3420)
Tests for .NET aliases
2019-11-20 22:07:56 +03:00
Justin Van Patten
1a6897ba26
Better error message when trying to use dotnet run (#3479)
After creating an initial Pulumi .NET project, it will be natural for some folks (who are unfamiliar with Pulumi) to try to run it via `dotnet run`, as that's how you'd typically run a .NET Core program. Doing so today fails with:

```
Unhandled exception. System.InvalidOperationException: Environment did not contain: PULUMI_MONITOR
   at Pulumi.Deployment..ctor()
   at Pulumi.Deployment.RunAsync(Func`1 func)
   at Pulumi.Deployment.RunAsync(Func`1 func)
   at Pulumi.Deployment.RunAsync(Action action)
   at Program.Main() in /Users/user/temp/quickstart/Program.cs:line 9
   at Program.<Main>()
```

Instead, provide a more descriptive error message indicating that the pulumi CLI should be used to run the program. We return the same error as we do for Node.js and Python.

```
Unhandled exception. System.InvalidOperationException: Program run without the Pulumi engine available; re-run using the `pulumi` CLI
   at Pulumi.Deployment..ctor()
   at Pulumi.Deployment.RunAsync(Func`1 func)
   at Pulumi.Deployment.RunAsync(Func`1 func)
   at Pulumi.Deployment.RunAsync(Action action)
   at Program.Main() in /Users/user/temp/quickstart/Program.cs:line 9
   at Program.<Main>()
```
2019-11-09 17:05:24 +00:00
CyrusNajmabadi
3ec525135d
Fix null ref. Add Tuple overloads up to 8 params. (#3471) 2019-11-07 23:58:23 -08:00
CyrusNajmabadi
df12fa7574
Don't read a resource if the Id we got was null or empty. (#3410) 2019-10-27 00:06:16 -07:00
CyrusNajmabadi
a343bb015f
Fix null argument in reads (#3409) 2019-10-26 14:17:42 -07:00
CyrusNajmabadi
394c91d7f6
Add **preview** .NET Core support for pulumi. (#3399) 2019-10-25 16:59:50 -07:00