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

GitHubCommitStatusSetter failed with org.kohsuke.github.GHFileNotFoundException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • github-api-plugin
    • Jenkins: 2.170
      OS: Windows 10 and macOS
      GHE: 2.16.5
      --------------------
      Git Plugin: 3.9.3
      Git Client Plugin: 2.7.6
      GitHub Plugin: 1.29.4
      GitHub API Plugin: 1.95
      GitHub Pull Request Builder Plugin (ghprb): 1.42.0

      I run step like below using GitHubCommitStatusSetter.

      step([
           $class : 'GitHubCommitStatusSetter',
           reposSource : [
               $class: 'ManuallyEnteredRepositorySource',
               url : url
           ],
           commitShaSource : [
           $class: 'ManuallyEnteredShaSource',
               sha : sha1
           ],
           contextSource : [
               $class : 'ManuallyEnteredCommitContextSource',
               context: context
           ],
           statusResultSource: [
               $class : 'ConditionalStatusResultSource',
               results: listResults
           ],
           statusBackrefSource: [
               $class: 'ManuallyEnteredBackrefSource',
               backref: env.BUILD_URL
           ]
       ])
      

      But it failed with org.kohsuke.github.GHFileNotFoundException.

      Exception message is below:

      14:36:52 Setting commit status on GitHub for [https://\|https:]
      Unknown macro: {GHE}
      /{Organization}/{Repository}/commit/{SHA}
      14:36:52
      14:36:52 Exception: org.jenkinsci.plugins.github.common.CombineErrorHandler$ErrorHandlingException: org.kohsuke.github.GHFileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.16/v3/repos/statuses/#create-a-status"}

      Personal acces token's repo permission has all for repo category.

      • repo:status
      • repo_deployment
      • public_repo
      • repo:invite 

      On the other hand, if I execute REST API using Curl on Windows Command Line Console, I could set Commit Status correctly for target SHA number on reposiotry. 

      > curl.exe https://{GHE}/api/v3/repos/{Organization}/{Repository}/statuses/{SHA} -u <User>:<Password> -X POST -H "Content-Type: application/json" -d "{\"state\": \"pending\", \"context\": \"rest/api/test\", \"description\": \"rest/api/test\"}"
      

      Are there any hint to solve this?

      lanwen,integer

            lanwen Kirill Merkushev
            hkawashi Hideaki Kawashima
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: