-
Bug
-
Resolution: Fixed
-
Critical
-
None
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.
- is duplicated by
-
JENKINS-22724 Git merge before build does not work with bitbucket SCM trigger
- Closed