Add support for query ldap groups links#1612
Add support for query ldap groups links#1612andrewlarssen wants to merge 1 commit intopython-gitlab:mainfrom
Conversation
|
For issue #1609 |
|
Have tested this manually on a real gitlab instance. I could not see any automated tests for gitlab -> ldap features |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1612 +/- ##
==========================================
+ Coverage 91.59% 91.61% +0.01%
==========================================
Files 74 74
Lines 4272 4279 +7
==========================================
+ Hits 3913 3920 +7
Misses 359 359
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
2322542 to
772e79a
Compare
|
Fixed 2 linting issues. One was commit message so had to force push |
There was a problem hiding this comment.
Thanks a lot @andrewlarssen! Just a comment on naming consistency. If you're able to add some unit tests to this, would also be great! Here https://github.com/python-gitlab/python-gitlab/blob/master/tests/unit/objects/test_groups.py or you could create a new test_ldap_links.py if it's getting too crowded there. Unit tests mock the responses so we can test EE features there.
While reviewing this I noticed our existing method for deletion uses deprecated API endpoints: https://docs.gitlab.com/ee/api/groups.html#delete-ldap-group-link
So as a bonus if you find time, I think these methods actually could be removed and you can add the CreateMixin/DeleteMixin to the manager, and ObjectDeleteMixin to the object. Then we could remove the custom methods here:
python-gitlab/gitlab/v4/objects/groups.py
Lines 112 to 150 in 227607c
This would be a breaking change, but we have a major release coming up anyway. Let me know if this makes sense or you need help. Also, you'll just need to amend your message again as commitlint does not like capitalized sentences :)
| "GroupLdapLinks", | ||
| "GroupLdapLinksManager", |
There was a problem hiding this comment.
For consistency with other objects, we should use the single (the API also supports adding a single link)
| "GroupLdapLinks", | |
| "GroupLdapLinksManager", | |
| "GroupLdapLink", | |
| "GroupLdapLinkManager", |
| subgroups: "GroupSubgroupManager" | ||
| variables: GroupVariableManager | ||
| wikis: GroupWikiManager | ||
| ldap_group_links: "GroupLdapLinksManager" |
There was a problem hiding this comment.
| ldap_group_links: "GroupLdapLinksManager" | |
| ldap_group_links: "GroupLdapLinkManager" |
| _types = {"skip_groups": types.ListAttribute} | ||
|
|
||
|
|
||
| class GroupLdapLinks(RESTObject): |
There was a problem hiding this comment.
| class GroupLdapLinks(RESTObject): | |
| class GroupLdapLink(RESTObject): |
| class GroupLdapLinksManager(ListMixin, RESTManager): | ||
| _path = "/groups/%(group_id)s/ldap_group_links" | ||
| _obj_cls = GroupLdapLinks |
There was a problem hiding this comment.
| class GroupLdapLinksManager(ListMixin, RESTManager): | |
| _path = "/groups/%(group_id)s/ldap_group_links" | |
| _obj_cls = GroupLdapLinks | |
| class GroupLdapLinkManager(ListMixin, RESTManager): | |
| _path = "/groups/%(group_id)s/ldap_group_links" | |
| _obj_cls = GroupLdapLink |
|
This Pull Request (PR) was marked stale because it has been open 90 days with no activity. Please remove the stale label or comment on this PR. Otherwise, it will be closed in 15 days. |
|
This PR was closed because it has been marked stale for 15 days with no activity. If this PR is still valid, please re-open. |
You can currently add or delete ldap links but you can't query existing links