-
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
Update permissions #2661
Update permissions #2661
Conversation
There are some integration tests failing for IRepoCollaboratorsClient's GetAll method. The tests are adding a collaborator and expecting the collaborator count to be updated. However, adding a collaborator will send an invitation and the collaborator has to accept the invitation before the count will be updated. The integration tests for ReviewPermission also follow the same route, a collaborator is added with 'write' permission and the test expects a collaborator with 'write' permission, without waiting for the collaborator to accept the invitation. In these tests octokitnet-test1 and m-zuber-octokit-integration-tests accounts are used for adding a collaborator, and I don't have their creds to accept the invitation. This probably is out of scope for this issue, but we probably should create a new issue and think about possible workarounds. For app installation permissions, there are some permissions that have only 'read' as a value, some have only 'write', most with 'read' and 'write', and some with 'read', 'write' and 'admin'. I have named the enums InstallationReadPermissionLevel, InstallationWritePermissionLevel, InstallationReadWritePermissionLevel, and InstallationReadWriteAdminPermissionLevel respectively. I have also moved the Permission.cs to the common folder because it houses all the permissions from the API surface. |
@notauserx is the |
@kfcampbell I have completed updating all references the old Permission enums and made them context-specific. I was also planning to update some endpoints that use the updated permission in request/response. However, the integration tests are failing for some of these endpoints, as I've mentioned in my previous comments. I do need some feedback on how to proceed. |
The integration testing question with the invites is a tough one. As far as I know, we don't have a convenient way to do that. I'll have to think about that more and ask my team. |
Hey @notauserx, Thanks again for these contributions ❤️ . As you've detailed above, we need to rethink some of the strategies in our integration tests. I cannot be 100% certain, but the workflow for the ones you referenced has changed since they were originally implemented. We have a few options here:
I don't want to get into philosophical aspects of how useful functional tests are - especially since there is already pretty good unit test coverage on I appreciate you highlighting this fragile part of this SDK's coverage. We're working daily to try to improve this for everyone, and I'm glad you've decided to come alongside us and do the same ❤️ ! |
@nickfloyd thank you for sharing your thoughts. Among the options you suggested, I am more biased toward either removing or skipping the failing tests. I do understand that with GitHub updating their REST APIs, there will be times when this SDK gets out of sync, and with breaking changes and workflow updates some workflows do get outdated. I will think through your suggestions and incorporate them into this PR, which I plan to resume next week. And for the contributions, I am glad to offer my PRs. |
This PR is now ready for review. Please give me some feedback and I will update the PR accordingly. |
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.
Thank you for getting this in ❤️
Resolves #2323
Behavior
Before the change?
After the change?
Additional info
Pull request checklist
Does this introduce a breaking change?
Type: Breaking change
label)If
Yes
, what's the impact:Pull request type
Type: Bug
Type: Breaking Change