-
Notifications
You must be signed in to change notification settings - Fork 406
8000
Support for Repository.collaborators with permissions and affiliation. #730
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
Comments
AndreasBackx
added a commit
to AndreasBackx/github3.py
that referenced
this issue
Sep 18, 2017
…ion). See sigmavirus24#730 for some background information. This still fails 1 test because the cassette Repository_collaborators.json needs to be updated with the permissions as it somehow does not contain that information. The GitHub API does say that it should be there, but the recording is from 2014 so perhaps it wasn't returned back then. Note that I have currently put the named parameter `affiliation` at the front of the arguments in `Repository.collaborators`. I did this to be in line with the other similar iterators. This can be moved to the back, but I assume some backwards-incompatible changes are fine for 1.0.0? This uses separate classes for the specific User object uses as I understood the idea was from sigmavirus24#670.
AndreasBackx
added a commit
to AndreasBackx/github3.py
that referenced
this issue
Apr 8, 2018
…ion). See sigmavirus24#730 for some background information. This still fails 1 test because the cassette Repository_collaborators.json needs to be updated with the permissions as it somehow does not contain that information. The GitHub API does say that it should be there, but the recording is from 2014 so perhaps it wasn't returned back then. Note that I have currently put the named parameter `affiliation` at the front of the arguments in `Repository.collaborators`. I did this to be in line with the other similar iterators. This can be moved to the back, but I assume some backwards-incompatible changes are fine for 1.0.0? This uses separate classes for the specific User object uses as I understood the idea was from sigmavirus24#670.
AndreasBackx
added a commit
to AndreasBackx/github3.py
that referenced
this issue
Apr 8, 2018
…ion). See sigmavirus24#730 for some background information. Note that I have currently put the named parameter `affiliation` at the front of the arguments in `Repository.collaborators`. I did this to be in line with the other similar iterators. This can be moved to the back, but I assume some backwards-incompatible changes are fine for 1.0.0? This uses separate classes for the specific User object uses as I understood the idea was from sigmavirus24#670.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Currently there is a
Repository.collaborators
method, but theUser
objects it returns do not use the addedpermissions
key that the endpoint returns:What I would propose is to add
repos/collaborator.py
or remain to useusers.py
with aCollaborator
class that inherits from_User
and let_User
use the permissions in_update_attributes
:What I notice while writing this issue, is that
_User
does not userself._get_attribute
. Maybe this can be added in the same commit, just for completeness sake so it's used everywhere as it was intended iirc.We can also add the named parameter
affiliation
toRepository.collaborators()
. It'll throw aValueError
when the value is not valid (not in ['outside', 'direct', 'all']
, perhapsNone
as well based on the default value). Do we giveaffiliation
the default value ofNone
or the default value of'all'
like it is in the documentation?None
would not pass anything and therefore if it were to get changed on GitHub's end, the result will be different. I'd go for'all'
.I'm up for creating the PR once we agree on what needs to be changed.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: