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

Initial implementation for resource identity #278

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

rainkwan
Copy link

@rainkwan rainkwan commented Feb 11, 2025

Adds the new request fields and response fields to support resource identity in mux including RPCs GetResourceIdentitySchemas and UpgradeResourceIdentity.

Plugin-Go: Reference: hashicorp/terraform-plugin-go#476

TODO:

  • Update Changie if needed

Later TODO:

  • Update terraform-plugin-go version upon release
  • Update temporary interface ProviderServerWithResourceIdentity back to ProviderServer

@rainkwan rainkwan requested a review from a team as a code owner February 11, 2025 06:28
@rainkwan rainkwan marked this pull request as draft February 11, 2025 06:31
@ansgarm ansgarm force-pushed the rk/resource-identity branch from 2c093b3 to 6655aba Compare February 11, 2025 11:06
@ansgarm ansgarm force-pushed the rk/resource-identity branch from 6655aba to 472731f Compare February 11, 2025 11:07
@rainkwan rainkwan changed the title Started implementing resource identity for tf5muxserver Initial implementation for resource identity Feb 11, 2025
@rainkwan rainkwan marked this pull request as ready for review February 11, 2025 20:04
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

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

I left some comments on the v5 stuff (skipped v6 since it's likely the same feedback).

Main thing to consider is potentially just using the existing resource routing over introducing a new resource identity routing.


Also if you'd like to add the changelogs now that's cool! (or a follow-up PR)

.golangci.yml Show resolved Hide resolved
Comment on lines +276 to +279
//nolint:staticcheck // Intentionally verifying interface implementation
func (s *TestServer) ProviderServerWithResourceIdentity() tfprotov6.ProviderServerWithResourceIdentity {
return s
}
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove this after initial development, since we know the interface is going to disappear soon (and we're not actually using it here) 👍🏻

Copy link
Member

Choose a reason for hiding this comment

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

So I suppose we should add a todo comment to remove this? Or would you remove this even before this PR is merged?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah my point is that the PR doesn't need it at all. (similar to what we did with SDKv2 this morning in our 1/1)

It's useful to generate the initial methods, then we can remove it since it's not actually required.

Comment on lines +276 to +280

//nolint:staticcheck // Intentionally verifying interface implementation
func (s *TestServer) ProviderServerWithResourceIdentity() tfprotov5.ProviderServerWithResourceIdentity {
return s
}
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove this after initial development, since we know the interface is going to disappear soon (and we're not actually using it here) 👍🏻

internal/tfprotov6tov5/tfprotov6tov5_test.go Outdated Show resolved Hide resolved
internal/tfprotov6tov5/tfprotov6tov5_test.go Outdated Show resolved Hide resolved
internal/tfprotov5tov6/tfprotov5tov6_test.go Outdated Show resolved Hide resolved
tf5muxserver/mux_server.go Outdated Show resolved Hide resolved
tf5muxserver/mux_server_GetResourceIdentitySchemas.go Outdated Show resolved Hide resolved
tf5muxserver/mux_server_GetResourceIdentitySchemas.go Outdated Show resolved Hide resolved
tf5muxserver/mux_server_UpgradeResourceIdentity.go Outdated Show resolved Hide resolved
@austinvalle austinvalle added this to the v0.19.0 milestone Feb 12, 2025
@austinvalle
Copy link
Member

I created two issues and added them to our milestones to cleanup the assertions after the next release 👍🏻

@ansgarm ansgarm force-pushed the rk/resource-identity branch from 656dec9 to 5ecec55 Compare February 13, 2025 10:23
…e identity to be implemented by the same server, so we'll always follow resources
@ansgarm ansgarm force-pushed the rk/resource-identity branch from 5ecec55 to 4c31d1f Compare February 13, 2025 10:28
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.

3 participants