-
Notifications
You must be signed in to change notification settings - Fork 12
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
Extend infer
with annotations for aliases and resource deprecations
#245
Conversation
e322e2c
to
1e2877a
Compare
infer
with annotations for aliases and resources deprecationsinfer
with annotations for aliases and resource deprecations
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.
Nice!
|
||
AddAlias(module, name string) | ||
|
||
SetResourceDeprecationMessage(message string) |
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.
Nitpicking, but given that this is backed in the implementation by a field called DeprecationMessage
, I'm inclined to think Resource
is superfluous here? Moreover, if we're feeling cheeky, we could call it Deprecate
to align with Describe
.
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.
Yeah, good thoughts .. perhaps also AddAlias
could just be Alias
?
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 called it SetResourceDeprecationMessage
because resource properties can also be deprecated. The field DeprecationMessage
is on the resource level so there's no ambiguity.
For the aliases, I went with "add" because it can be called more than once to add different aliases, which I wanted to call attention to.
Let me know if my reasoning doesn't make sense to you.
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.
Describe
also applies to both the resource and it's fields. I agree that Deprecate
would have been a more consistent name.
Following up on #245, we specify the boundary requirements of `AddAlias` and `SetToken` with the types that they accept. This is a breaking change unless you are using untyped constants in `SetToken` and `AddAlias`, which I expected to be the common case.
Following up on #245, we specify the boundary requirements of `AddAlias` and `SetToken` with the types that they accept. This is a breaking change unless you are using untyped constants in `SetToken` and `AddAlias`, which I expected to be the common case.
This allows authors of providers built on
infer
to alias and deprecate resources.