-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Team model uses wrong Permission enum #2323
Comments
This is when calling RepositoriesClient.GetAllTeams() |
For the time being we're working around this with
|
This appears to also affect the |
Issue found in version: We are also seeing this issue when getting all pull requests on the git repository
The error we are seeing is
To re-produce
We think this PR introduced this bug #2156 We downgraded to version |
@nickfloyd - what is allowed for a fix on this? Revert the property type from the StringEnum PermissionLevel to the enum Permission? Without changing all of the underlying data to comply with the values allowed by PermissionLevel, I dont know what else is going to be reasonable. |
This one is a bit of a mess. Great sleuthing y'all. Given the use cases:
On create:
On update:
There is also the concept of
I did a quick run-through on what's in main, and there seems to be a bit of a mismatch on a handful of the uses detailed above. Given that all of these should be fixed and aligned with the REST APIs themselves, here's my recommendation: We find all instances of permissions enum mismatches (there are a few, but not too many), correct them, label that as a breaking change, and bump the major version detailing why. While that won't "fix" the underlying data, it will prevent future issues and unblock folks. We might also consider doing the following for code clarity:
Thoughts? This is up for grabs, but if no one can get to it - I'd be glad to knock it out, given that this could cause data issues. |
@nickfloyd that seems like a reasonable proposal to me! Priority-wise, I'm not sure I have a great idea of where this should fit in. |
@nickfloyd I would like to take a crack at it. |
@notauserx Let us know if you are still interested in giving this one a shot, and thank you for offering! ❤️ If so, just assign it to yourself and move it to |
@nickfloyd, I would be happy to get this done. Can you please assign it to me, I don't think(or can't figure out) how to assign it to myself. My PR fixes this permission for the teams and updates the endpoints for several endpoints on the ITeamsClient that are related to permissions. I have written a summary of my changes here. I stopped here because the PR was already quite huge and I was thinking to get some reviews/feedback. With the changes so far, the permissions for teams are updated, however, I did not touch all the other permissions enum mismatches. Do we want to put all that in a single PR, or get this merged and then tackle the other instances? |
@notauserx I think your line of thinking is the best route - let's merge your PR when you feel it's g2g and it's been reviewed one last time and then move on to the other instances as you suggest. That way we can avoid the tax of a huge PR and the risk something like that could introduce. |
@nickfloyd cooking a PR to update the remaining permission enum mismatches(App installations and Collaborators) based on your suggestions. |
It looks like commit 598c7c3 broke deserialization of permissions on the
Team
model when getting teams with access to a repository (we're on GitHub Enterprise, but AFAICS the Team DTO is the same on GitHub.com).Curling the repository list teams endpoint on our GitHub Enterprise installation gives responses like
Which matches
Permission
(which the field onTeam
used to be before that commit), but notPermissionLevel
(what it is now).When I use a collaborator endpoint and try to examine the permissions on the response I get a stack trace like
(This is running against GitHub Enterprise versions 2.22.7 and 3.0.5)
(Edited to correct a link to the GitHub docs which linked to the wrong API endpoint)
The text was updated successfully, but these errors were encountered: