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 |
| if err = d.Set("invitation_id", int(invitationID)); err != nil { | ||
| return diag.FromErr(err) | ||
| } |
There was a problem hiding this comment.
This seems superfluous, since we are setting the same as the resource ID alrady
| return diag.FromErr(err) | ||
| } | ||
|
|
||
| ctx = context.WithValue(ctx, ctxId, d.Id()) |
There was a problem hiding this comment.
This isn't needed
| ctx = context.WithValue(ctx, ctxId, d.Id()) |
| if invitation == nil { | ||
| // Invitation was accepted, cancelled, or expired — remove from state | ||
| tflog.Info(ctx, fmt.Sprintf("Removing organization invitation %s from state because it is no longer pending", d.Id()), map[string]any{ | ||
| "invitation_id": d.Id(), | ||
| }) | ||
| d.SetId("") | ||
| return nil | ||
| } |
There was a problem hiding this comment.
This seems problematic as this breaks idempotency. The resource would automatically be removed and next plan would try to re-add it again
Resolves #2197
This is in response to @deiga's request.
Fair warning: This was mostly letting Claude Code rip on that issue thread. I did however test that this works in a local project and using the resource with an email did show me 2 validation errors (no seats + user already in org) and then with a new email, it was able to add that user and I was able to get an invite email to that user's email address.
Happy to address any feedback!
Before the change?
There was no means by which to invite a user to the organization via email. You had to invite them via their github handle.
After the change?
You can now invite users to the organization via an email.
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!