Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider support for dotnet #9496

Closed
wants to merge 1 commit into from
Closed

Provider support for dotnet #9496

wants to merge 1 commit into from

Conversation

Frassle
Copy link
Member

@Frassle Frassle commented Apr 29, 2022

Description

This adds a new namespace to the dotnet sdk "Provider" with classes to support the writing of a native dotnet provider.

The Provider class will internally deal with our grpc protocol and call into virtual methods given by the user which use only dotnet native domain models.

It is a bit sad all this is manually written, I feel like there might be a good way to codegen this from the protobuf specs such that if they ever change this file could stay in sync.

Also the PropertyValue Marshal/Unmarshal duplicates a lot of the existing serialization logic, and I think that logic could be rewritten as a layer ontop of this (that is we'd have "objects -> PropertyValues" and "PropetyValues -> grpc" rather than what we currently have which is "objects -> grpc" and now "PropertyValues -> grpc")

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@pulumi-bot
Copy link
Contributor

pulumi-bot commented Oct 12, 2022

Changelog

[uncommitted] (2022-11-28)

@Frassle Frassle force-pushed the fraser/dotnetProvider branch 3 times, most recently from 1e6d5f2 to 152e3ad Compare October 17, 2022 11:26
@Frassle Frassle force-pushed the fraser/dotnetProvider branch 4 times, most recently from 26e761a to d0a7814 Compare November 27, 2022 21:28
This adds a new namespace to the dotnet sdk "Provider" with classes to support the writing of a native dotnet provider.

The Provider class will internally deal with our grpc protocol and call into virtual methods given by the user which use only dotnet native domain models.

It is a bit sad all this is manually written, I feel like there _might_ be a good way to codegen this from the protobuf specs such that if they ever change this file could stay in sync.

Also the PropertyValue Marshal/Unmarshal duplicates a lot of the existing serialisation logic, and I think that logic could be rewritten as a layer ontop of this (that is we'd have "objects -> PropertyValues" and "PropetyValues -> grpc" rather than what we currently have which is "objects -> grpc" and now "PropertyValues -> grpc")
public sealed class InvokeResponse
{

public IDictionary<string, PropertyValue>? Return { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the work being done in #11418, it should be possible to define an invoke response that returns a single PropertyValue rather than a bag of these

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeh I'll probably rejig this, few other things I've copied from the go SDK which are more legacy than really needed.

@Frassle
Copy link
Member Author

Frassle commented Dec 21, 2022

I'll move this over to pulumi-dotnet

@Frassle Frassle closed this Dec 21, 2022
@Frassle Frassle deleted the fraser/dotnetProvider branch December 21, 2022 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants