jenkinsci/github-oauth-plugin — pull request #11 by bjeanes (2013-04-30 16:56:29+00:00)
Title: Working GitHub Enterprise support

Summary of changes:

* [x] Bumped version of `github-api` dependency to `1.40` (though I think anything starting from `1.34` and higher *might* be sufficient)
* This is because newer versions of `github-api` support more explicit API root setting, which is preferred over trying to be too clever with guessing the differences between Enterprise and github.com. The commits in question on `github-api` are [35d45ca4](https://github.com/kohsuke/github-api/commit/35d45ca47dc6d41e22219e919399ab7b278d50a3) and [5166202f](https://github.com/kohsuke/github-api/commit/5166202f6799abe72f5e382fed4eb805c626cc6b), both of which are in the `github-api-1.34` tag on that repository.
* [x] Renamed `githubUri` to `githubWebUri`.
* [x] Kept getters/setters for old field name with a `@deprecated` annotation and reason
* [x] Kept the old constructor (also `@deprecated`) and it will set the API uri to a "best guess" (essentially `"https://api.github.com"` or `githubWebUri + "/api/v3"`)
* [x] Added `githubApiUri`.
* [x] Changed the jelly forms to account for field changes and improved the documentation in the associated help files.
* [x] Changed the serialization to account for new field, but still load old field into the `githubWebUri` field to be backwards compatible with existing configs.
* When the old configuration XML node is detected, I also write out the `githubApiUri` field. This works as expected when Jenkins is booting. However, in my testing, something else (possibly just the config screen) is resetting it back to the default of "https://api.github.com".

I have tested these changes locally with an OAuth application set up at github.com as well as our one one our GitHub Enterprise installation. Both work as expected and correctly authenticate. If someone is unable to test this against GHE, I'd be happy to record a screencast showing the usage of both plugins.