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

Teams improvements #417

Conversation

robbiemcmichael
Copy link
Contributor

@robbiemcmichael robbiemcmichael commented Dec 3, 2019

Three changes:

Fix permission field in types for teams

Fixes a bug as the field is permission not permissions.

Add privacy field to types for teams

The privacy field was previously commented out while the privacy level of a team was part of the ironman API preview. This feature is now part of the official v3 API, so this commit adds support for this field.

Make privacy field non-optional in teams

The privacy field is optional when creating/editing teams, but has a context dependent default value. When getting the team details, the field is expected to always be populated due to these default values.


I could also add the ldap_dn field mentioned in #416 as part of this pull request, but I chose not to as I suspect you may not want to support undocumented fields.

@phadej
Copy link
Contributor

phadej commented Dec 3, 2019

Few samples broke

src/GitHub/Data/Teams.hs Outdated Show resolved Hide resolved
The privacy field was previously commented out while the privacy level
of a team was part of the `ironman` API preview. This feature is now
part of the official v3 API, so this commit adds support for this field.
The `privacy` field is optional when creating/editing teams, but
has a context dependent default value. When getting the team details,
the field is expected to always be populated due to these default
values.
@robbiemcmichael
Copy link
Contributor Author

robbiemcmichael commented Dec 3, 2019

@phadej Good point, I've updated to make it optional when creating/editing teams.

Since it always has a default value, it looks like the privacy field doesn't need to be optional in the Team and SimpleTeam types. The GitHub API docs never state whether fields are required or optional, but I tried creating a team without specifying a privacy level and then when I fetched the team details I noticed it was set to secret, so as far as I can tell the privacy field is always going to be populated. I've pushed a commit for this as well if you're happy with the change.

src/GitHub/Data/Teams.hs Outdated Show resolved Hide resolved
src/GitHub/Data/Teams.hs Outdated Show resolved Hide resolved
Makes team `privacy` and `permission` fields required when creating a
team so users are forced to choose, but optional when editing a team.
@robbiemcmichael
Copy link
Contributor Author

@phadej Updated as requested.

@phadej phadej self-assigned this May 26, 2020
@phadej
Copy link
Contributor

phadej commented May 26, 2020

amended and merged as part of #446, thanks!

@phadej phadej closed this May 26, 2020
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.

None yet

2 participants