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.
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#11785
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
* 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
* [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)
* [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
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.
* 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
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.
* 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)
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.