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

resource/account_member: Use TypeSet, not TypeList #876

Merged

Conversation

jacobbednarz
Copy link
Member

When I created this resource, TypeList seemed to be the correct choice
for the data type we store. However, after a while we discovered an
issue whereby a change in the ordering of the role_ids, resulted in the
account member wanting to be recreated. This was addressed in #128
however it meant that new roles had to be added to the end otherwise it
would flap. It also had the extra legwork of a custom DiffSuppressFunc
to ensure that we compared the values using a consistent ordering to
avoid the trap where the value wasn't added to the end.

Now that we understand the internal types a little better, TypeSet is
a more appropriate choice as it is an unordered list which fits the
role_ids perfectly and solves the initial issues we encountered.

When I created this resource, `TypeList` seemed to be the correct choice
for the data type we store. However, after a while we discovered an
issue whereby a change in the ordering of the `role_ids`, resulted in the
account member wanting to be recreated. This was addressed in #128
however it meant that new roles had to be added to the end otherwise it
would flap. It also had the extra legwork of a custom `DiffSuppressFunc`
to ensure that we compared the values using a consistent ordering to
avoid the trap where the value wasn't added to the end.

Now that we understand the internal types a little better, `TypeSet` is
a more appropriate choice as it is an unordered list which fits the
`role_ids` perfectly and solves the initial issues we encountered.
@jacobbednarz jacobbednarz merged commit 37e2c11 into cloudflare:master Nov 26, 2020
@jacobbednarz jacobbednarz deleted the account-member-roles-to-set branch November 26, 2020 03:13
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.

1 participant