Skip to content
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

Add User Invite Resource #120

Merged
merged 6 commits into from
Aug 2, 2024
Merged

Add User Invite Resource #120

merged 6 commits into from
Aug 2, 2024

Conversation

ichung08
Copy link
Collaborator

@ichung08 ichung08 commented Aug 2, 2024

Description

Add support for user invite resource on terraform.

🎟 Issue(s)

#113

🧪 Functional Testing

Create user invite
Screenshot 2024-08-01 at 5 33 49 PM

Update user invite
Screenshot 2024-08-01 at 5 46 39 PM

Delete user invite
Screenshot 2024-08-01 at 5 47 22 PM

📸 Screenshots

📋 Checklist

  • Added/updated applicable tests
  • Added/updated examples in the examples/ directory
  • Updated any related documentation

@ichung08 ichung08 self-assigned this Aug 2, 2024
@ichung08 ichung08 linked an issue Aug 2, 2024 that may be closed by this pull request
Comment on lines -87 to -98
fullName := fmt.Sprintf("users.%d.full_name", usersIdx)
if instanceState.Attributes[fullName] == "" {
return fmt.Errorf("expected 'full_name' to be set")
}
status := fmt.Sprintf("users.%d.status", usersIdx)
if instanceState.Attributes[status] == "" {
return fmt.Errorf("expected 'status' to be set")
}
avatarUrl := fmt.Sprintf("users.%d.avatar_url", usersIdx)
if instanceState.Attributes[avatarUrl] == "" {
return fmt.Errorf("expected 'avatar_url' to be set")
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we create new user invites, those users can be found in our org but by default they do not have the fields fullName or avatarUrl populated

removed so the test would not check those fields (as they'll always be empty for user invites)

@ichung08 ichung08 marked this pull request as ready for review August 2, 2024 20:02
@ichung08 ichung08 requested review from vandyliu, sunkickr and a team as code owners August 2, 2024 20:02
) {
var data models.UserInvite

// Delete existing user invite
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment seems outta place

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can add this to above the function definition of what we're gonna do something like

1. Delete existing user invite
2. Create a new user invite
<reason why>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the comment to make it clear that we delete the existing user invite first and then create a new user invite (since we don't have an update user invite endpoint)

@ichung08 ichung08 merged commit f7586a6 into main Aug 2, 2024
7 checks passed
@ichung08 ichung08 deleted the 113-add-user-invite-resource branch August 2, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add User Invite Resource
2 participants