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

[1/2] DXCDT-457: Add auth0_organization_members resource #614

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Jun 2, 2023

🔧 Changes

Add auth0_organization_members resource to manage the members of an organization in a 1:many resource. Members are added to the org data source in #615.

📚 References

🔬 Testing

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@sergiught sergiught changed the title DXCDT-457: Add auth0_organization_members resource [1/2] DXCDT-457: Add auth0_organization_members resource Jun 2, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2023

Codecov Report

Merging #614 (e3933b9) into main (6504fec) will decrease coverage by 0.14%.
The diff coverage is 76.15%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #614      +/-   ##
==========================================
- Coverage   86.65%   86.51%   -0.14%     
==========================================
  Files          77       78       +1     
  Lines       11896    12047     +151     
==========================================
+ Hits        10308    10423     +115     
- Misses       1213     1244      +31     
- Partials      375      380       +5     
Impacted Files Coverage Δ
internal/provider/provider.go 100.00% <ø> (ø)
internal/auth0/organization/resource_members.go 76.15% <76.15%> (ø)

@sergiught sergiught marked this pull request as ready for review June 2, 2023 13:45
@sergiught sergiught requested a review from a team as a code owner June 2, 2023 13:45
examples/resources/auth0_organization_members/resource.tf Outdated Show resolved Hide resolved
internal/auth0/organization/resource_members.go Outdated Show resolved Hide resolved
return diag.FromErr(err)
}

data.SetId(organizationID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion - perhaps set the ID after successfully assigning members to the org. That way you can remove the data.SetId("") on line 76.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While that might be nicer and tidier code wise, if the organization exists we should immediately set the ID of this resource IMO. Any error resulting from the AddMembers call shouldn't erase the resource from the state (that's what happens if we don't set the ID).

internal/auth0/organization/resource_members.go Outdated Show resolved Hide resolved
@sergiught sergiught force-pushed the feature/DXCDT-457-org-members branch from 9d1583d to e3933b9 Compare June 7, 2023 07:09
@sergiught sergiught force-pushed the feature/DXCDT-457-org-members branch from e3933b9 to 14c962c Compare June 7, 2023 07:25
@sergiught sergiught merged commit 02ff387 into main Jun 7, 2023
@sergiught sergiught deleted the feature/DXCDT-457-org-members branch June 7, 2023 13:08
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.

4 participants