Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-25700

Unable to send Bamboo Build status/state to GITHUB.

XMLWordPrintable

      Issue Summary

      When we try to use a webhook as a notification to try to send build status from Bamboo to GITHUB for particular commit id, its failing with the status code 422

      " {"message":"Validation Failed","errors":[
      
      {"resource":"Status","code":"custom","field":"state","message":"state is not included in the list"}
      
      ]"
      

      This is reproducible on Data Center: (yes) / (no) yes

      Steps to Reproduce

      1. Intergrate Bamboo with GITHUB
      2. Configure Bamboo to trigger build after a commit in GITHUB - https://confluence.atlassian.com/bamkb/how-to-trigger-bamboo-builds-with-github-webhook-1097179080.html

      3. Try to send the Bamboo build results to GITHUB

      For that we need to set up a webhook to transfer Bamboo build status to GITHUB commit via notifications in build plan.

      4. Use the below payload and header

      Payload :-

      {"state":"${bamboo.buildState}","target_url":"${bamboo.buildResultsUrl}","description":"${bamboo.buildState}","context":"continuous-integration/bamboo"}
      

      Header :-

      Accept: application/vnd.github+json
      Authorization: Bearer <use your github token>
      
      

      Use the below notification url

      https://api.github.com/repos/<GITHUB username>/<repo name>/statuses/<commmit ID>

      Expected Results

      The build status , target url , description and context arer passed to GITHUB for the commit ID

      Actual Results

      The webhook execution fails with status code 422

      " {"message":"Validation Failed","errors":[
      
      {"resource":"Status","code":"custom","field":"state","message":"state is not included in the list"}
      
      ]"

      However the problem is that GITHUB expects Bamboo to send the status in lower case i.e “success”. Bamboo is sending this as uppercase “SUCCESS”, which GITHUB is not accepting

      state string Required
      The state of the status.
      
      Can be one of: error, failure, pending, success
      

      Workaround

      No workaround as of now.

      Try to use this external third party plugin instead : https://github.com/HackAttack/bamboo-github-status

              achystoprudov Alexey Chystoprudov
              f84a05b06223 Anik Sengupta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: