Giter Club home page Giter Club logo

gocd-build-status-notifier's Introduction

GoCD build status notifier

This is GoCD's Notification plugin that updates SCM with build status.

Supported:

  • GitHub Pull Request status
  • Stash Pull Request status
  • Gerrit Change Set status

Requirements

These plugins require GoCD version >= v15.x or above

Get Started

Installation:

  • Download the latest plugin jar from Releases section. Place it in <go-server-location>/plugins/external & restart Go Server.

Behavior

  • Go Server notifies the plugin on every Stage Status Change with relevant details. The plugin scans the build-cause to see if the github.pr / stash.pr / gerrit.cs material is present.
  • If it is, then Pull Request/Change Set status is updated with status=stage-result, context=pipeline-name/stage-name & target-url=trackback-url.

Configuration

  • You will see Github Pull Requests status notifier / Stash Pull Requests status notifier / Gerrit Change Set status notifier / GitLab Feature Branch status notifier on plugin listing page Plugins listing page

  • You can configure the plugin (this feature requires GoCD version >= v15.2, use system properties to configure the plugin). The details should be as follows:

    • Server Base URL The URL of your go-server (by default, http://localhost:8153).
    • End Point If using enterprise edition, this needs to be configured for the enterprise endpoint. Else, it can be left blank.
    • Username A Github user with push access to the repository.
    • Password If not using two factor authentication, this is the password for the given Github user. Else, it can be left blank.
    • OAuth Token If using two-factor authentication, provide a personal access token (with the repo:status oath scope) instead of the password above. Else, it can be left blank.

Configure plugin pop-up

  • When the stage status changes... Pipeline Schedule

  • The PR state is updated! Update Status

Target URL:

  • You can provide trackback through system property go.plugin.build.status.go-server. It defaults to 'http://localhost:8153' if not available. Eg:
-Dgo.plugin.build.status.go-server=http://localhost:8153

GitHub

Authentication:

  • You can choose to provide username & password through system property go.plugin.build.status.github.username & go.plugin.build.status.github.password. Eg:
-Dgo.plugin.build.status.github.username=johndoe
-Dgo.plugin.build.status.github.password=thisaintapassword

or provide the oauth access token through system property go.plugin.build.status.github.oauth.

-Dgo.plugin.build.status.github.username=johndoe
-Dgo.plugin.build.status.github.oauth=thisaintatoken
  • (or) through file ~/.github on Go Server with the following contents:
login=johndoe
password=thisaintapassword

or

login=johndoe
oauth=thisaintatoken

Github Enterprise:

  • You can choose to provide endpoint through system property go.plugin.build.status.github.endpoint. Eg:
-Dgo.plugin.build.status.github.endpoint=http://code.yourcompany.com
  • (or) through file ~/.github on Go Server with the following contents:
endpoint=http://code.yourcompany.com

Stash

Setup:

  • You need to provide endpoint, username & password through system property go.plugin.build.status.stash.endpoint, go.plugin.build.status.stash.username & go.plugin.build.status.stash.password. Eg:
-Dgo.plugin.build.status.stash.endpoint=http://localhost:7990
-Dgo.plugin.build.status.stash.username=johndoe
-Dgo.plugin.build.status.stash.password=thisaintapassword

Gerrit

Setup:

  • You need to provide endpoint, username, password & codeReviewLabel through system property go.plugin.build.status.gerrit.endpoint, go.plugin.build.status.gerrit.username, go.plugin.build.status.gerrit.password, go.plugin.build.status.gerrit.codeReviewLabel. Eg:
-Dgo.plugin.build.status.gerrit.endpoint=http://localhost:7990
-Dgo.plugin.build.status.gerrit.username=johndoe
-Dgo.plugin.build.status.gerrit.password=thisaintapassword
-Dgo.plugin.build.status.gerrit.codeReviewLabel=Verified

Gitlab

Setup:

-Dgo.plugin.build.status.gitlab.endpoint=http://gitlab.com
-Dgo.plugin.build.status.gitlab.oauth=XXXX

FAQs

gocd-build-status-notifier's People

Contributors

arvindsv avatar ashwanthkumar avatar bdpiprava avatar chadlwilson avatar ckaushik avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar doug-lethin-simplisafe avatar gradle-update-robot avatar grug avatar ibnc avatar juhasipo avatar jyotisingh avatar ketan avatar kritika-singh3 avatar mrmanc avatar srinivasupadhya avatar stevendgonzales avatar varshavaradarajan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gocd-build-status-notifier's Issues

Suggestion: could GitHub Checks be a nicer way to report back to GitHub?

I just spotted GitHub Checks today, which I must have been blind to for a while. I wondered why the build statuses weren’t showing up in the Checks tab, so went to read about them. It looks to me like it could be a nicer way to surface richer errors from GoCD to GitHub. Not something I’m able to work on, but I thought I’d raise a suggestion in case anyone else has input?

Could not update build status - Error occurred. Status Code: 404

Hi,

I've installed the stash-pr-status-1.3.jar on our GoCD 17.8.0 server and configured it with Server URL and End Point both set to http://localhost:8153. A user/password is also configured with access to our BitBucket server.

The "Stash Pull Requests Builder" (ashwanthkumar/gocd-build-github-pull-requests) plugin properly triggers a new build when a pull request is created. And also the status notifier plugin triggers, but keeps logging the error below. I'm out of ideas about what's wrong:

  • the git URL is definitely correct (no idea why there's a 404...)
  • the configured user has admin permissions

Any pointers would be highly appreciated

Regards,
Dominik

2017-09-15 16:05:08,091 ERROR [73@MessageListener for PluginNotificationListener] BuildStatusNotifierPlugin:77 - Error occurred. Could not update build status - URL: ssh://[email protected]:7999/~dokaspar/tools.git Revision: 400d88363337d6b12b6a1fc14d0ad13662783218 Build: dokaspar-test-pr/14/defaultStage/1 Result: Passed java.lang.RuntimeException: Error occurred. Status Code: 404 at com.tw.go.plugin.util.HTTPClient.postRequest(HTTPClient.java:73) at com.tw.go.plugin.provider.stash.StashProvider.updateStatus(StashProvider.java:73) at com.tw.go.plugin.BuildStatusNotifierPlugin.handleStageNotification(BuildStatusNotifierPlugin.java:160) at com.tw.go.plugin.BuildStatusNotifierPlugin.handle(BuildStatusNotifierPlugin.java:84) at com.thoughtworks.go.plugin.infra.DefaultPluginManager$2.execute(DefaultPluginManager.java:166) at com.thoughtworks.go.plugin.infra.DefaultPluginManager$2.execute(DefaultPluginManager.java:161) at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:315) at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:245) at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:161) at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:32) at com.thoughtworks.go.plugin.access.notification.NotificationExtension.notify(NotificationExtension.java:72) at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugin(PluginNotificationService.java:61) at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugins(PluginNotificationService.java:53) at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:30) at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:21) at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:73) at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:53) at java.lang.Thread.run(Thread.java:745)

Configurable Gerrit notification labels

The plugin is setting the Code-Review label to +1 or -1, depending on whether a stage passed or failed. A more usual practice in Gerrit is to use the Verified label for this purpose. It is disabled by default in newer versions of Gerrit but it can be easily be enabled:

https://gerrit-review.googlesource.com/Documentation/config-labels.html#label_Verified

Would you consider making the voting label configurable or perhaps even switch the default to Verified?

Wrong version displayed

This got me confused. I've downloaded the version 1.4 jar file from the releases tab and put it into the GoCD plugin folder. The plugin shows up once I restart my GoCD server, but the version that is displayed in the overview is 1.3. The version of the jar file is 1.4, though.

auswahl_001

GitHub 401 on status updates for private repo

Hiya,

This plugin is throwing 401s on every status update attempt. According to GitHub's docs, this means authentication has failed or no creds were passed at all, but the logs don't contain the json passed back by GitHub, so I can't really tell what's up. I've tried configuring the username/password using both .github as well as by defining GO_SERVER_SYSTEM_PROPERTIES in /etc/default/go-server: export GO_SERVER_SYSTEM_PROPERTIES="-Dgo.plugin.build.status.github.username=vNucleus-GoCD -Dgo.plugin.build.status.github.password={snip}'. Ideally I'd like to use oAuth for this, but have had no luck getting that working either. It seems as if the plugin is continually trying to authenticate as an anonymous user, ignoring all the creds I've tried throwing at it.

The gocd-build-github-pull-requests plugin is successfully authing and building PRs both using oAuth as well as password so I know the creds are good. It's just this status plugin that seems to be ignoring them. Any tips?

Thanks!
James

2016-02-06 18:03:18,401 ERROR [64@MessageListener for PluginNotificationListener] BuildStatusNotifierPlugin:77 - Error occurred. Could not update build status - URL: https://github.com/vNucleus/portal Revision: a66d5ff3cf6cf25fda393931f3a4492d7d98d697 Build: Build-PR/7/Build/1 Result: Failed
java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.github.com/repos/vNucleus/portal
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1676)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1672)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at org.kohsuke.github.Requester.parse(Requester.java:451)
    at org.kohsuke.github.Requester._to(Requester.java:224)
    at org.kohsuke.github.Requester.to(Requester.java:191)
    at org.kohsuke.github.GitHub.getRepository(GitHub.java:321)
    at com.tw.go.plugin.provider.github.GitHubProvider.updateCommitStatus(GitHubProvider.java:54)
    at com.tw.go.plugin.provider.github.GitHubProvider.updateStatus(GitHubProvider.java:48)
    at com.tw.go.plugin.BuildStatusNotifierPlugin.handleStageNotification(BuildStatusNotifierPlugin.java:178)
    at com.tw.go.plugin.BuildStatusNotifierPlugin.handle(BuildStatusNotifierPlugin.java:88)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:172)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:167)
    at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:315)
    at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:245)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:167)
    at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:32)
    at com.thoughtworks.go.plugin.access.notification.NotificationExtension.notify(NotificationExtension.java:74)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugin(PluginNotificationService.java:61)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugins(PluginNotificationService.java:53)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:30)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:21)
    at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:65)
    at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:50)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.github.com/repos/vNucleus/portal
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1627)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at org.kohsuke.github.Requester.parse(Requester.java:447)
    ... 21 more

Status not update in Github when credentials changed

Hi.

I'm experiencing an issue with the status notifier. We updated the user and the personal token with a different one and there is no communication at all with GitHub.

I got this error:
"textPayload: "jvm 1 | 2020-10-26 00:58:11,421 ERROR [159@MessageListener for PluginNotificationMessageListener] p.g.p.s.c.t.g.p.BuildStatusNotifierPlugin:127 [plugin-github.pr.status] - Error occurred. Could not update build status - URL: [email protected]:some-company/some-repo.git Revision: 22733ddfbced2dbb85a7e671d669814c18116572 Build: property-service_PR/481/unit-test/1 Result: Unknown"

Anyone experience something similar and solved it?

Cheers.

UnknownHostException: api.github.com

I'm getting this error and the build status doesn't change from "pending" to anything else. The server is behind a vpn, but if i try to connect to the url from the shell:

~# wget https://api.github.com

it works

--2016-01-19 02:08:40--  https://api.github.com/
Resolving api.github.com (api.github.com)... 192.30.252.127
Connecting to api.github.com (api.github.com)|192.30.252.127|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2064 (2.0K) [application/json]
Saving to: 'index.html'

Go Version: 15.1.0(1863-42e58c22aefd03)
Log:

2016-01-19 01:57:37,147 ERROR [62@MessageListener for PluginNotificationListener] BuildStatusNotifierPlugin:77 - Error occurred. Could not update build status - URL: https://github.com/xxx/xxx Revision: ede4954bcdfc45329f3b50993c36ea9f1787ac4c Build: xxx/6/buildStage/1 Result: Failed
java.net.UnknownHostException: api.github.com
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1889)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1884)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1883)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1456)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at org.kohsuke.github.Requester.handleApiError(Requester.java:482)
    at org.kohsuke.github.Requester._to(Requester.java:245)
    at org.kohsuke.github.Requester.to(Requester.java:191)
    at org.kohsuke.github.GitHub.getRepository(GitHub.java:321)
    at com.tw.go.plugin.provider.github.GitHubProvider.updateCommitStatus(GitHubProvider.java:54)
    at com.tw.go.plugin.provider.github.GitHubProvider.updateStatus(GitHubProvider.java:48)
    at com.tw.go.plugin.BuildStatusNotifierPlugin.handleStageNotification(BuildStatusNotifierPlugin.java:178)
    at com.tw.go.plugin.BuildStatusNotifierPlugin.handle(BuildStatusNotifierPlugin.java:88)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:172)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:167)
    at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:315)
    at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:245)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:167)
    at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:33)
    at com.thoughtworks.go.plugin.access.notification.NotificationExtension.notify(NotificationExtension.java:74)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugin(PluginNotificationService.java:61)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugins(PluginNotificationService.java:53)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:30)
    at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:21)
    at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:65)
    at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:50)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.UnknownHostException: api.github.com
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:656)
    at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at org.kohsuke.github.Requester.parse(Requester.java:447)
    at org.kohsuke.github.Requester._to(Requester.java:224)
    ... 20 more

plugin not logging

Trying to use this plugin, I noticed that there are no logs being output into /var/log/go-server/plugin-stash.pr.status.log

I tried debugging the best I could but I couldn't find where the problem was. Any idea how I can enable logging for this plugin? (I should mention logging appears to be working for the poller /var/log/go-server/plugin-stash.pr.log)

The plugin has no output, but isn't updating the status of builds in stash. I'm not really sure where to look from here. I triple checked things like permssions/ownership etc. Any advice in debugging this would be awesome.

Update status only if material has changed

It's common to have many repositories that follow the same structure, in a way that you could have a single general pipeline with multiple materials and figure out which one to build based on GO_MATERIAL_[MATERIAL_NAME]_HAS_CHANGED env variables.
Right now, if we do so, all pull requests in different materials will be updated no matter if they triggered the pipeline or not. It would be nice if a check is added here:

for (Map materialRevision : materialRevisions) {
Map material = (Map) materialRevision.get("material");
if (isMaterialOfType(material, provider.pollerPluginId())) {
Map materialConfiguration = (Map) material.get("scm-configuration");
String url = (String) materialConfiguration.get("url");
List<Map> modifications = (List<Map>) materialRevision.get("modifications");
String revision = (String) modifications.get(0).get("revision");
Map modificationData = (Map) modifications.get(0).get("data");
String prId = (String) modificationData.get("PR_ID");
if (StringUtils.isEmpty(prId)) {
prId = (String) modificationData.get("CURRENT_BRANCH");
}
try {
provider.updateStatus(url, pluginSettings, prId, revision, pipelineStage, result, trackbackURL);
} catch (Exception e) {
LOGGER.error(String.format("Error occurred. Could not update build status - URL: %s Revision: %s Build: %s Result: %s", url, revision, pipelineInstance, result), e);
}
}
}

to run updateStatus only if that material has changed. It makes sense to me to have that check unconditionally, but at least it can be a configuration if I'm missing something.

New release?

It seems there is new feature for gerrit available in master for verified label, but it is not officially release. Is there a plan to do so?

Github build status for downstream Pipelines

Hi,

I have a multiple pipeline setup (mainly because I need to use templates).

So I have a main upstream pipeline that uses the SCM directly and for that pipeline I do see the status on github.
but for all other downstream pipelines which use the upstream pipeline as a material and NOT the SCM directly I don't see any status updates (they are not listed) on github.

is there a way to see all downstream pipelines ?

I am using version 1.7.1-169 of this plugin

JsonParseException in org.kohsuke.github when using Github Enterprise

When trying to connect to a Github Enterprise 2.20 instance, the following error keeps appearing in the logs and there is no status indicated within Github Enterprise:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">



  <link crossorigin="use-credentials" media="all" integrity="sha512-hddDYPWR0gBbqLRmIZP242WMEiYsVkYI2UCYCVUHB4h5DhD2cbtFJYG+HPh21dZGb+sbgDHxQBNJCBq7YbmlBQ==" rel="stylesheet" href="https://<GHE-INSTANCE>/assets/frameworks-02a3eaa24db2bd1ed9b64450595fc2cf.css" />
  <link crossorigin="use-credentials" media="all" integrity="sha512-virfO4ceMMzCPFi08e0bL1pXMXF3ykBOdO+cOkFu6hqjl/ympiylGiiYhsaumnY+oVIHNqPwmxmEeCcYGWZwlA==" re"[truncated 10882 chars]; line: 6, column: 2]
	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1798)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:663)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:561)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1892)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:747)
	at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4129)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3988)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2992)
	at org.kohsuke.github.Requester.parse(Requester.java:629)
	... 23 common frames omitted
