pulumi icon indicating copy to clipboard operation
pulumi copied to clipboard

[codegen/dotnet] Honor C# language name overrides for constructor params of output types

Open praneetloke opened this issue 11 months ago • 9 comments

Description

NOTE: This PR picks up from a previous PR https://github.com/pulumi/pulumi/pull/14246 now that pulumi/pulumi-dotnet#231 is merged.

This PR updates the dotnet codegen to emit OutputConstructorParameterAttribute attribute for constructor parameters that have a C#-specific language override defined in the provider's Pulumi schema.

Fixes #14130

Checklist

  • [x] I have run make tidy to update any new dependencies
  • [x] I have run make lint to verify my code passes the lint check
    • [x] I have formatted my code using gofumpt
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] I have run make changelog and committed the changelog/pending/<file> documenting my change
  • [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version

praneetloke avatar Mar 09 '24 18:03 praneetloke

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

github-actions[bot] avatar Mar 09 '24 18:03 github-actions[bot]

Changelog

[uncommitted] (2024-04-27)

Bug Fixes

  • [sdkgen/dotnet] Output type constructor parameters respect property name overrides

pulumi-bot avatar Mar 09 '24 18:03 pulumi-bot

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

github-actions[bot] avatar Mar 09 '24 18:03 github-actions[bot]

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

github-actions[bot] avatar Mar 09 '24 19:03 github-actions[bot]

@praneetloke Are you planning to finish this PR, or should we close it? (I'm just doing some housekeeping here)

mikhailshilkov avatar Apr 09 '24 07:04 mikhailshilkov

@mikhailshilkov this PR is blocked by a pending release of pulumi-dotnet that includes the newly added attribute for constructor params of output types.

praneetloke avatar Apr 09 '24 15:04 praneetloke

@mikhailshilkov I've marked this as ready for review. pulumi-dotnet's 3.61.0 contains the C# attribute this PR uses in the codegen. My understanding is that the project reference emitted by the codegen automatically picks up the newest minor version as per https://github.com/pulumi/pulumi/blob/master/pkg/codegen/dotnet/gen.go#L2263. Let me know if that's not true?

praneetloke avatar Apr 27 '24 17:04 praneetloke

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

github-actions[bot] avatar Apr 27 '24 17:04 github-actions[bot]

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

github-actions[bot] avatar Apr 27 '24 17:04 github-actions[bot]

/run-acceptance-tests Please view the results of the acceptance tests Here

Frassle avatar Jun 10 '24 11:06 Frassle

/home/runner/work/pulumi/pulumi/tests/testdata/codegen/regress-dotnet-14130/dotnet/Outputs/ExampleType.cs(24,14): error CS0246: The type or namespace name 'OutputConstructorParameterAttribute' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/pulumi/pulumi/tests/testdata/codegen/regress-dotnet-14130/dotnet/Pulumi.Example.csproj]

Tests aren't happy. I think the nuget dependency constraint needs updating.

Frassle avatar Jun 11 '24 12:06 Frassle

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

github-actions[bot] avatar Oct 03 '24 09:10 github-actions[bot]

👋 I just noticed that this is still open. I am not sure if it's needed anymore though.

praneetloke avatar Oct 03 '24 09:10 praneetloke