-
Notifications
You must be signed in to change notification settings - Fork 95
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
Unable to programmatically select framework version #855
Comments
Hi @jacobbednarz 👋 Thank you for raising this. Since this issue does not seem to suggest existing terraform-plugin-framework functionality that is not working as expected, I'm going to relabel this issue as an enhancement.
To dive a little further in this use case, is there a particular reason why the framework's versioning, over the provider's own versioning, is important for this observability? Is this so you can determine whether a resource was implemented using terraform-plugin-sdk versus terraform-plugin-framework? If getting the framework versioning is critical, Go module code such as provider code, can fetch this information automatically using Go standard library functionality. The Does using that |
thanks! I wasn't sure on the expected compatibility with SDKv2 so I'll keep this in mind for the future too.
correct. furthermore, if an issue is identified in one of the plugin types, we can assess how many others are impacted by the potential bug.
I mentioned it in the linked issue as well but will post here for posterity too, I'm happy swapping to this method if it is the blessed approach. My concern was that because it wasn't getting used/exported that way that we were reaching into internals that we shouldn't and relying on an unstable interface. |
Before this change, we relied on the plugin libraries to expose their version. Unfortunately, this was incorrectly set in SDKv2[1] and non-existent in the framework[2]. The recommended approach is to instead dig into the build information via`runtime/debug.ReadBuildInfo()`[3] which is what we introduce here in a slightly safer and consistent way. [1]: hashicorp/terraform-plugin-sdk#1257 [2]: hashicorp/terraform-plugin-framework#855 [3]: https://pkg.go.dev/runtime/debug#ReadBuildInfo Signed-off-by: Jacob Bednarz <jacob.bednarz@gmail.com>
Hi again, @jacobbednarz! It looks like you may have tried out the new way in the latest provider release. Is it working okay for you? |
i have thank you very much. with help from yourself and @austinvalle, this was sorted in the linked SDK issue. given the vibe is that you don't want to expose this via a helper method and instead favour the |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Module version
Within the SDKv2, the
meta
package exposesSDKVersionString
which allows library consumers to use this value programmatically (most commonly in the user agent). In my specific case, we use it for tracking adoption of resources and when bugs arise, help identify the impacted consumers.However, the plugin framework doesn't have this (that I can find) and I would love to see it back again. In the SDKv2, this is a string value that is meant to be updated on release but currently isn't (separate issue at hashicorp/terraform-plugin-sdk#1257 but may be related for next steps and whether this should remain a thing).
The text was updated successfully, but these errors were encountered: