-
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
Missing permission parameter #1347
Missing permission parameter #1347
Conversation
|
||
namespace Octokit | ||
{ | ||
public enum PermissionType |
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.
There already exists a RepositoryPermission
enum that has the same values so I think you could just use that
You could go with Also it would be nice to specify the AcceptsHeader for this preview functionality, like I did on #1319 so that this functionality works on GHE 2.5 (before the preview period had ended). This also would save the need to add the |
/// <summary> | ||
/// The permission to grant the team on this repository. | ||
/// </summary> | ||
[Parameter(Key = "permission")] |
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.
You shouldn't need to specify [Parameter]
tag except in unusual cases. The default serialization will handle converting between github API format and octokit.net's more c# representation
eg:
lowercase_separated_with_underscores
<=> LowercaseSeparatedWithUnderscores
Only when a property name on our side doesn't match the above conversion, do you need to explicitly define a [Parameter]
tag
04f76fa
to
11b1d75
Compare
@ryangribble, is there something more to do or is this fine? |
It would be good to add integration tests for the new parameter? You can use repositorycontext and teamcontext helpers to create repo/teams for the test then they'll be removed when the test finishes |
Something like that? |
Yep that's on the right track... although what if the test user's organisation has no teams created? Similar to the Another thing that I like to do in integration tests is not only assert the returned object from that update call, but actually make a "Get" call (in this case, something like As an aside, while you're at it you could rename that |
f4d2223
to
e83ca0d
Compare
argh sorry @maddin2016 I gave you a bit of a bum steer on that TeamsContext thing, it actually is hardcoded to use |
…hub enterprise, by using the IConnection used to create the context, to delete it in Dispose() update CreateContext extension methods to pass in the IConnection
- use Helper not EnterpriseHelper - use team.Organization.Login rather than .Name
Fix integration test helpers
🎉 😃 @ryangribble many thanks for your help!! |
Fixes #1320
Add option to set or update permissions for a repository for teams. I'm still not satisfied with naming of
TeamRepositoryUpdate
. Any other suggestions?