Using Private Repos with GitHub Plugin

259 views
Skip to first unread message

JP Grace

unread,
Jul 10, 2014, 4:16:45 PM7/10/14
to repo-d...@googlegroups.com
Hi,

I'm having a bit of trouble getting Gerrit with the GitHub plugin to allow me to sync/replicate with a private repository. When Gerrit requests the GitHub user's permission to authenticate the Gerrit app, it is only requesting permission to access the public repositories. Then when I go to my account settings in GitHub, the only permissions that the Gerrit app has been granted are: public_repo, user:email. I do not see any configuration to set, either within Gerrit or GitHub, that will allow me to request/grant private repository access. I could really use some help. What am I missing?

Thanks,

JP Grace

JP Grace

unread,
Jul 11, 2014, 2:17:48 PM7/11/14
to repo-d...@googlegroups.com
Hi Everyone,

Any thoughts at all on this would be super helpful. Currently I can't load any private repositories, which is critical if I'm to use Gerrit for code review.

Thanks,

JP

Luca Milanesio

unread,
Jul 13, 2014, 6:15:11 PM7/13/14
to JP Grace, repo-d...@googlegroups.com
Hey JP,
look at the following post on how to login with private repositories support:

The "scope=X" parameter on the login URL relies on X configured to a set of GitHub OAuth scopes in your gerrit.config.

On GerritHub.io we have:

[github]
scopesPrivate = USER,REPO

Hope this helps.

Luca.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

JP Grace

unread,
Jul 14, 2014, 1:01:39 PM7/14/14
to repo-d...@googlegroups.com, joseph....@gmail.com
Hi Luca,

Thanks for your response!

I just changed my gerrit.config's github section to have the "scopesPrivate = USER,REPO" line that you used below. Then I restarted gerrit, cleared my browser cache, revoked my github application access, and reloaded the gerrit page. When it asks me to authenticate with github its still only asking for public access. Then when I try to load the repos within gerrit, I get nothing. Did I miss something? Any other ideas? Do I need to blast away my DB? Start over from scratch?

Thanks,

JP

JP Grace

unread,
Jul 14, 2014, 3:52:19 PM7/14/14
to repo-d...@googlegroups.com, joseph....@gmail.com
Luca,

Nevermind, I downloaded the source and figured it out. The gerrit.config's github configuration needs to be set to:

scopes = USER,REPO

not

scopesPrivate = USER,REPO

Hope this helps anyone that comes after me.

Luca Milanesio

unread,
Jul 14, 2014, 7:19:39 PM7/14/14
to JP Grace, repo-d...@googlegroups.com
Hi JP,
the scopes = USER,REPO changes the default scope for *every* user login.

My suggestion was on how to enable private login "on demand" by adding a query parameter to your Gerrit login, as suggested in http://gitenterprise.me/2014/03/03/gerrithub-code-review-for-github-private-repositories-early-access/.
/login?scope= scopesPrivate would have worked.

However if you wanted to change the default for *every* user login, you made the correct config change :-)
Source code never lies ;-)

Luca.
Reply all
Reply to author
Forward
0 new messages