Skip to content
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

List all resource members, including inherited members #141

Closed
MrSnoozles opened this issue Aug 7, 2018 · 13 comments
Closed

List all resource members, including inherited members #141

MrSnoozles opened this issue Aug 7, 2018 · 13 comments
Milestone

Comments

@MrSnoozles
Copy link

MrSnoozles commented Aug 7, 2018

Hello,

as far as I can see ProjectMembers.all() only returns the members added to a project but not all members. The API endpoint for this is /projects/:id/members/all instead of /projects/:id/members. The endpoint is documented here https://docs.gitlab.com/ee/api/members.html#list-all-members-of-a-group-or-project-including-inherited-members

As far as I could see there is no way to retrieve all members yet. Did I maybe miss anything?

@jdalrymple
Copy link
Owner

Oops! I'll fix this tonight!

@MrSnoozles
Copy link
Author

Awesome, thanks for the super quick reply

@jdalrymple
Copy link
Owner

const membersIncludingInherited = await ProjectsMembers.all(id)
const membersWithoutInherited = await ProjectMembers.all(id, {excludeInherited: true})

Does this work for you :) ?

@MrSnoozles
Copy link
Author

I'm pretty sure your changes are correct, but it doesn't work for my Gitlab 11.1.2. instance. It seems like this API endpoint is coming in 11.2: https://gitlab.com/gitlab-org/gitlab-ce/commit/046796cc3a98068e99abed152145e76c4636959c

Thank you so much for the quick response. I'm going to report back if it works once the endpoint becomes available :)

jdalrymple pushed a commit that referenced this issue Aug 14, 2018
# [3.8.0](3.7.0...3.8.0) (2018-08-14)

### Bug Fixes

