[JIRA] (JENKINS-55896) Jenkins is not triggering build on any pullrequest created in bitbucket repo

3 views
Skip to first unread message

hassaan@carry1st.com (JIRA)

unread,
Jan 31, 2019, 11:33:02 AM1/31/19
to jenkinsc...@googlegroups.com
Hassaan Sohail created an issue
 
Jenkins / Bug JENKINS-55896
Jenkins is not triggering build on any pullrequest created in bitbucket repo
Issue Type: Bug Bug
Assignee: Christian Del Monte
Components: bitbucket-pullrequest-builder-plugin, bitbucket-push-and-pull-request-plugin, generic-webhook-trigger-plugin
Created: 2019-01-31 16:32
Environment: Bitbucket Cloud and Jenkins
Labels: jenkins Plugins pullrequestbuilder
Priority: Blocker Blocker
Reporter: Hassaan Sohail

I am using Bitbucket cloud service for repositories and Jenkins for builds. I am able to run my pipeline and trigger automatically when a new push chnages to a specified branch and have multiple jobs. E.g I have dev, stage, production environments for android builds. Whenever some one push to those branches in Bitbucket cloud, so jenkins is able to trigger build automatically against its branches. But I have another job in jenkins which is created for developers to test their code before merging it into other branch.  It is pr job which must execute when someone created any pull request then it should trigger build against it but it is not working.

I have installed all the plugins mentioned above to fulfill my requirement but jenkins is not able to trigger build when someone created a pull request from any branch to any branch.

Please suggest some configurations on jenkins side so that it will be able to trigger build when a new pr created or updated.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 4:17:02 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte started work on Bug JENKINS-55896
 
Change By: Christian Del Monte
Status: Open In Progress

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 4:28:03 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte commented on Bug JENKINS-55896
 
Re: Jenkins is not triggering build on any pullrequest created in bitbucket repo

Hello,

1) may you send me the logs generated by the plugin and some jpeg screenshots of the actual configuration panes of the jenkins plugin (after having masked sensitive informations)?

2) do you configured properly the Bitbucket webhook to trigger also pull requests? On the Bitbucket webhooks settings mask there is also a checkbox to click, in order to specify it. To see it, you need to select the radio button: "Choose from a full list of triggers".

Do you want to trigger build after  a pull request from which to which branch, exactely?

Bests,

Christian

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 4:28:08 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte edited a comment on Bug JENKINS-55896
Hello,

1) may you send me the logs generated by the plugin and some jpeg screenshots of the actual configuration panes of the jenkins plugin (after having masked sensitive informations)?

2) do you configured properly the Bitbucket webhook to trigger also pull requests? On the Bitbucket webhooks settings mask there is also a checkbox to click, in order to specify it. To see it, you need to select the radio button: "Choose from a full list of triggers".

3) Do you want to trigger a build after   a pull request from which to which branch, exactely?

Bests,

Christian

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 5:12:02 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail updated an issue
 
Change By: Hassaan Sohail
Attachment: bitbucket payload.txt
Attachment: Bitbucket-plugin-Generic Plugins.jpg
Attachment: Bitbucket-plugin-pull request builder plugin (2).jpg
Attachment: Bitbucket-plugin-pull-push.jpg
Attachment: BitBukcet Settings-1.jpg
Attachment: BitBukcet Settings-2.jpg

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 5:28:01 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail commented on Bug JENKINS-55896
 
Re: Jenkins is not triggering build on any pullrequest created in bitbucket repo

Hello,

Thank you for listening me and I hope you will help me. I am trying to answer your question please find them.

1) I have attached above payload which Bitbucket is sending to our jenkins. I configured two webhooks to send payload to jenkins.

2) I attached screenshots of my configurations that I use in my job, if there is anything to do in any other settings please let me know. I just configured everything in job not elsewhere. If there is anything you can tell me to do.

3) The purpose of the pr job is to test code without merging or pushing it into another branch. We wanted to trigger build whenever someone create pull request from any branch to any branch. Which means doesn't matter which branch if pull request is created then that code which is in pull request should trigger build, just simple, we were doing this in githib but I don't know why it is not working with Bitbucket, even I read many forums and try different things.

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 5:51:02 AM2/1/19
to jenkinsc...@googlegroups.com

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 5:54:01 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte commented on Bug JENKINS-55896
 
Re: Jenkins is not triggering build on any pullrequest created in bitbucket repo

Ok,

 

1) which are exactly the Bitbucket plugins, that are you using: the "Bitbucket push and Pull request" plugin alone or combined with other ones?

2) it could be useful to have also these logs, thanks:

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 6:15:04 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail updated an issue
 
Change By: Hassaan Sohail
Attachment: Bitbucket Request Response on Bitbucct Generic Plugin.jpg
Attachment: Bitbucket Request Response on Bitbucket Pull request Builder Plugin.jpg

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 6:16:02 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail updated an issue
Change By: Hassaan Sohail
Attachment: Bitbucket Pulll request Logs setting in Jenkins.jpg

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 6:17:01 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail updated an issue
Change By: Hassaan Sohail
Attachment:
Bitbucket Request Response on Bitbucket Pull request Builder Plugin.jpg

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 6:17:02 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail commented on Bug JENKINS-55896
 
Re: Jenkins is not triggering build on any pullrequest created in bitbucket repo

1) I am using with combime so that something should happen that is why I configured all and tried every one in single as well. But right all are configured.

2) I added but there is no logs, I am attaching few screen shots from Jenkins which both webhooks are sending request and what is in there body in response.

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 6:49:02 AM2/1/19
to jenkinsc...@googlegroups.com

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 6:49:03 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte updated an issue
Change By: Christian Del Monte
Attachment: Screenshot_2019-02-01 Log [Jenkins](1).png

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 6:52:02 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte commented on Bug JENKINS-55896
 
Re: Jenkins is not triggering build on any pullrequest created in bitbucket repo

I'm sending you other two screenshoots, just to be sure.

1) After configuring them, you should access the log records from the logger list view:

For example, the logger for the Bitbucket push and pull request plugin should look like this one, after you triggered it (webhook sent by Bitbucket after a push or pull request):

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 6:59:03 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte edited a comment on Bug JENKINS-55896
I'm sending you other two screenshoots, just to be sure.

1)
After configuring them, you should access the log records from the logger list view:

!Screenshot_2019-02-01 Log [Jenkins](1).png|width=520,height=299!


For example, the logger for the Bitbucket push and pull request plugin should look like this one, after you triggered it (webhook sent by Bitbucket after a push or pull request):

!Screenshot_2019-02-01 Log [Jenkins].png|width=436,height=237!

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 7:03:01 AM2/1/19
to jenkinsc...@googlegroups.com

I am not able to see any logs here, I don't know why but you can help me to find out the problem.

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 7:06:03 AM2/1/19
to jenkinsc...@googlegroups.com

the possibilities are two:

1) the webhook is not correctly configured

2) you are using another plugin for the pull requests

Only to be sure: for the pull requests you should send the payload to http://<jenkins-server>/bitbucket-hook/

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 7:15:02 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte edited a comment on Bug JENKINS-55896
the possibilities are two:

1) the webhook is not correctly configured

2) you are using another plugin for the pull requests

Only to be sure: for the pull requests you should send the payload to http://<jenkins-server> {color:#f0f0f0} /bitbucket-hook/ {color}

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 7:17:02 AM2/1/19
to jenkinsc...@googlegroups.com

Ok, Let me do it and remove rest of them then I'll share my configurations. Give me few minutes.

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 7:17:02 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte edited a comment on Bug JENKINS-55896
the possibilities are two:

1) the webhook is not correctly configured

2) you are using another plugin for the pull requests

Only to be sure: for the pull requests you should send the payload to http://<jenkins-server>/bitbucket-hook/

 

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 8:24:02 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail updated an issue
 
Change By: Hassaan Sohail
Attachment: Bitbucket-Jenkins SCM Settings.jpg

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 8:25:02 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail updated an issue
Change By: Hassaan Sohail
Attachment: Bitbucket-Jenkins Build Trigger Settings.jpg

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 8:30:02 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail updated an issue
Change By: Hassaan Sohail
Attachment: Bitbucket-Jenkins SCM Settings.jpg

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 8:32:03 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail updated an issue
Change By: Hassaan Sohail
Attachment: Bitbucket-Jenkins Build Trigger Settings.jpg

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 8:34:03 AM2/1/19
to jenkinsc...@googlegroups.com

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 8:42:01 AM2/1/19
to jenkinsc...@googlegroups.com
Christian Del Monte commented on Bug JENKINS-55896
 
Re: Jenkins is not triggering build on any pullrequest created in bitbucket repo

please, use only the https://plugins.jenkins.io/bitbucket-push-and-pull-request plugin, disable all other Bitbucket related plugins and configure it as shown in the wiki page, only to be sure that it works as aspected 

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 8:46:02 AM2/1/19
to jenkinsc...@googlegroups.com
Hassaan Sohail updated an issue
Change By: Hassaan Sohail
Attachment: Bitbucket-Webhook receive on push into specified branch.jpg

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 8:49:03 AM2/1/19
to jenkinsc...@googlegroups.com

I am not able to receive webhook on pull request creation or updation. I am just receiving webhook on push from Bitbucket and I can see this in my logs.

I am answering your questions. Right now, I am jut using  1 plugin with the name of  Bitbucket Pull request Builder and I am attaching SCM configurations and Build Trigger Configurations with you.

1:  Image shows my SCM Configurations for Pull request
-----------------------------------------------------------------------------------------------------------

 

2:  second image shows Build Trigger configurations.
---------------------------------------------------------------------------------------------------------------------------------------------------------

3: Third image shows Bitbucket webhook settings.

-----------------------------------------------------------------------------------------------------------------------------------------------------------

4: Last images shows the logs of Jenkins, Firstly I created pull request and check there were no logs in Jenkins but Bitbucket was saying that Bitbucket send the post request of webhook for pull request but in jenkins logs I am not able to see any receiving. Now I comit to our stagging branch and check if logs are generating and found that jenkins received post request from Bitbucket on which jenkins started build. Have a look in the picture.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

5: Now its your turn to identify where is the problem because I am not seeing logs on pull request but able to see while push. Let me know what kind of configurations I have to do or need to change.

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 9:02:02 AM2/1/19
to jenkinsc...@googlegroups.com

all right, I understand... I'm the mantainer of the  https://plugins.jenkins.io/bitbucket-push-and-pull-request plugin...

I can help you only for this one. I would suggest, you could try to use it disabling the others and configuring it as described or you could send a issue to the mantainers of the plugin you are using: Bitbucket Pull request Builder.

Please, let me know.

 

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 9:08:01 AM2/1/19
to jenkinsc...@googlegroups.com

ok thats cool. But once question you still didn't answer, is it matter to see payload of pull request in jenkins logs or not? Because I am only receiving on push, so most probably the problem should be at Bitbucket end, or it is not like that?

register@cdelmonte.de (JIRA)

unread,
Feb 1, 2019, 9:16:02 AM2/1/19
to jenkinsc...@googlegroups.com

Yes, it matters... Actually I tested the payload you sent with I'm the mantainer of the  https://plugins.jenkins.io/bitbucket-push-and-pull-request and I can see it coming.

But, in this case, you are using the Bitbucket Pull request Builder, so, you need to configure the logger to see the logs of this plugin.

Sorry for the misunderstandment

hassaan@carry1st.com (JIRA)

unread,
Feb 1, 2019, 9:50:02 AM2/1/19
to jenkinsc...@googlegroups.com

Christian Del Monte I tried same your suggestion but it is not working. I am waiting from Bitbucket side if they answer because I am not receiving payload on pr but I am receiving on push.

register@cdelmonte.de (JIRA)

unread,
Mar 4, 2019, 6:16:02 AM3/4/19
to jenkinsc...@googlegroups.com
Christian Del Monte closed an issue as Fixed
 
Change By: Christian Del Monte
Status: In Progress Closed
Resolution: Fixed

patrick.macgregor@basilicom.de (JIRA)

unread,
Jun 20, 2019, 11:18:02 AM6/20/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages