-
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
Org webhooks #1028 #1144
Org webhooks #1028 #1144
Conversation
Added the organization webhooks and tests. Corrected a few repository url (related to hooks). Added a ensure condition for hookid in repository hooks
6 integration tests I made are failing(All in OrganizationHooksClientTests.cs). I think this is because authenticated user has to be an admin of the organization being managed and OAuth tokens require the admin:org_hook scope. |
Hey @Anubhav10 thanks heaps for the contribution! Ive done a first pass review and made several comments... Hopefully you don't think Im being overly picky! This is a fantastic contribution and in general you've nailed all the key elements - eg standard and observable implementations, great unit and integration tests, added any new files to all the csproj projects and so on. In terms of the feedback ive commented - most are around tidy up things like whitespace and I also highlighted a couple of things around consistency in naming/doc - eg http vs https on API doc links, or using To address a couple of specific things:
|
Thanks for the review. I'll make these changes as soon as possible. It may take a few days as I have my mid-sem exams in the next week. |
@shiftkey neither appveyor or travis builds seemed to fire on this one? The fact this is a change about organization hooks and had the "octokit" organisation mentioned in integration tests, hopefully is just a co-incidence! 😀 |
@ryangribble uh, that's, neat! Will have a look.... |
@ryangribble I was able to re-send the webhook to AppVeyor but the Travis integration doesn't have that option. Oh well, it should trigger when the PR is next synced... |
2. Added EnsuresNonEmptyArguments() in OrganizationHooksClientTest.cs 3. Fixed the integrationTests I added for org webhooks 4. Changes asked by ryanribble
Sorry for the delay. I have made the changes
There are references to the documentation in https. Do you want me to change them all? The integration tests have been skipped for OrganizationMemberClientTest, and the reasons given are "Admin/Member filter doesn't work unless the requester is an organization member" ,"TwoFactor filter can't be used unless the requester is an organization owner". These problems will come in org webhooks too, unless one is the admin of the org the tests will fail, so should I skip them? One Of the integration test is failing. Test Name: Octokit.Tests.Integration.Clients.OrganizationHooksClientTests+TheCreateMethod.CreateAWebHookForTestOrganization. The reason it is failing is that the 'active' value I send is false, but in the created hook active value is true. I guess this is a problem in the GitHub API. |
The travis-ci build is passing this time!! 😀 |
/// A client for GitHub's Organization Hooks API. | ||
/// </summary> | ||
/// <remarks>See <a href="http://developer.github.com/v3/orgs/hooks/">Hooks API documentation</a> for more information.</remarks> | ||
IObservableOrganizationHooksClient Hooks { get; } |
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.
This should be in the singular - Hook
to be consistent with the other sub-client properties
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 added these properties based on the iobservablerepositoriesclient, it was 'Hooks' there. I thought that is how it should be named here too. I'll change it if you want
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.
@ryangribble is the master of consistency around here, but I believe that (in a separate PR) IObservableRepositoriesClient (and probably IRepositoriesClient) would need to be changed also
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 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.
Opened #1207 to go into this a bit more
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.
done
…leOrganizationHooksClient.cs
{ | ||
readonly IGitHubClient _github; | ||
readonly OrganizationHook _hook; | ||
private string organizationFixture; |
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.
local class variable should be named _organizationFixture
and be readonly
if possible
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.
done
Hooks -> Hook fixtures-> Fixtures variable name changes in OrganizationsHooksFixture.cs
Did the organization hooks client get removed at any point, or did it never make it into Octokit? It appears that GitHubClient.Organization.Hooks no longer exists... |
Hi @Norbo11 this PR was not completed and thus hasn't been merged |
So this will allow me to see if GitHub posts to a webhook I want to GitHub application to have to do specific stuff (like checking if the issue that posted to it has a specific label, is a pull request, edits specific files) and posts in it's status/checks? Currently I got a untested and unrunnable ruby CI that I am not sure will work and I am moving it to .NET Core to C# that I know a lot more on. |
Assigning myself to see if we can rebase this on top of |
I also see #1884 has been opened and might be closer to merging |
After a quick glance at #1884, I'm going to close this PR out in favour of the newer as it seems ready to review. |
#1028 Implemented the Organization Webhook. Added the tests as well. Updated the urls of of repository hooks in some places. Added a ensure condition to check for hookid(added Please Review in comment. Please check if this should be there)