2020-09-21 20:30:19,260 ERROR [158@MessageListener for PluginNotificationMessageListener] BuildStatusNotifierPlugin:127 - Error occurred. Could not update build status - URL: https://<GHE-INSTANCE>/<ORG>/<REPO>.git Revision: 8d55ed959948ef663725fefcfefcb36b848012dc Build: <PIPELINE>/10/<STAGE>/1 Result: Passed
org.kohsuke.github.HttpException: Server returned HTTP response code: 200, message: 'OK' for URL: https://<GHE-INSTANCE>/login?return_to=https%3A%2F%2F<GHE-INSTANCE>%2Fuser
	at org.kohsuke.github.Requester.parse(Requester.java:646)
	at org.kohsuke.github.Requester.parse(Requester.java:607)
	at org.kohsuke.github.Requester._to(Requester.java:285)
	at org.kohsuke.github.Requester.to(Requester.java:247)
	at org.kohsuke.github.GitHub.getMyself(GitHub.java:384)
	at org.kohsuke.github.GitHub.<init>(GitHub.java:158)
	at org.kohsuke.github.GitHubBuilder.build(GitHubBuilder.java:207)
	at org.kohsuke.github.GitHub.connectUsingOAuth(GitHub.java:223)
	at com.tw.go.plugin.provider.GitHubProvider.createGitHubClient(GitHubProvider.java:98)
	at com.tw.go.plugin.provider.GitHubProvider.updateCommitStatus(GitHubProvider.java:82)
	at com.tw.go.plugin.provider.GitHubProvider.updateStatus(GitHubProvider.java:72)
	at com.tw.go.plugin.BuildStatusNotifierPlugin.handleStageNotification(BuildStatusNotifierPlugin.java:171)
	at com.tw.go.plugin.BuildStatusNotifierPlugin.handle(BuildStatusNotifierPlugin.java:91)
	at com.thoughtworks.go.plugin.infra.DefaultPluginManager.lambda$submitTo$0(DefaultPluginManager.java:134)
	at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:208)
	at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:164)
	at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:131)
	at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:49)
	at com.thoughtworks.go.plugin.access.notification.NotificationExtension.notify(NotificationExtension.java:83)
	at com.thoughtworks.go.server.messaging.notifications.PluginNotificationMessageListener.onMessage(PluginNotificationMessageListener.java:44)
	at com.thoughtworks.go.server.messaging.notifications.PluginNotificationMessageListener.onMessage(PluginNotificationMessageListener.java:29)
	at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:83)
	at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:63)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: (String)"

It seems that Jenkins has had a very similar issue. I tried using the suggested solution but it didn't help in this case. Is anyone else seeing this error? Is there a real solution that can be implemented rather than just a work-around (dependency upgrade, etc)?

SSL - How to provide a certificate (or turn off validation)?

How is it possible to configure a certificate/keystore for this plugin?
Or is it possible to turn of validation similar to the curl --insecure flag?

I cannot get around the following exception in the plugin-stash.pr.status.log file:

2017-09-18 13:34:36,622 ERROR [74@MessageListener for PluginNotificationListener] BuildStatusNotifierPlugin:77 - Error occurred. Could not update build status - URL: https://example.xom/bitbucket/scm/~dokaspar/tools.git Revision: d7c7e7e55895ebce93ffd1b51f699b59af85637a Build: dokaspar-test-pr/30/defaultStage/1 Result: Passed javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026) at sun.security.ssl.Handshaker.process_record(Handshaker.java:961) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at com.tw.go.plugin.util.HTTPClient.postRequest(HTTPClient.java:70) at com.tw.go.plugin.provider.stash.StashProvider.updateStatus(StashProvider.java:73) at com.tw.go.plugin.BuildStatusNotifierPlugin.handleStageNotification(BuildStatusNotifierPlugin.java:160) at com.tw.go.plugin.BuildStatusNotifierPlugin.handle(BuildStatusNotifierPlugin.java:84) at com.thoughtworks.go.plugin.infra.DefaultPluginManager$2.execute(DefaultPluginManager.java:166) at com.thoughtworks.go.plugin.infra.DefaultPluginManager$2.execute(DefaultPluginManager.java:161) at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:315) at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:245) at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:161) at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:32) at com.thoughtworks.go.plugin.access.notification.NotificationExtension.notify(NotificationExtension.java:72) at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugin(PluginNotificationService.java:61) at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugins(PluginNotificationService.java:53) at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:30) at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:21) at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:73) at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:53) at java.lang.Thread.run(Thread.java:745) Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387) at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292) at sun.security.validator.Validator.validate(Validator.java:260) at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324) at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1496) ... 36 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280) at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382) ... 42 more

Dependabot couldn't find a pom.xml for this project

Dependabot couldn't find a pom.xml for this project.

Dependabot requires a pom.xml to evaluate your project's current Java dependencies. It had expected to find one at the path: /pom.xml.

If this isn't a Java project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

not existing Gerrit commit ID

I´ve setup Gerrit material on a branch. Pipeline also starts after someone sets gerrit review to +1 or to +2 (+2 = with merge to master branch). In these cases the pipeline fails, the reported gerrit commit ID does not exist.

check connection failed. Server returned HTTP response code: 401

Hi,

I am using latest version of this plugin and not able to connect to the github repository while checking the connectivity from my pipeline. Can you please help?

Error:
check connection failed. Server returned HTTP response code: 401 for URL: https://api.github.com/repos/***

Thanks,
Hemanth

Plugin versions are all set to stash.pr.status

Building any plugin from this repo seems to copy plugin id and description from Stash PR plugin

image

Steps to reproduce:

Build the project
docker run --rm -v "$PWD":/home/gradle/project -w /home/gradle/project gradle gradle clean build

Check the plugin.xml
cat gitlab-mr-status/build/resources/main/plugin.xml

