-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove 'id' fields from schemas #399
Conversation
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.
Can you elaborate on the "why" here?
Because IDs are always treated separately (via |
I will look into the test failures. |
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.
My take: rather than dropping the fields entirely, we should rename them to <whatever>_id
. This allows us to store the full API-side ID without being bound to it in Terraform. For a few reasons (import, versioning, etc.) it's nice to have some flexibility in how Terraform uses the ID internally. There are also some cases where the API IDs of things differ even for the same resource.
My approach to this to date has been discouraging users from using .id
as a meaningful value and making sure whatever .id
would have been is exposed as a field, to surface that value in a way users can rely on.
@paddycarver I agree that removing the I still believe it's confusing to keep That said I don't believe there's any harm in removing
Let me know what you think. |
I think we're largely in agreement here, @radeksimko. Project should be fine now--it was deprecated with 0.9.0 9 months ago, if people haven't updated yet, they're not going to. And besides, with 1.0.0 about to go out, may as well lump in that break. Only thing I'd ask different on this one: instead of removing the |
Just pushed a commit that makes the suggested changes. Tagging @radeksimko for a final thumbs up, and we'll merge it.
dc45007
to
0b912da
Compare
dc45007
to
a202942
Compare
a202942
to
ebfd127
Compare
@paddycarver I clearly can't approve my own PR, so I'm sending 👍 your way via this comment. 😄 |
@@ -3,10 +3,12 @@ package google | |||
import ( | |||
"fmt" | |||
"log" | |||
"strconv" | |||
|
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.
Totally nitpick, but I guess we can leave out the extra whitespace here.
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.
Throwing my 👍 in there
If everyone's OK with it, I'd like to hold off on merging this until the dust settles on 1.0.0. |
Rename all ID fields to {resource_noun}_id instead of removing them outright. This means people can still get at the info. Leave project's id deleted. It has been marked as Removed for months. I'm fine with cleaning it up before 1.0.0. Also, update website docs.
c9b08d5
to
ac73beb
Compare
Merging this now. This should have no user-visible change; before this, the |
….10.3 Remove 'id' fields from schemas
Signed-off-by: Modular Magician <[email protected]>
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
I'm happy to remove all vendor changes and make a separate PR if necessary.
I also ran all provider acceptance tests on this branch in TC and nothing suspicious came up.