-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Export resource deprecation. #18286
Export resource deprecation. #18286
Conversation
We already had the functionality to make resources deprecated, which was used when migrating resources to data sources, but the functionality was unexported, so only the schema package could do it. Now it's exported, meaning providers can mark entire resources as deprecated. I also added a test in hopefully-the-right place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, but I'd also like to give our friends who maintain the provider SDK an opportunity to weigh in here in case they see any conflicts with plans I don't know about.
Whoa this is cool that this exists! We actually had an asana task for this, it had some early api designs but if this already exists and has been used then maybe we just merge and mark that task as complete? |
I'm game! If we're going to abandon this for the Asana task, however, I'd like to know that ~soon, as we're working against a deadline here to help make sure hashicorp/terraform-provider-consul#49 can meet its deadlines. I undertook this PR on the understanding that this is something we could probably get merged this week, but if it gets more involved or the timeline starts looking shaky, I just want to change how we're handling hashicorp/terraform-provider-consul#49 :) |
I'd suggest that if there aren't any known conflicts between this and our future plans that we move ahead with it for now to get the Consul PR unblocked but then use our internal tracking item to mean "think about a longer-term solution here", which might eventually end up just being closed as this being good enough but we'll have an opportunity to make a better plan then if we find one. This mechanism was originally introduced back in 0.7 to allow us to deprecate |
@@ -32,7 +32,7 @@ func DataSourceResourceShim(name string, dataSource *Resource) *Resource { | |||
|
|||
// FIXME: Link to some further docs either on the website or in the | |||
// changelog, once such a thing exists. | |||
dataSource.deprecationMessage = fmt.Sprintf( | |||
dataSource.Deprecated = fmt.Sprintf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some of this feedback is expressed in Slack, but I think DeprecationMessage
is the preferred var name. Other than that I see no reason to block this, we can build off it or keep it as our "Resource Deprecation" mechanism!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
At the Enablement team's request, change from using `Deprecated` to `DeprecationMessage`, as it's a string value, not a boolean.
Build failure is unrelated to these changes--looks like HEAD on master is broken. Merging! |
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. |
We already had the functionality to make resources deprecated, which was
used when migrating resources to data sources, but the functionality was
unexported, so only the schema package could do it. Now it's exported,
meaning providers can mark entire resources as deprecated. I also added
a test in hopefully-the-right place?