Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43370

Pipeline Github Notify Step plugin fails to set commit status on private organization repo

      I have the following in a declarative pipeline job:

      pipeline {
        agent { label "centos7" }
      
        stages {
          stage("github => pending") {
            steps {
              githubNotify status: "PENDING", description: "Build is starting...", credentialsId: "my-credentials", account: "me", repo: "the-repo"
            }
          }
      
          // ...

      When the job runs, I get the following in the console output:

      java.lang.IllegalArgumentException: The suplied credentials are invalid to login
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep.getGitHubIfValid(GitHubStatusNotificationStep.java:234)
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep.getRepoIfValid(GitHubStatusNotificationStep.java:239)
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep.access$100(GitHubStatusNotificationStep.java:75)
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep$Execution.run(GitHubStatusNotificationStep.java:344)
      	at org.jenkinsci.plugins.pipeline.githubstatusnotification.GitHubStatusNotificationStep$Execution.run(GitHubStatusNotificationStep.java:326)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      	at hudson.security.ACL.impersonate(ACL.java:221)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)

      However, I know that these credentials are definitely valid. In the "Manage Jenkins" page, I can test the credentials via the GitHubPullRequestBuilder plugin, and they work, correspond to a user with read/write permissions on this repo, and can even set commit status (manually, via that other plugin).

      The repo in question is a private repo, and the value for "Account" corresponds to an organization, not an individual user account. I suspect the latter is probably what's going on here, but I don't see any better way to specify the org that owns the repo than with the account: parameter.

       

          [JENKINS-43370] Pipeline Github Notify Step plugin fails to set commit status on private organization repo

          Dan Crosta created issue -
          Dan Crosta made changes -
          Attachment New: SnippetGenerator.png [ 37014 ]
          Raul Arabaolaza made changes -
          Priority Original: Major [ 3 ] New: Blocker [ 1 ]
          tisoft_media made changes -
          Attachment New: pipeline-githubnotify-step.hpi [ 39143 ]
          Raul Arabaolaza made changes -
          Assignee Original: Raul Arabaolaza [ rarabaolaza ] New: tisoft_media [ tisoft_media ]
          Raul Arabaolaza made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Raul Arabaolaza made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Raul Arabaolaza made changes -
          Resolution New: Done [ 10000 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]
          liyatikal made changes -
          Resolution Original: Done [ 10000 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Adam Bennett made changes -
          Attachment New: Screen Shot 2018-08-27 at 1.17.13 PM.png [ 43909 ]

            tisoft_media tisoft_media
            dcrosta Dan Crosta
            Votes:
            6 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: