github3.py
github3.py copied to clipboard
Add Organization Webhooks Preview
See the announcement for more details
Hi Ian,
Do you think that this is an opportunity to create a directory orgs
for the organizations? I would do it as a prerequisite to this addition.
I think a lot of code will be common with the repositories webhooks. I would consider a generic hook
model and inheritance for the repository and organization hook.
Any thought or objection?
Do you think that this is an opportunity to create a directory orgs for the organizations? I would do it as a prerequisite to this addition.
It's not clear to me why this is necessary.
You were right this is not necessary.
I have started a WIP branch to add the Organization hooks support: https://github.com/sigmavirus24/github3.py/compare/develop...antoine-g:feature/org-hooks.
Main changes that are open to discussion:
- New models
RepositoryHook
andOrganizationHook
inherit fromHook
. - New test file for orgs
-
OrganizationHook
support added toOrganization
Current issues:
- New org hooks tests fail. I think you would like to use the github3py organization but I don't have the permissions to make the tests succeed for the first time and record the cassettes.
- I am unclear with the test files under
tests/
. Were they migrated totests/unit
andtests/integration
? - This introduces a breaking change for the use of repository hooks.
- Some functions from
Hook
are tested twice, once for each implementation. Should I write tests dedicated to theHook
class instead?
I would be happy to get some feedback. Thanks
@antoine-g Have you done any more work? I would like to implement this feature but would like to know where your fork is at compared to the latest changes. I can base my fork off of your fork.
New org hooks tests fail. I think you would like to use the github3py organization but I don't have the permissions to make the tests succeed for the first time and record the cassettes.
@sigmavirus24 Is access to that organisation still required for testing or has everything been mocked now? #350 talks about mocking suite, but I guess that's just to make it easier to add tests with mocks?