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

Job is not triggered after merging a branch

    XMLWordPrintable

Details

    Description

      The steps to re-produce the issue are:

      1. git checkout -b feature/test
      2. touch README.md
      3. git add README.md
      4. git commit -m "a change"
      5. git push origin feature/test
      6. git checkout feature/A
      7. git merge feature/test
      8. git push origin feature/A

      So when you merge `feature/test` Bitbucket is not reporting raw_node so it was producing the stacktrace below:

      ```
      Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
      at java.util.ArrayList.elementData(ArrayList.java:400)
      at java.util.ArrayList.get(ArrayList.java:413)
      at net.sf.json.JSONArray.get(JSONArray.java:1881)
      at net.sf.json.JSONArray.getJSONObject(JSONArray.java:1970)
      at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.processPayload(BitbucketHookReceiver.java:111)
      at com.cloudbees.jenkins.plugins.BitbucketHookReceiver.doIndex(BitbucketHookReceiver.java:60)
      ```

      The lines of the code below in BitBucketHookReceiver are not used and they are producing the above stacktrace.

      ```
      JSONArray commits = payload.getJSONArray("commits");
      int last = commits.size() - 1;
      String sha1 = commits.getJSONObject(last).getString("raw_node");
      String branch = commits.getJSONObject(last).getString("branch");
      ```

      Just need to delete them.

      Attachments

        Issue Links

          Activity

            fbelzunc Félix Belzunce Arcos created issue -
            scm_issue_link SCM/JIRA link daemon made changes -
            Field Original Value New Value
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            fbelzunc Félix Belzunce Arcos made changes -
            Link This issue is duplicated by JENKINS-22724 [ JENKINS-22724 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 160976 ] JNJira + In-Review [ 196602 ]

            People

              fbelzunc Félix Belzunce Arcos
              fbelzunc Félix Belzunce Arcos
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: