make Github OAuth Scopes configurable#35
Conversation
|
There was/is no test coverage of the |
|
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
|
👍 |
There was a problem hiding this comment.
This is great as-is but would be even more awesome if it was checkboxes instead of text?
There was a problem hiding this comment.
I disagree. My first instinct reading this was "Yes, of course, checkboxes are better!"
However, after a little bit of thought, I think the advantages are illusory.
This isn't an entry field for an end user, it's for the admin.
Are we really worried that the admin might screw up the install by editing this?
The GitHub API URI is already exposed, along with a million and one other ways to bork the server.
The text box exposes to me a way of interacting directly with GitHub OAuth.
If I use other plugins which depend on this one, and they require unusual scopes, I am free to edit this field.
Not being a java developer, without this being a modifiable field I'd end up filing a duplicate of JENKINS-27691
That is to say, remember that this solves both
https://issues.jenkins-ci.org/browse/JENKINS-23324
and
https://issues.jenkins-ci.org/browse/JENKINS-27691
Not just the former.
Now, checkboxes + a text entry field would be fine, but why bother?
There was a problem hiding this comment.
It's not as much about borking the server as being easier to use (not requiring I go read the GitHub API docs) and being easier to debug.
There was a problem hiding this comment.
There are already over a dozen oauth scopes and, hopefully, the repo scope will get split up it separate read/write and public/private scopes. I feel from a UI perspective that would be too many check boxes. I'd also like to not have to get a PR merged / new release made to adapt to GH scope modifications.
|
Should the default scope still be "repo,read:org" ? Also, a huge thanks and kudos to @jhoblitt for taking the time and energy to figure out how to do this! |
|
I'd default to |
ae49ebd to
946878f
Compare
|
I've updated the PR so that instead of modifying the signature of the primary |
|
@s0undt3ch I believe if a user's org membership and email address is public then no scope would be necessary (but I haven't tired requesting a GH oauth token without scope(s)). I'm now wondering if |
|
@s0undt3ch I've attempted to test the behavior of the |
|
I've opened a Jira issue for the inability to discover private email addresses. https://issues.jenkins-ci.org/browse/JENKINS-27764 |
|
We need this too! 👍 |
|
Well, |
|
@s0undt3ch I agree it should. However, this is a feature PR to "make Github OAuth Scopes configurable", which is why I opened https://issues.jenkins-ci.org/browse/JENKINS-27764 |
|
@jhoblitt agreed. |
|
Voted up! |
|
If anyone is interested in testing this PR without building it from source, I've made an hpi file available. https://s3-us-west-2.amazonaws.com/github-oauth-plugin/github-oauth.hpi |
|
Uploaded to Jenkins but I can only restart it in about 1 or 2 hours... I'll get back to you. |
|
Working perfectly! |
|
When can we expect this merged and released? |
|
👍 |
|
Probably worth checking if anything needs updated here with regard to https://developer.github.com/changes/2015-06-24-breaking-changes-to-organization-permissions-are-now-official/ |
|
Looks like we're all good with those changes. Personally I think this should also default to @jhoblitt Thanks so much for the |
|
Hi! Thank you so much for working on this! We tried downloading the plugin from https://s3-us-west-2.amazonaws.com/github-oauth-plugin/github-oauth.hpi, but we got the error that starts with: We just put the .hpi file (Note: the github-api plugin is installed, and was the one installed via the web UI) Update: I'm not sure what I did wrong in the first place, but manually adding |
|
I think this PR has jumped up to the critical path, since without it most of us will be locked out of our Jenkins servers by the GitHub API change. I'm also pulling down @jhoblitt's HPI file at this point, since that way I can at least add the required read:org scope. |
|
Is the consensus that the default scope should be changed to be solely read:org? |
|
@cyli The easiest way to solve that problem is to manually edit the change it to EDIT: Oh, and restart the Jenkins process afterwards, of course. I think I already voiced support for setting the permissions to solely |
|
@sirosen Thank you! I just figured that out a second ago too :) I appreciate the quick response! |
|
Installed the patch, changed the XML, and restarted. I keep getting this UPDATE: Finally got it working removing |
|
@cyli I'm confused, why didn't you edit the auth scopes via the www UI? |
|
@jhoblitt For some reason trying to use the www UI kept netting me that error. |
I think it'll confusingly break if it doesn't have at least that. |
|
Tested. Thanks. Please update the official plugin so I can back out the hotfix. |
|
any word on this percolating to trunk? |
|
I posted to the Jenkins dev list last week, and bumped my thread a moment ago. There's also a pending request to take over ownership of this plugin that went to the dev list earlier this week. This is a kind of vacuous update, but I figure that several others who are watching this PR would want to know that there's listhost activity associated with this. |
|
Thanks @sirosen! |
|
@sirosen 🤘 |
|
Links to the relevant discussions for anyone interested: |
|
@suryagaddipati Are you still maintaining this plugin? @sirosen asked for commit access, WDYT? |
|
@sirosen I'd be willing to take on co-maintainership. There's some improvements to this PR that could be made I'd be willing to tackle if it looked like it was possible to get it merged. ;) |
|
@daniel-beck i was never a maintainer of this plugin(although i do have commit rights). I believe @skottler is the maintainer AFAIK. I personally don't have any issues with @sirosen getting commit access. More the merrier 👍 |
|
@suryagaddipati Thanks! Since you performed the last few releases I assumed you had taken over. @skottler Do you object to getting a co-maintainer or two in this plugin? |
|
I've currently got commit access as well. I reached out to @skottler via email and he agreed it was fine if I took it over. I posted to the dev mailing list about taking it over as well. I'm also fine with co-maintaining the plugin. I'm all for whatever improves the quality and consistency of releases. I currently maintain the slack plugin. |
|
@samrocketman Sorry, I completely missed your emails. I made you default assignee for new issues in Jira. Please let the dev list know if commit access for @sirosen is still desired, right now it looks like there are a few devs around to handle PRs. Feel free to kick me on IRC if that gets overlooked again. |
|
I'll start testing and merging this coming Sunday after I get back from vacation (i.e. tomorrow). |
|
I don't have any issues with @sirosen getting commit access though I'd still prefer development to occur with code reviews and pull requests. |
|
I have no particular drive to get myself commit access on this project. If someone with administrative rights on the repo feels like granting them, cool beans, but I'm not going to push for it as long as there are at least two people watching PRs on this repo. Looks like this got merged with the default scopes set to "repo,read:org" |
JENKINS-27691