-
Notifications
You must be signed in to change notification settings - Fork 249
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
chore(contrib): include a contribution guide #851
Conversation
da78159
to
1935a67
Compare
LESSONS.md
Outdated
|
||
# Lessons Learned | ||
|
||
- TypeSet vs TypeList |
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.
@sanderblue Do we want to recommend one over the other here?
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.
Honestly, I'm a little hesitant to do that mostly because I still feel like it's a matter of having more in-depth knowledge of the underlying behavior. But I guess I wouldn't be opposed to saying something like "if the attribute can be a TypeList, then go with TypeList. We've found attributes that use TypeList to be bit less nuanced and easier to maintain and still accomplish the same goal as TypeSet"... please fact check me on the "still accomplish the same goal" part 😉
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.
From the Extending Terraform guide:
TypeSet
TypeSet implements set behavior and is used to represent an unordered collection of items, meaning that their ordering specified does not need to be consistent, and the ordering itself has no impact on the behavior of the resource.
TypeList:
Used to represent an ordered collection of items, where the order the items are presented can impact the behavior of the resource being modeled. An example of ordered items would be network routing rules, where rules are examined in the order they are given until a match is found. The items are all of the same type defined by the Elem property.
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 don't think we should recommend one over the other - they both have their uses.
It probably is worth pointing out that the idiom for nesting schema structures is TypeList
with MaxItems: 1
as discussed here.
3883cc0
to
4c04e05
Compare
LESSONS.md
Outdated
|
||
# Lessons Learned | ||
|
||
- TypeSet vs TypeList |
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.
From the Extending Terraform guide:
TypeSet
TypeSet implements set behavior and is used to represent an unordered collection of items, meaning that their ordering specified does not need to be consistent, and the ordering itself has no impact on the behavior of the resource.
TypeList:
Used to represent an ordered collection of items, where the order the items are presented can impact the behavior of the resource being modeled. An example of ordered items would be network routing rules, where rules are examined in the order they are given until a match is found. The items are all of the same type defined by the Elem property.
LESSONS.md
Outdated
|
||
# Lessons Learned | ||
|
||
- TypeSet vs TypeList |
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 don't think we should recommend one over the other - they both have their uses.
It probably is worth pointing out that the idiom for nesting schema structures is TypeList
with MaxItems: 1
as discussed here.
CONTRIBUTING.md
Outdated
|
||
### Commit messages | ||
|
||
To keep a style and make allow us to automate the generating of a change log, |
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.
nit: s/make allow/allow/
chore(contrib): include a contribution guide
Fixes #746