microsoft / PowerShellForGitHub

Microsoft PowerShell wrapper for GitHub API
Other
582 stars 184 forks source link

Missing Org Role information from Get-GitHubOrganizationMember #398

Closed montereyharris closed 1 year ago

montereyharris commented 1 year ago

Issue Details

When you run Get-GitHubOrganizationMember it only returns user information on the members and not the role with in the organization

Response in Github Documents [ { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false } ]

Steps to reproduce the issue

Get-GitHubOrganizationMember -OrganizationName chwinery
   # Include your repro steps here

Solution

Add the ability to get roles by adding -username parameter

Operating System

OsName : Microsoft Windows 10 Pro OsOperatingSystemSKU : 48 OsArchitecture : 64-bit WindowsVersion : 2009 WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406 OsLanguage : en-US OsMuiLanguages : {en-US}

PowerShell Version

Name Value


PSVersion 7.2.6 PSEdition Core GitCommitId 7.2.6 OS Microsoft Windows 10.0.19044 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

Module Version

Running: 0.16.1 Installed: 0.16.1

HowardWolosky commented 1 year ago

There's no bug here. Get-GitHubOrganizationMember currently maps to the functionality exposed by the API to list the members of an organization which also does not return role information.

What you're looking for is getting the organization memberships for a user which does return the role information. That API has simply not been implemented yet. @tigerfansga had previously indicated that they were planning to implement that as part of #351, but I haven't heard any updates on that yet (although I think their work on migrating all of the tests to Pester 5 (#194) probably took up more time than originally anticipated).

Closing this off as a dupe since we're already tracking API completeness for Organizations with #351.