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

tfsdk: Consider Deprecating ServeOpts Name Field In Preference of Address Field #295

Closed
bflad opened this issue Apr 20, 2022 · 1 comment · Fixed by #296
Closed

tfsdk: Consider Deprecating ServeOpts Name Field In Preference of Address Field #295

bflad opened this issue Apr 20, 2022 · 1 comment · Fixed by #296
Assignees
Labels
breaking-change This PR introduces a breaking change or the resolution of this issue may require a breaking change. enhancement New feature or request
Milestone

Comments

@bflad
Copy link
Member

bflad commented Apr 20, 2022

Module version

v0.6.1

Use-cases

The framework currently has a ServeOpts type Name field, which is documented as:

	// Name is the name of the provider, in full address form. For example:
	// registry.terraform.io/hashicorp/random.
	Name string

This mismatch between a provider name (typically the last part of a full provider address) and a provider address is understandably confusing for provider developers, who may gloss over the field documentation given the field name. When only the name is provided here, this can have non-obvious downstream consequences such as not being able to attach debuggers since the reattach configuration will never have a provider address that matches.

Attempted Solutions

Go documentation. Having the full provider address as an example for the field in the scaffolding provider.

Proposal

  • Add ServeOpts type Address field. Add logic in Serve which validates that Address is a full provider address.
  • Where Name is used, prefer Address if not empty instead. If for some reason the provider name (type) is actually necessary, then pare down the address value to just the name.
  • Deprecate the ServeOpts type Name field, recommending Address instead. Remove it in minor+1 version before 1.0.

References

@bflad bflad added enhancement New feature or request breaking-change This PR introduces a breaking change or the resolution of this issue may require a breaking change. labels Apr 20, 2022
@bflad bflad added this to the v0.7.0 milestone Apr 20, 2022
@bflad bflad self-assigned this Apr 20, 2022
@github-actions
Copy link

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change This PR introduces a breaking change or the resolution of this issue may require a breaking change. enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant