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

Not recognizing organization members #416

Open
rjbell4 opened this issue May 27, 2016 · 2 comments
Open

Not recognizing organization members #416

rjbell4 opened this issue May 27, 2016 · 2 comments

Comments

@rjbell4
Copy link

rjbell4 commented May 27, 2016

I'm using GHPRB for the first time on a GitHub Enterprise instance. I have an organization owned repo fork set to trigger GHPRB. I set the name of the organization (like foo-org) under List of organizations. Their members will be whitelisted.. Although I didn't think it would be necessary, I also set Allow members of whitelisted organizations as admins. I am a member of the organization, and the bot user has been added as a collaborator.

However, when I create a pull request, I get told that an admin needs to approve the pull request; it doesn't seem to automatic whitelist me as an organization member. It's only when I actually add myself as an admin explicitly that pull requests will trigger the job.

Do I have something configured incorrectly? If not, how I can debug this? There's not a whole lot in the Jenkins log to reveal details about checking the organization members, etc.

@jsdevel
Copy link

jsdevel commented Jun 8, 2016

I'm facing this issue as well. It looks like maybe GH's API isn't returning members.

So github does return organization members (see Members API); however, I'm not seeing in this plugin where it actually queries that API. If I call the API endpoint for membership list of an organization without credentials, I get an empty array back. With credentials, I see the members.

@hartzell
Copy link

hartzell commented Dec 11, 2016

I'm also seeing this (on a GitHub enterprise 2.8.3 system). Here's the tail end of my log file:

[George Hartzell] Added comment: retest this please
Dec 11, 2016 1:05:33 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Retest phrase
Dec 11, 2016 1:05:33 AM FINE org.jenkinsci.plugins.ghprb.GhprbGitHub
org.hasMember(member)? user:hartzelg org: ci-template == no

I am fact the owner and only member of the org.

After a bit of poking around, I've come to the conclusion that:

  • if this user is a private member of the org, then the token you're using must have read:org (Read org and team, under admin:org) or admin:org for this query to return 'yes'; or
  • that the user must be a public member of the org.

@DavidTanner -- perhaps the documentation could be touched up? I tried running the Create API Token process, but no matter what I put in the Username temp and Password temp fields the response is a bright red "No username/password credentials provided".

This set of scopes seems to let me do everything I need to do (I'm only working on public repos, so far):

admin:repo_hook, public_repo, read:org, repo:status

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

3 participants