Could not update build status

Hi,

I am unable to get verification posted back to Gerrit post build based on the Go stage outcome:

2016-02-29 13:28:32,788 ERROR [75@MessageListener for PluginNotificationListener] BuildStatusNotifierPlugin:77 - Error occurred. Could not update build status - URL: http://< gerritserver >:8080/ Revision: fe4ef57f88f2f4b66203b878c80915e158c7a79a Build: sonar/26/gitbash/1 Result: Failed
java.lang.IllegalArgumentException: Host name may not be null
at org.apache.http.util.Args.containsNoBlanks(Args.java:81)
at org.apache.http.HttpHost.(HttpHost.java:80)
at com.tw.go.plugin.util.HTTPUtils.getHttpHost(HTTPUtils.java:88)
at com.tw.go.plugin.util.HTTPUtils.getRequest(HTTPUtils.java:28)
at com.tw.go.plugin.provider.gerrit.GerritProvider.updateStatus(GerritProvider.java:51)
at com.tw.go.plugin.BuildStatusNotifierPlugin.handleStageNotification(BuildStatusNotifierPlugin.java:178)
at com.tw.go.plugin.BuildStatusNotifierPlugin.handle(BuildStatusNotifierPlugin.java:88)
at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:172)
at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:167)
at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:315)
at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:245)
at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:167)
at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:32)
at com.thoughtworks.go.plugin.access.notification.NotificationExtension.notify(NotificationExtension.java:74)
at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugin(PluginNotificationService.java:61)
at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugins(PluginNotificationService.java:53)
at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:30)
at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:21)
at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:65)
at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:50)
at java.lang.Thread.run(Unknown Source)

Within the server.cmd of Go

-Dgo.plugin.build.status.gerrit.endpoint=http://< gerritserver >:8080/ -Dgo.plugin.build.status.gerrit.username=gocd -Dgo.plugin.build.status.gerrit.password= -Dgo.plugin.build.status.go-server=http://localhost:8153"

Material is setup in Go as :
URL: http://< gerritserver >:8080/
username: gocd
password:

Any reason or where this config must be setup?

[Enhancement] Provide an option to rerun the build from PR

Would it be possible to provide an option to retrigger the pipeline irrespective of last build status?

My Use case: I have used this plugin to check the status of a few pipelines before merging a PR. I achieved this by creating a new pipeline which checks the status of dependent pipelines. The check runs once and based on the status it will allow or block merging of PR.

If I want to check the status of pipelines before merging then I will have to again rerun the status check to make sure the dependent pipelines are green. If we can add an option to rerun the pipeline from Github PR UI, it would be really great.

Gerrit notification generates too many comments

Thanks for adding Gerrit support. I've been testing it over the past couple days.

One of the issues I noticed is that it seems like the notification plugin is adding two comments to the Gerrit change per GoCD stage that completes successfully ("-Code Review" and "Code Review +1/-1"). This was unexpected. I expected there to be exactly one comment on the changeset from Go, one +1 or -1 depending on whether the pipeline passed or failed, not one per stage. This has several issues:

  1. Email spam. With a four stage pipeline, this generates eight emails to every person on the reviewer list. Gerrit is already pretty chatty over email, and this makes it worse without seemingly adding any value.
  2. UI clutter. Again, with a four stage pipeline, this generates eight comments per patch set. If the change goes through five patch sets (not uncommon), the build notifier will generate 40 comments, completely overwhelming any comments left by human reviewers.
  3. I don't think the plugin needs to do a "-Code Review". Gerrit should be smart enough to flip the value of an existing label when it changes. This is what my curl workaround script does.

Is this a bug or a deliberate design decision?

For reference, this is the relevant part of my workaround script:

curl -XPOST -H "Content-Type: application/json" --digest --user [username]:[password] [gerrit-url]/a/changes/[gerrit-change-number]/revisions/[gerrit-change-revision]/review -d "{'message': '[message with link to failing build on GO]', 'labels': { 'Verified': [+1 or -1] } }"

No longer works

I see the following in the logs. Here's a fix in the upstream library that should resolve the issue.

