gocd-contrib/gocd-build-status-notifier

Plugin does not read from /var/go/.github

Closed this issue · 9 comments

The plugin loads github credentials from system properties, and works fine, but it does not work if credentials are put in /var/go/.github as described in README. The code does appears to only pull form system properties: https://github.com/srinivasupadhya/gocd-build-status-notifier/blob/master/src/main/java/com/tw/go/plugin/provider/github/GitHubProvider.java#L24-27

when system property isn't provided this happens. And since we use github-api library it picks ~/.github for credentials.

I will give it another try. It didn't seem to be working for me but based on the code above it looks like it would work.

Thanks for the plugin by the way, this was a big feature that was missing and I think it will go a long way.

I think it will go a long way.

:) hoping for the same 👍

So when I set values in system properties, I am able to update PR status in our Enterprise Github.

However, GitHub.connect() does not appear to be honoring the values i set in /var/go/.github as the endpoint being logged in plugin-github.pr.status.log is not my custom endpoint, but the default api.github.com. What is even more odd is that /var/go/.github is being read just fine by the gocd-build-github-pull-requests plugin.

i made small changes to docs. in ~/.github you will need to populate:

login=johndoe
oauth=thisaintatoken

I have it setup for build.go.cd so it should work.

i have been trying to with login/password, but like i said above, it is not reading the /var/go/.github file is not being read. The as https://api.github.com is the endpoint that is logged in the request instead of the enterprise endpoint I have set. However, the gocd-build-github-pull-requests plugin is reading this file successfully and building PRs.

I am also not getting an IOException which i would expect if the file could not be read

I think i found the solution. For reading from ~./github to work with a custom Enterprise Github endpoint, the feature from this pull request is required. The POM for this build uses github-api-1.61 which does not yet include this feature. I will build a new version of this plugin with github-api-1.68 and test

tested with new build and custom endpoint now works