FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(api): add group hooks by sugonyak · Pull Request #1533 · python-gitlab/python-gitlab · GitHub

Repository navigation

feat(api): add group hooks - #1533

Merged
nejch merged 2 commits into
python-gitlab:masterfrom
sugonyak:add-group-hooks
Jun 27, 2021
Merged

nejch merged 2 commits into
python-gitlab:masterfrom
sugonyak:add-group-hooks

Conversation

sugonyak commented Jun 25, 2021 •
edited
Loading

Copy link
Copy Markdown
Contributor

Resolves #1496

sugonyak commented Jun 25, 2021 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

Got a few questions:

  • Not quite sure if I should change something in CLI part, could someone advise?
  • 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?
  • I see that tests for project hooks are not implemented, should I implement some for group hooks?

codecov-commenter commented Jun 25, 2021 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #1533 (953f207) into master (af7aae7) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            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              
Flag Coverage Δ
cli_func_v4 80.77% <100.00%> (+0.04%) ⬆️
py_func_v4 80.08% <100.00%> (+0.04%) ⬆️
unit 82.33% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/v4/objects/groups.py 83.83% <100.00%> (+0.16%) ⬆️
gitlab/v4/objects/hooks.py 100.00% <100.00%> (ø)
gitlab/v4/objects/releases.py 100.00% <0.00%> (ø)
gitlab/v4/objects/merge_requests.py 83.92% <0.00%> (ø)

nejch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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!

Comment thread tests/unit/objects/test_groups.py Outdated
Comment on lines +156 to +180


@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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, seems like a good idea.

Comment thread docs/gl_objects/groups.rst Outdated
sugonyak marked this pull request as ready for review June 25, 2021 23:02
sugonyak changed the title [WIP] feat(api): Add group hooks feat(api): Add group hooks Jun 25, 2021
sugonyak changed the title feat(api): Add group hooks feat(api): add group hooks Jun 25, 2021

nejch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

nejch merged commit 6abf13a into python-gitlab:master Jun 27, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group Hooks API not supported

3 participants


Back | FazBrowse Home | New Git URL