2017-11-14 21:23:53,522 ERROR [76@MessageListener for PluginNotificationListener] BuildStatusNotifierPlugin:82 - Error occurred. Could not update build status - URL: https://mirrors.gocd.org/git/gocd/gocd Revision: 3eafdcc875eea114601ce7b9e65f52b26a7d52cf Build: build-windows-PR/1993/build-non-server/5 Result: Failed
java.io.IOException: Failed to deserialize {"url":"https://api.github.com/repos/gocd/gocd/statuses/3eafdcc875eea114601ce7b9e65f52b26a7d52cf","id":4316650825,"state":"failure","description":"","target_url":"https://build.gocd.org/go/pipelines/build-windows-PR/1993/build-non-server/5","context":"build-windows-PR/build-non-server","created_at":"2017-11-15T02:23:53Z","updated_at":"2017-11-15T02:23:53Z","creator":{"login":"gocd-ci-user","id":12554687,"avatar_url":"https://avatars0.githubusercontent.com/u/12554687?v=4","gravatar_id":"","url":"https://api.github.com/users/gocd-ci-user","html_url":"https://github.com/gocd-ci-user","followers_url":"https://api.github.com/users/gocd-ci-user/followers","following_url":"https://api.github.com/users/gocd-ci-user/following{/other_user}","gists_url":"https://api.github.com/users/gocd-ci-user/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd-ci-user/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd-ci-user/subscriptions","organizations_url":"https://api.github.com/users/gocd-ci-user/orgs","repos_url":"https://api.github.com/users/gocd-ci-user/repos","events_url":"https://api.github.com/users/gocd-ci-user/events{/privacy}","received_events_url":"https://api.github.com/users/gocd-ci-user/received_events","type":"User","site_admin":false}}
	at org.kohsuke.github.Requester.parse(Requester.java:457)
	at org.kohsuke.github.Requester._to(Requester.java:224)
	at org.kohsuke.github.Requester.to(Requester.java:191)
	at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:780)
	at com.tw.go.plugin.provider.github.GitHubProvider.updateCommitStatus(GitHubProvider.java:69)
	at com.tw.go.plugin.provider.github.GitHubProvider.updateStatus(GitHubProvider.java:57)
	at com.tw.go.plugin.BuildStatusNotifierPlugin.handleStageNotification(BuildStatusNotifierPlugin.java:160)
	at com.tw.go.plugin.BuildStatusNotifierPlugin.handle(BuildStatusNotifierPlugin.java:84)
	at com.thoughtworks.go.plugin.infra.DefaultPluginManager$2.execute(DefaultPluginManager.java:167)
	at com.thoughtworks.go.plugin.infra.DefaultPluginManager$2.execute(DefaultPluginManager.java:162)
	at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:316)
	at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:246)
	at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:162)
	at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:48)
	at com.thoughtworks.go.plugin.access.notification.NotificationExtension.notify(NotificationExtension.java:72)
	at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugin(PluginNotificationService.java:62)
	at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugins(PluginNotificationService.java:54)
	at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:30)
	at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:21)
	at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:73)
	at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:53)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Numeric value (4316650825) out of range of int
 at [Source: java.io.StringReader@438f00f6; line: 1, column: 114] (through reference chain: org.kohsuke.github.GHCommitStatus["id"])
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:232)
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:197)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1311)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:297)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:121)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2888)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2034)
	at org.kohsuke.github.Requester.parse(Requester.java:455)
	... 21 common frames omitted
Caused by: com.fasterxml.jackson.core.JsonParseException: Numeric value (4316650825) out of range of int
 at [Source: java.io.StringReader@438f00f6; line: 1, column: 114]
	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1369)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:532)
	at com.fasterxml.jackson.core.base.ParserBase.convertNumberToInt(ParserBase.java:847)
	at com.fasterxml.jackson.core.base.ParserBase.getIntValue(ParserBase.java:643)
	at com.fasterxml.jackson.databind.deser.std.StdDeserializer._parseInteger(StdDeserializer.java:306)
	at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:319)
	at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:301)
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:464)
	at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:107)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:295)
	... 25 common frames omitted

ON MERGE return pr number

Is there a possiblity to return the pull request number, as an environment variable?

I can't find a way to get the pull request number with just the commit hash.

During a pull request event the PR number is present.

Build status not updating for private repo.

The plugin just stopped working, probably because Github API library is not being updated. I have provided correct github credentials.