* **api:** Updating project members all function to include the inherited members.  [#141](#141) ([e081a16](e081a16))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.0 ([dc9748d](dc9748d))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.1 ([12b6ca1](12b6ca1)), closes [#139](#139)
* **package:** Updating packages and fixing [#140](#140) due to a babel update ([04d1769](04d1769))

### Features

* Add push rule service ([#143](#143)) ([395f83c](395f83c))
* Add transfer a project to a new namespace ([#145](#145)) ([87e9f55](87e9f55))
mdsb100 pushed a commit to mdsb100/node-gitlab that referenced this issue Aug 17, 2018
# [3.8.0](jdalrymple/gitbeaker@3.7.0...3.8.0) (2018-08-14)

### Bug Fixes

* **api:** Updating project members all function to include the inherited members.  [jdalrymple#141](jdalrymple#141) ([e081a16](jdalrymple@e081a16))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.0 ([dc9748d](jdalrymple@dc9748d))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.1 ([12b6ca1](jdalrymple@12b6ca1)), closes [jdalrymple#139](jdalrymple#139)
* **package:** Updating packages and fixing [jdalrymple#140](jdalrymple#140) due to a babel update ([04d1769](jdalrymple@04d1769))

### Features

* Add push rule service ([jdalrymple#143](jdalrymple#143)) ([395f83c](jdalrymple@395f83c))
* Add transfer a project to a new namespace ([jdalrymple#145](jdalrymple#145)) ([87e9f55](jdalrymple@87e9f55))
mdsb100 pushed a commit to mdsb100/node-gitlab that referenced this issue Aug 17, 2018
# [3.8.0](jdalrymple/gitbeaker@3.7.0...3.8.0) (2018-08-14)

### Bug Fixes

* **api:** Updating project members all function to include the inherited members.  [jdalrymple#141](jdalrymple#141) ([e081a16](jdalrymple@e081a16))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.0 ([dc9748d](jdalrymple@dc9748d))
* **package:** update [@semantic-release](https://github.com/semantic-release)/npm to version 5.0.1 ([12b6ca1](jdalrymple@12b6ca1)), closes [jdalrymple#139](jdalrymple#139)
* **package:** Updating packages and fixing [jdalrymple#140](jdalrymple#140) due to a babel update ([04d1769](jdalrymple@04d1769))

### Features

* Add push rule service ([jdalrymple#143](jdalrymple#143)) ([395f83c](jdalrymple@395f83c))
* Add transfer a project to a new namespace ([jdalrymple#145](jdalrymple#145)) ([87e9f55](jdalrymple@87e9f55))
jdalrymple added a commit that referenced this issue Aug 20, 2018
jdalrymple pushed a commit that referenced this issue Aug 20, 2018
# [3.11.0](3.10.1...3.11.0) (2018-08-20)

### Bug Fixes

* Revert "fix(api): Updating project members all function to include the inherited members.  [#141](#141)" until properly implemented by GitLab (https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6669)  ([24d9bcd](24d9bcd))

### Features

* **projects:** add archive/unarchive functionality ([#168](#168)) ([5e7b1bd](5e7b1bd)), closes [#166](#166)
jdalrymple added a commit that referenced this issue Aug 21, 2018
…de the inherited members. #141" until properly implemented by GitLab (https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6669)

This reverts commit e081a16.

Adding project archive abilities
@max-wittig
Copy link
Contributor

@jdalrymple I guess we can add this feature again, but I would vote to fall back to the old behavior in-case where the endpoint doesn't exist.

@jdalrymple
Copy link
Owner

Hmm, its supported in the latest Gitlab version right? For older behaviour wouldnt using an older version of the package make more sense. Ill finish up merging the typescript changes and then add this change as a breaking change. At least that way it will be obvious in the changelog

@jdalrymple jdalrymple reopened this Sep 4, 2018
@max-wittig
Copy link
Contributor

@jdalrymple Maybe a hint in the README would also be useful, that it only supports 11.2 and up.

@MrSnoozles
Copy link
Author

MrSnoozles commented Sep 4, 2018 via email

@jetersen
Copy link
Contributor

jetersen commented Sep 4, 2018

I agree with @MrSnoozles don't change the behavior of how it used to work otherwise this is not semantic releasing 😅 Your of course welcome to bump the version number if you were to change the behavior but I still think IncludeInherited since GitLab view of members with inheritance is awful that's why we use this function (where inherited are excluded) to get a better overview of projects.

@jdalrymple
Copy link
Owner

@Casz Its definitely semantic if i release a major version, though its a little extreme for this addition lol. Sounds good though, ill change it to be inclusive as opposed to exclusive!

@jetersen
Copy link
Contributor

jetersen commented Sep 4, 2018

Well when I updated you broke my project overview, and I had to either revert or fall in line.

Just to clarify my previous statement:

The semvar.org clearly says:

MAJOR version when you make incompatible API changes,

This commit should have been marked breaking in my honest opinion, since it broke my project overview (that depended on NO inheritance), cause it broke the previous default behavior also it did not help that it was missing from the current API (but that was more of a GitLab issue 😅)

@jdalrymple
Copy link
Owner

Yea i messed it up when i first did it! I would do it properly for the next time.

@jdalrymple jdalrymple added this to the 4.1 milestone Sep 5, 2018
jdalrymple added a commit that referenced this issue Sep 18, 2018
* chore(package): Update jest-extended to the latest version 🚀 0.9.0 (#191)
* chore(package): update lockfile package-lock.json
* feat: Re-add list all project members endpoint (#190, #141)
* feat: Adding markdown support #182 (#193)
* fixes: #188: `stream` option is lost in any `get` request that is streamable (#192)
* feat: Added user snippets API support (#189)
* chore(test): Added test for creating snippets
* feat: Added user edit support #186
@jdalrymple jdalrymple mentioned this issue Sep 18, 2018
Merged
jdalrymple added a commit that referenced this issue Sep 18, 2018
* chore(package): Update jest-extended to the latest version 🚀 0.9.0 (#191)
* chore(package): update lockfile package-lock.json
* feat: Re-add list all project members endpoint (#190, #141)
* feat: Adding markdown support #182 (#193)
* fixes: #188: `stream` option is lost in any `get` request that is streamable (#192)
* feat: Added user snippets API support (#189)
* chore(test): Added test for creating snippets
* feat: Added user edit support #186
jdalrymple pushed a commit that referenced this issue Sep 19, 2018
# [4.1.0](4.0.1...4.1.0) (2018-09-19)

### Features

* Added user edit support [#186](#186) ([95e8999](95e8999))
* Adding markdown support [#182](#182) ([#193](#193)) ([2113e8e](2113e8e))
* Re-add list all project members endpoint ([#190](#190)) ([5b07b6a](5b07b6a)), closes [/github.com/jdalrymple/node-gitlab/commit/e081a1629f33e3af172101b94977f281879539c9#diff-379104d7d595f3793c2d7380496cc3c3](https://github.com//github.com/jdalrymple/node-gitlab/commit/e081a1629f33e3af172101b94977f281879539c9/issues/diff-379104d7d595f3793c2d7380496cc3c3) [#141](#141)
@jdalrymple
Copy link
Owner

🎉 This issue has been resolved in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

4 participants