-
Notifications
You must be signed in to change notification settings - Fork 670
feat(api): add group hooks #1533
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
Conversation
Got a few questions:
|
Codecov Report
@@ Coverage Diff @@
## master #1533 +/- ##
==========================================
+ Coverage 91.13% 91.15% +0.02%
==========================================
Files 74 74
Lines 4162 4172 +10
==========================================
+ Hits 3793 3803 +10
Misses 369 369
Flags with carried forward coverage won't be shown. Click here to find out 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.
Thanks a lot @sugonyak! Looks good. Just a few comments and to answer your questions:
Not quite sure if I should change something in CLI part, could someone advise?
Since you only use standard methods, the CLI part should be auto-generated including docs and nothing extra is needed here.
Also, tried to use pre-commit checks and mypy gives me a lot of errors in files not affected by my changes, is it normal?
Sorry about that, looks like the mypy pre-commit does not respect the file list from mypy's config, I need to check. If tox -e mypy
is happy then for now just bypass it, I'll try to fix it asap.
I see that tests for project hooks are not implemented, should I implement some for group hooks?
I've suggested factoring them out into a common file, then it should be easier to add tests and maybe reuse fixtures. But even if you just add group tests that's fine, just maybe really put them into test_hooks.py
for easier reuse. Thanks!
tests/unit/objects/test_groups.py
Outdated
|
||
|
||
@pytest.mark.skip(reason="missing test") | ||
def test_list_group_hooks(gl): | ||
pass | ||
|
||
|
||
@pytest.mark.skip(reason="missing test") | ||
def test_get_group_hook(gl): | ||
pass | ||
|
||
|
||
@pytest.mark.skip(reason="missing test") | ||
def test_create_group_hook(gl): | ||
pass | ||
|
||
|
||
@pytest.mark.skip(reason="missing test") | ||
def test_update_group_hook(gl): | ||
pass | ||
|
||
|
||
@pytest.mark.skip(reason="missing test") | ||
def test_delete_group_hook(gl): | ||
pass |
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.
Perhaps we could factor this (and project hooks from test_projects.py
) out into tests/unit/objects/test_hooks.py
and they could share most of the fixture/setup?
See for example the issues statistics test that shares between project/group/instance endpoints:
https://github.com/python-gitlab/python-gitlab/blob/master/tests/unit/objects/test_issues.py#L44-L58
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.
Yeah, seems like a good idea.
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.
Awesome, thanks for adding all the unit tests even for other endpoints.
We'll just need to skip the functional test for now unfortunately as we only run them against the gitlab-ce container in CI.
Resolves #1496