2016-01-11 10:21:25,355 ERROR [62@MessageListener for PluginNotificationListener] BuildStatusNotifierPlugin:77 - Error occurred. Could not update build status - URL: https://github.
com/xxx/xxx.git Revision: xxx Build: xxx-pr/105/install-rebuild-test/1 Result: Failed
java.io.FileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
        at org.kohsuke.github.Requester.handleApiError(Requester.java:494)
        at org.kohsuke.github.Requester._to(Requester.java:245)
        at org.kohsuke.github.Requester.to(Requester.java:191)
        at org.kohsuke.github.GitHub.getRepository(GitHub.java:321)
        at com.tw.go.plugin.provider.github.GitHubProvider.updateCommitStatus(GitHubProvider.java:54)
        at com.tw.go.plugin.provider.github.GitHubProvider.updateStatus(GitHubProvider.java:48)
        at com.tw.go.plugin.BuildStatusNotifierPlugin.handleStageNotification(BuildStatusNotifierPlugin.java:178)
        at com.tw.go.plugin.BuildStatusNotifierPlugin.handle(BuildStatusNotifierPlugin.java:88)
        at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:172)
        at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:167)
        at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:315)
        at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:245)
        at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:167)
        at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:32)
        at com.thoughtworks.go.plugin.access.notification.NotificationExtension.notify(NotificationExtension.java:74)
        at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugin(PluginNotificationService.java:61)
        at com.thoughtworks.go.server.messaging.plugin.PluginNotificationService.notifyPlugins(PluginNotificationService.java:53)
        at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:30)
        at com.thoughtworks.go.server.messaging.plugin.PluginNotificationListener.onMessage(PluginNotificationListener.java:21)
        at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:65)
        at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:50)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/xxx/xxx
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1677)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1675)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1673)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1246)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
        at org.kohsuke.github.Requester.parse(Requester.java:451)
        at org.kohsuke.github.Requester._to(Requester.java:224)
        ... 20 more
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/xxx/xxx
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
        at org.kohsuke.github.Requester.parse(Requester.java:447)
        ... 21 more

README could be clearer about repo permission required

This line in the readme states that the username should be configured with:

A Github user with push access to the repository.

While the user does require push access to the repository, this gives the impression that the plugin requires credentials with push access, which is not the case. The plugin works with a personal access token which has only the repo:status scope configured. It feels mildly safer to configure this amount of access given that this user ends up getting added as a collaborator for any repositories which want to build pull requests.

Would people be open to a PR which clarifies the access requires?

plugin not working with go server 17.1.0

I've downloaded github-pr-status-1.2.jar and put it in /var/lib/go-server/plugins/external (along with the github-pr-poller plugin). The poller is working fine and building my pull requests but the status is not being reported back to github. I've got a .github file with oauth creds in and it's all the same setup as another go server I've got running 15.3. There are also no logs being generated.

There are no mentions of the plugin in go-server.log and the plugin is showing up in the UI as being installed. Permissions are the same as the other plugins.

Can you point me in a direction to help work out what's going wrong?

GitHub Enterprise having issues

I have the ~/.github file with endpoint defined. But I'm not getting any build status notifications to my PR. When I check the plugin logs I see the following errors.

Screenshot from 2019-08-02 16-54-00

Should report all build statuses

This may be similar to #75 but it isn’t clear.

It would be good if this plugin reports the status back to GitHub for all builds of pipelines that trigger from GitHub projects. Currently this conditional means that only those using the material type provided by the build pull requests plugin are reported back to GitHub. I recognise that the check is probably there to make sure that you don’t try to interact with standard git servers as if they are GitHub… Perhaps there should be some separation of a GitHub type, and a GitHub Pull Request type, so that this plugin can respond to both types of material?

Can't parse SSH urls

I get the following stack trace when trying to build a material based out of SSH url

java.lang.ArrayIndexOutOfBoundsException: 1
        at com.tw.go.plugin.provider.github.GitHubProvider.getRepository(GitHubProvider.java:83)
        at com.tw.go.plugin.provider.github.GitHubProvider.updateStatus(GitHubProvider.java:27)
        at com.tw.go.plugin.BuildStatusNotifierPlugin.handleStageNotification(BuildStatusNotifierPlugin.java:178)
        at com.tw.go.plugin.BuildStatusNotifierPlugin.handle(BuildStatusNotifierPlugin.java:88)
        at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:172)
        at com.thoughtworks.go.plugin.infra.DefaultPluginManager$1.execute(DefaultPluginManager.java:167)

Plugin credentials query

Hi,

Can you confirm what the endpoint needs to be for Enterprise github? Is this literally just the endpoint without any specific port requirements or /api.

We have added the plugin with the localhost and github enterprise credentials, however we are seeing a 401 response returned.

Does the plugin credentials through the UI actually take affect or do we also need to add the system properties for this as well?

I can see this error in our logs after startup.

Details:

2017-09-27 06:52:13,450 ERROR [Thread-75] PluginSettingsMetadataLoader:77 - Failed to fetch Plugin Settings metadata for plugin : github.pr
java.lang.RuntimeException: Interaction with plugin with id 'github.pr' implementing 'scm' extension failed while requesting for 'go.plugin-settings.get-configuration'. Reason: [Unable to de-serialize json response. Empty response body]```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.