Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: members: use new *All objects for *AllManager managers#1827

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intomainfromjlvillal/all_objects
Jan 13, 2022

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovosJohnVillalovos commentedJan 12, 2022
edited
Loading

Change it so that:

GroupMemberAllManager uses GroupMemberAll object
ProjectMemberAllManager uses ProjectMemberAll object

Create GroupMemberAll and ProjectMemberAll objects that do not support
any Mixin type methods. Previously we were using GroupMember and
ProjectMember which support thesave() anddelete() methods but
those methods will not work with objects retrieved using the
/members/all/ API calls.

list() API calls:
GET /groups/:id/members/all
GET /projects/:id/members/all

get() API calls:
GET /groups/:id/members/all/:user_id
GET /projects/:id/members/all/:user_id

Closes:#1825
Closes:#848

[1]https://docs.gitlab.com/ee/api/members.html#list-all-members-of-a-group-or-project-including-inherited-and-invited-members
[2]https://docs.gitlab.com/ee/api/members.html#get-a-member-of-a-group-or-project-including-inherited-and-invited-members

@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/all_objects branch 10 times, most recently from24b28b6 to88ac96dCompareJanuary 12, 2022 02:38
@codecov-commenter
Copy link

codecov-commenter commentedJan 12, 2022
edited
Loading

Codecov Report

Merging#1827 (755e0a3) intomain (4a000b6) willincrease coverage by0.00%.
The diff coverage is75.00%.

@@           Coverage Diff           @@##             main    #1827   +/-   ##=======================================  Coverage   92.19%   92.20%           =======================================  Files          77       77             Lines        4819     4823    +4     =======================================+ Hits         4443     4447    +4  Misses        376      376
FlagCoverage Δ
cli_func_v481.36% <75.00%> (+0.01%)⬆️
py_func_v480.17% <75.00%> (+0.01%)⬆️
unit83.18% <75.00%> (+0.01%)⬆️

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

Impacted FilesCoverage Δ
gitlab/v4/objects/members.py94.73% <75.00%> (+0.39%)⬆️
gitlab/v4/objects/services.py100.00% <0.00%> (ø)

Copy link
Member

@nejchnejch left a comment

Choose a reason for hiding this comment

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

Thanks@JohnVillalovos! At the beginning I was happy about the initial implementation because it wasn't duplicating things, but looks like it was kind of broken that way.

A good side-effect of this is that it will also work on the CLI now I'm pretty sure.

@JohnVillalovos
Copy link
MemberAuthor

JohnVillalovos commentedJan 13, 2022
edited
Loading

Yeah, because of thatmembers/all we have no idea where they are a member from. It could be anywhere in the path above them. So we can't delete them in themembers/all as have to go up the path to figure out where they are actually getting their access from.

@nejch
Copy link
Member

nejch commentedJan 13, 2022
edited
Loading

@JohnVillalovos I'm pretty sure this also closes#848 by adding a new CLI command:

(.venv) nejc@zbook-fury:~/repos/python-gitlab$ gitlab project-member-all list --helpusage: gitlab project-member-all list [-h] [--sudo SUDO] --project-id PROJECT_ID [--page PAGE] [--per-page PER_PAGE] [--all]optional arguments:  -h, --help            show this help message and exit  --sudo SUDO  --project-id PROJECT_ID  --page PAGE  --per-page PER_PAGE  --all

would you mind adding a quick test for that?

Edit: and just one more nit,fix(members): 🙇

JohnVillalovos reacted with thumbs up emoji

Change it so that:  GroupMemberAllManager uses GroupMemberAll object  ProjectMemberAllManager uses ProjectMemberAll objectCreate GroupMemberAll and ProjectMemberAll objects that do not supportany Mixin type methods. Previously we were using GroupMember andProjectMember which support the `save()` and `delete()` methods butthose methods will not work with objects retrieved using the`/members/all/` API calls.`list()` API calls: [1]  GET /groups/:id/members/all  GET /projects/:id/members/all`get()` API calls: [2]  GET /groups/:id/members/all/:user_id  GET /projects/:id/members/all/:user_idCloses:#1825Closes:#848[1]https://docs.gitlab.com/ee/api/members.html#list-all-members-of-a-group-or-project-including-inherited-and-invited-members[2]https://docs.gitlab.com/ee/api/members.html#get-a-member-of-a-group-or-project-including-inherited-and-invited-members
@JohnVillalovos
Copy link
MemberAuthor

@JohnVillalovos I'm pretty sure this also closes#848 by adding a new CLI command:

(.venv) nejc@zbook-fury:~/repos/python-gitlab$ gitlab project-member-all list --helpusage: gitlab project-member-all list [-h] [--sudo SUDO] --project-id PROJECT_ID [--page PAGE] [--per-page PER_PAGE] [--all]optional arguments:  -h, --help            show this help message and exit  --sudo SUDO  --project-id PROJECT_ID  --page PAGE  --per-page PER_PAGE  --all

would you mind adding a quick test for that?

Edit: and just one more nit,fix(members): 🙇

Done. And found bug with this test. Thanks!

@nejchnejch merged commit58e5b25 intomainJan 13, 2022
@nejchnejch deleted the jlvillal/all_objects branchJanuary 13, 2022 18:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nejchnejchnejch approved these changes

@max-wittigmax-wittigAwaiting requested review from max-wittig

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
3 participants
@JohnVillalovos@codecov-commenter@nejch

[8]ページ先頭

©2009-2025 Movatter.jp