-
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
Repository invitations changes #1410
Repository invitations changes #1410
Conversation
need to add some new overload to post method in apiconnection
…itory-invitations-changes
…addin2016/octokit.net into repository-invitations-changes
407e30b
to
cd95700
Compare
b47c537
to
aba8653
Compare
Build is failing convention tests due to missing unit test class for |
/// See the <a href="https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository">API documentation</a> for more information. | ||
/// </remarks> | ||
/// <param name="id">The id of the repository</param> | ||
IObservable<RepositoryInvitation> GetAllForRepository(int id); |
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.
I think for consistency, this variable should be named repositoryId
…itory-invitations-changes
I reduce the integration tests to only receive invitations. Tests for accept and decline not possible yet. Anything more to do? |
Integration tests for |
Also it seems with the existing integration tests you are inviting YOURSELF to a test repository you created. And this actually seems to work, with the invite showing up in the system. So given it seems to work to invite yourself, then you probably CAN have tests for |
Unfortunately not. I always catch an NotFoundexception if try to decline and accept with the same account. I have tested it with different accounts. There i can accept and decline the invitiations. |
It seems to work for me? Eg this passes: [IntegrationTest]
public async Task CanDeclineInvitation()
{
var github = Helper.GetAuthenticatedClient();
var repoName = Helper.MakeNameWithTimestamp("public-repo");
using (var context = await github.CreateRepositoryContext(new NewRepository(repoName)))
{
var fixture = github.Repository.Collaborator;
var permission = new CollaboratorRequest(Permission.Push);
// invite a collaborator
var response = await fixture.Invite(context.RepositoryOwner, context.RepositoryName, context.RepositoryOwner, permission);
Assert.Equal(context.RepositoryOwner, response.Invitee.Login);
Assert.Equal(InvitationPermissionType.Write, response.Permissions);
// Decline the invitation
var declined = await github.Repository.Invitation.Decline(response.Id);
Assert.True(declined);
}
} |
…itory-invitations-changes
I still don't get this test working 😕
Should i though write these tests although they don't work with my account? |
👍 write them and I'll check them my side. What error do you get? |
In that try catch block I get an 404 NotFoundException. Later I can send you detailed informations. On Tue, Jul 19, 2016 at 1:15 PM +0200, "Ryan Gribble" [email protected] wrote: 👍 write them and I'll check them my side. What error do you get? You are receiving this because you were mentioned. |
Your test works fine on my side 👍 So if you can also add an "Accept" invitation integration test I will double check that too and then I think we are good! Not sure what might be the issue with your 404? I guess it means the invitation doesnt exist but its strange, in my case I can even login to github with my test account and see the invitation etc. And there's nothing special about my test account, its just a free account. 😕 |
If i login i can also see that invitation. But i can't accept or decline it with octokit. But if it works with your account then maybe its not an issue. Maybe someone third should test it. |
Yep. that Accept test works for me too.
Yep probably a good idea |
👀 |
Hey @maddin2016 I was pondering why accepting/declining a self invite might work for me and not you... one thing that came to mind is that I currently have my integration test configuration setup to use username and password only (i.e I have not specified an apikey/personal access token in the environment vars). How have you got yours setup? If you have an access token defined, try not specifying one, just to see if that makes any difference. |
Nice one! OK so I reckon this is good to 🚢 but let's get a 👍 from @shiftkey first |
😂 That last gif |
Just a quick update on
GitHub support notified me recently that they had pushed a fix for this, and I can confirm that emails are now being received when creating invites with octokit 👍 |
fixed #1399
add a new
RepositoryInvitationsClient
to invite a user to collaborate. I have to create some new overloads and classes.Todo