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

Job is not triggered after merging a branch

    XMLWordPrintable

    Details

    • Similar Issues:

      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

            Hide
            domi Dominik Bartholdi added a comment -

            Félix Belzunce Arcos you might wanna have a short check if this fix could also resolve JENKINS-24574

            Show
            domi Dominik Bartholdi added a comment - Félix Belzunce Arcos you might wanna have a short check if this fix could also resolve JENKINS-24574
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Felix Belzunce Arcos
            Path:
            src/main/java/com/cloudbees/jenkins/plugins/BitbucketHookReceiver.java
            http://jenkins-ci.org/commit/bitbucket-plugin/de63f6ca83b47b6068dd4a293e6c6a48c9684070
            Log:
            JENKINS-26805 Job not triggered after git merge

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Felix Belzunce Arcos Path: src/main/java/com/cloudbees/jenkins/plugins/BitbucketHookReceiver.java http://jenkins-ci.org/commit/bitbucket-plugin/de63f6ca83b47b6068dd4a293e6c6a48c9684070 Log: JENKINS-26805 Job not triggered after git merge
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: fbelzunc
            Path:
            src/main/java/com/cloudbees/jenkins/plugins/BitbucketHookReceiver.java
            http://jenkins-ci.org/commit/bitbucket-plugin/89b6505831df978934c9b1ad35b78f8cc995a2ac
            Log:
            Merge pull request #9 from fbelzunc/JENKINS-26805

            [FIXED JENKINS-26805] Job not triggered after git merge on a branch

            Compare: https://github.com/jenkinsci/bitbucket-plugin/compare/c70f028ef750...89b6505831df

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: fbelzunc Path: src/main/java/com/cloudbees/jenkins/plugins/BitbucketHookReceiver.java http://jenkins-ci.org/commit/bitbucket-plugin/89b6505831df978934c9b1ad35b78f8cc995a2ac Log: Merge pull request #9 from fbelzunc/ JENKINS-26805 [FIXED JENKINS-26805] Job not triggered after git merge on a branch Compare: https://github.com/jenkinsci/bitbucket-plugin/compare/c70f028ef750...89b6505831df
            Hide
            domi Dominik Bartholdi added a comment -

            when will this fix be released?

            Show
            domi Dominik Bartholdi added a comment - when will this fix be released?

              People

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

                Dates

                Created:
                Updated:
                Resolved: