Commit Graph

27 Commits

Author SHA1 Message Date
Fraser Waters e554b2623b
Finish supporting dotnet conformance ()
Last few changes needed to get the dotnet repo passing conformance
tests.
2024-04-22 06:37:50 +00:00
Fraser Waters 0d97a25449 Remove UseSharedCompilation from .csproj codegen
Fixes https://github.com/pulumi/pulumi/issues/13145
2023-06-09 23:37:10 +01:00
Fraser Waters 7efaff1e04 Fix whitespace in generated .csproj files 2023-03-31 23:33:02 +01:00
Fraser Waters 1154d8c072 Write <Version> to .csproj when respectSchemaVersion is set
This is more in alignment with the other languages where when
respectSchemaVersion is set we write the version to the project file
(pacakge.json for NodeJS, setup.py for Python) so that no version
information has to be set on the build command itself.
2023-03-27 15:54:16 +01:00
Fraser Waters 677b1d5e60 Update dotnet codegen to net6.0 2023-03-02 16:35:38 +00:00
Anton Tayanovskyy af937ec2b9
Revert "Update Pulumi codegen to net6.0" 2023-01-10 09:12:56 -08:00
Abhinav Gupta 0bff0b8716 sdk/go: Remove 'nolint' directives from package docs
Go treats comments that match the following regex as directives.

    //[a-z0-9]+:[a-z0-9]

Comments that are directives don't show in an entity's documentation.
5a550b6951 (diff-f56160fd9fcea272966a8a1d692ad9f49206fdd8dbcbfe384865a98cd9bc2749R165)

Our code has `//nolint` directives that now show in the API Reference.
This is because these directives are in one of the following forms,
which don't get this special treatment.

    // nolint:foo
    //nolint: foo

This change fixes all such directives found by the regex:
`// nolint|//nolint: `.
See bottom of commit for command used for the fix.

Verification:
Here's the output of `go doc` on some entities
before and after this change.

Before
```
% go doc github.com/pulumi/pulumi/sdk/v3/go/pulumi | head -n8
package pulumi // import "github.com/pulumi/pulumi/sdk/v3/go/pulumi"

nolint: lll, interfacer

nolint: lll, interfacer

const EnvOrganization = "PULUMI_ORGANIZATION" ...
var ErrPlugins = errors.New("pulumi: plugins requested")
```

After
```
% go doc github.com/pulumi/pulumi/sdk/v3/go/pulumi | head -n8
package pulumi // import "github.com/pulumi/pulumi/sdk/v3/go/pulumi"

const EnvOrganization = "PULUMI_ORGANIZATION" ...
var ErrPlugins = errors.New("pulumi: plugins requested")
func BoolRef(v bool) *bool
func Float64Ref(v float64) *float64
func IntRef(v int) *int
func IsSecret(o Output) bool
```

Before
```
% go doc github.com/pulumi/pulumi/sdk/v3/go/pulumi URN_
package pulumi // import "github.com/pulumi/pulumi/sdk/v3/go/pulumi"

func URN_(o string) ResourceOption
    URN_ is an optional URN of a previously-registered resource of this type to
    read from the engine. nolint: revive
```

After:
```
% go doc github.com/pulumi/pulumi/sdk/v3/go/pulumi URN_
package pulumi // import "github.com/pulumi/pulumi/sdk/v3/go/pulumi"

func URN_(o string) ResourceOption
    URN_ is an optional URN of a previously-registered resource of this type to
    read from the engine.
```

Note that golangci-lint offers a 'nolintlint'  linter
that finds such miuses of nolint,
but it also finds other issues so I've deferred that to a follow up PR.

Resolves 

Related: https://github.com/golangci/golangci-lint/issues/892

[git-generate]
FILES=$(mktemp)
rg -l '// nolint|//nolint: ' |
  tee "$FILES" |
  xargs perl -p -i -e '
    s|// nolint|//nolint|g;
    s|//nolint: |//nolint:|g;
  '
rg '.go$' < "$FILES" | xargs gofmt -w -s
2023-01-06 09:06:47 -08:00
Fraser Waters 0c38cb69dd Update Pulumi codegen to net6.0
.NET Core 3.1 is out of support on December 13th:
https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core

We've already stopped testing on .NET Core 3.1, and program gen has been
targetting only 6.0 for a while now as well.

This updates sdkgen to only 6.0 as well.
2022-12-15 09:28:03 +00:00
Zaid Ajaj 9ab26c7703
[dotnet/codegen] Prefix referenced Pulumi types with global modifier ()
* Prefix referenced Pulumi types with global modifier

* Changelog entry
2022-07-27 11:24:21 +02:00
Aaron Friel 92258c3864
fix: enable codegen for resources named, e.g., Environment ()
* fix: enable codegen for resources named, e.g., Environment

* address PR comments
2022-04-04 15:06:03 -07:00
Ian Wahbe 90913de3fb
[codegen/dotnet] Allow generated SDKs to have a global namespace other then `Pulumi` ()
* Allow .NET packages alternate owners

Specifically, this allows a generated package with a enclosing namespace
different then "Pulumi."

* New test case files

* Remove unused import

* Update CHANGELOG_PENDING.md

* Update codegen from master merge

* Use rootNamespace instead of namespace

* publisher overrides Author and "Company" in .NET

* Add publisher propagation to CHANGELOG_PENDING.md

* Fix nits

* Use fmt.Sprintf over +

* Restore sdk_driver.go (mostly)

* Add docs to allLanguages add documentation.

* Update tests from master

* Add rootNamespace to docs
2022-01-21 12:58:11 -08:00
Ian Wahbe 2f04a6931f
[sdk/dotnet] add plugin download url ()
* [sdk/dotnet] Add PluginDownloadURL

* Update CHANGELOG_PENDING.md

* Add dotnet test

* Set Random resource.remote = false

* Add codegen

* Codegen changes to Utilizes.cs

* Fix ResourceOptions.merge

* Remove WithVersion

* Fix local test environment

* Add WithVersion back (marked as obsolete)

* Fix ResourceOptions.Copy

* Use null coalescence operator

* Set csharp to use projectReferences

* Add PluginDownloadURL to CallOptions

* Populate CallOptions in codegen

* Revert "Populate CallOptions in codegen"

This reverts commit e3397e0733.

* Make backwards compatible with previous sdks

* Run integration tests on MacOS

* Attempt to fix macos build error

* Disable full testing suite (MacOS)
2022-01-13 16:10:17 -08:00
Anton Tayanovskyy a72cccee73
Revert "[sdk/dotnet] Add PluginDownloadURL ()" ()
This reverts commit bf93ed714d.
2022-01-12 17:25:25 -05:00
Ian Wahbe bf93ed714d
[sdk/dotnet] Add PluginDownloadURL ()
* [sdk/dotnet] Add PluginDownloadURL

* Update CHANGELOG_PENDING.md

* Add dotnet test

* Set Random resource.remote = false

* Add codegen

* Codegen changes to Utilizes.cs

* Fix ResourceOptions.merge

* Remove WithVersion

* Fix local test environment

* Add WithVersion back (marked as obsolete)

* Fix ResourceOptions.Copy

* Use null coalescence operator

* Set csharp to use projectReferences

* Add PluginDownloadURL to CallOptions

* Populate CallOptions in codegen

* Revert "Populate CallOptions in codegen"

This reverts commit e3397e0733.

* Make backwards compatible with previous sdks
2022-01-11 17:36:48 -08:00
Justin Van Patten 043c42b336
Use `pulumi-plugin.json` rather than `pulumiplugin.json` ()
Current/older versions of the Python language host cannot read `pulumiplugin.json` without returning an error. This hasn't been a problem because none of our packages have included the file. However, we're going to start including this file by default in packages. To avoid this error on older CLIs, we'll use a different file name. And since we're introducing the use of this file in the .NET and Go language hosts, we'll use the new name for these languages as well for consistency.
2021-12-15 10:41:44 -08:00
Ian Wahbe 05e26e384a
[codegen/dotnet] Emit `pulumiplugin json` during codegen ()
* Emit `pulumiplugin.json` during codegen

* Update codgen tests

* Update CHANGELOG_PENDING.md
2021-12-02 12:47:33 -08:00
Anton Tayanovskyy e710125885
5758 for C#/.NET ()
* Rebase 5758 .NET work and make output-funcs pass

* Propagate changes to the other examples

* CHANGELOG

* Address PR feedback

* Add a test reproducing aws-native compilation failure

* Fix dangling type ref issue in the .NET backend for codegen

* Accept changes and unskip simple-methods-schema compile check

* Accept changes in node, python, go codegen

* SDK changes to enable a better implementation approach

* Switch approach to support functions like GetAmiIds; avoid name conflicts under tfbridge20

* Make all dotnet tests pass, mechanical fixes + accept test output

* Accept python changes

* Accept node output

* Accept docs changes

* Deepen the unit test to cover the interesting helper type

* Accept go changes and fixup tests

* Implement dep propagation through Invoke

* Fixup cyclic-types

* Accept codegen

* NOTE we now require .NET SDK 3.15 or higher
2021-10-18 18:18:15 -04:00
Mikhail Shilkov 6fbe6ad651
Set UseSharedCompilation to false () 2021-07-20 15:50:37 +02:00
Sean Fausett 276d3570ed Enable deterministic builds 2021-04-29 14:24:43 +12:00
pulumi-bot 73a66f48ea [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
Justin Van Patten 277dee6cc1
[codegen/dotnet] Fixes to version.txt ()
We currently include `version.txt` in the package via `<Content Include="version.txt">`. This places the file in the NuGet package in two locations: the `content` directory and `contentFiles`.

We want the file to be in `content` because this is where the Pulumi .NET Language host looks for the file when determining a program's required plugins.

However, having the file in `contentFiles` is problematic. For packages that reference other Pulumi resource packages (e.g. for multi-lang components), referenced `contentFiles` are included in the package by default. This means another package's `version.txt` will be included and used over the current project's `version.txt`. For example, if a multi-lang component package `Pulumi.Xyz` references `Pulumi.Aws`, the `version.txt` from `Pulumi.Aws` will be used in `Pulumi.Xyz` package rather than the intended `version.txt` for `Pulumi.Xyz`.

To address this, stop including `version.txt` in `contentFiles`. We do this by changing the `<Content Include="version.txt" />` to `<None Include="version.txt" Pack="True" PackagePath="content" />` in the project file. This  ensures the file will still be included in the package in the `content` dir (where the Pulumi .NET language host expects to find it), but doesn't include the file in `contentFiles` which would cause it to be used in other packages that reference the package.

Further, when generating `<PackageReference>`s for packages that start with "Pulumi.", include an additional `ExcludeAssets="contentFiles"` attribute to prevent the package's `contentFiles` from being included.
2021-02-22 08:33:16 -08:00
Mikhail Shilkov cab39dcfa0
[dotnet] Resource package registration in .NET (attributes) ()
* Resource package registration in .NET
* Refactor to attribute-based discovery
* Refactor to derived attributes
2020-12-09 23:28:58 +01:00
Mikhail Shilkov 5cef84f036
Read .NET plugin name from version.txt () 2020-10-28 15:53:29 +01:00
Sean Fausett a38bbaa221
Enable SourceLink with embedded PDB () 2020-07-21 16:55:08 +02:00
Pat Gavlin 1f19cbbe08
Clean up the language-specific schema APIs. ()
Rather than forcing consumers to deal with language-specific data
ad-hoc, add an API that allows all language-specific data to be decoded
up-front.
2020-04-20 16:36:05 -07:00
CyrusNajmabadi 66bd3f4aa8
Breaking changes due to Feature 2.0 work
* Make `async:true` the default for `invoke` calls ()

* Switch away from native grpc impl. ()

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

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

* Handle all errors for now. ()


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

* Upgrade all paths for sdk and pkg to v2

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

Adjust C# generation

* Replace IDeployment with a sealed class ()

Replace IDeployment with a sealed class

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

* 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 ()
2020-04-14 09:30:25 +01:00
Pat Gavlin d400f26832
Add a schema package and code generators. ()
The schema format is described in pkg/codegen/schema/schema.go. The code
generators are derived from the code generators contained in
https://github.com/pulumi/pulumi-terraform-bridge/pkg/tfgen, with the
exception of the Go code generator, which is net new.
2020-01-21 14:45:48 -08:00