-
Notifications
You must be signed in to change notification settings - Fork 912
chore: migrate releases resource and data source to context-aware fun… #3036
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
base: main
Are you sure you want to change the base?
Conversation
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
| func resourceGithubReleaseCreateUpdate(d *schema.ResourceData, meta any) error { | ||
| ctx := context.Background() | ||
| if !d.IsNewResource() { | ||
| ctx = context.WithValue(ctx, ctxId, d.Id()) |
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 would be grateful if this change could be verified, as I found that there are only writes and no reads of ctxId. I couldn't find the reason why it was added this way from the git history.
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.
While this isn't actively used at this time, I wouldn't remove the context.WithValue call. It could prove to be useful in debugging
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.
Restored the calls as requested. Thank you.
…ctions (integrations#2996) The legacy CRUD function types are deprecated and should be replaced with the context-aware versions.
deiga
left a comment
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.
Amazing, thank you! 🎉
Contributes to #2996
Local tests passed for anonymous, individual, and organization modes.
After the change?
CRUD functions were switched to context-aware versions
https://developer.hashicorp.com/terraform/plugin/sdkv2/guides/v2-upgrade-guide#more-support-for-context-context
*
Pull request checklist
Does this introduce a breaking change?