[bitbucket-branch-source-plugin] Wrong merge order of pull request build

55 views
Skip to first unread message

Tom Ku

unread,
Jan 15, 2019, 6:30:39 AM1/15/19
to Jenkins Users
When building pull requests in a multibranch pipeline with the Bitbucket branch source plugin, IMO the merge order is wrong which leads to wrong change view information of the job.

My PR in Bitbucket is set up to merge a task branch into the master branch. The jenkins build console says:
{code}
Merging remotes/upstream/master commit 49055790acff662de787b04ac7b253140be04b81 into PR head commit 5ea5ad23180c6b9b3c0876fc21f8238a293eb4a0
{code}

 The problem is that because of the wrong merge order, the commits of the actual task branch aren't shown in the changes "view" (<jenkins-url>/job/<jobname>/view/change-requests/job/<PR-ID>/changes). Only the latest master commits are shown. 
Because of this, the wrong changes (latest of the master branch) are notified to the PR within the Bitbucket server (e.g. build information of a branch which has been merged before into the master branch) which confuses our developers.

Can anyone help or am I just configuring something wrong? Used this as how to guide: https://support.cloudbees.com/hc/en-us/articles/115000053051-How-to-Trigger-Multibranch-Jobs-from-Bitbucket-Server-

My setup: CentOS 7, Jenkins 2.138.3, bitbucket-branch-source-plugin 2.2.16, Bitbucket Server 5.16.0, Bitbucket Server Jenkins Webhook Plugin (because this can be configured for a whole Bitbucket project at once and not for each git repository of the project

Tom Ku

unread,
Jan 22, 2019, 5:51:57 AM1/22/19
to Jenkins Users
Hello,

anyone got a hint for me? Or does the bitbucket-branch-source-plugin "works as specified"?

Thanks in advance!

Tom

Rick

unread,
Jan 22, 2019, 6:00:48 AM1/22/19
to Mark Waite
could you paste your configuration, please?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/de4416a2-520f-495e-b3d1-aba57aee4ba1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Tom Ku

unread,
Jan 23, 2019, 3:46:36 AM1/23/19
to Jenkins Users
Hi,

thanks for answering. I can't upload pictures so here's the textual config (the default settings):

Discover branches: Exclude branches that are also filed as PRs
Discover pull requests from origin: Merging the pull request with the current target branch revision
Discover pull requests from forks: Merging the pull request with the current target branch revision, Forks in the same account

Afterwards my Jenkins library performs the checkout of the code via:
checkout scm

That's it. Is there any error in the configuration?
Thanks for help.

best wishes, Tom


Am Dienstag, 22. Januar 2019 12:00:48 UTC+1 schrieb Xiaojie Zhao:
could you paste your configuration, please?

Rick

unread,
Jan 23, 2019, 9:57:39 AM1/23/19
to Mark Waite
Looks that everything is ok. Or consider a better solution for debuging this?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Tom Ku

unread,
Jan 28, 2019, 1:56:51 AM1/28/19
to Jenkins Users
Ok. So when you're having a branch and a PR from this branch to the master (no changes in the master after creating the branch) - can you at least reproduce the merge log message when building a pull request (see following example:)

Merging remotes/upstream/master commit 49055790acff662de787b04ac7b253140be04b81 into PR head commit 5ea5ad23180c6b9b3c0876fc21f8238a293eb4a0

and the missing "Recent changes" messages for this pull request? If so, isn't this curious?

Thanks

Rick

unread,
Jan 28, 2019, 2:31:49 AM1/28/19
to Mark Waite
You are saying that the new branch1 is same as the master, then you create a pull request from branch1 to master? In my opinion, it's not necessary to build this pull request.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Tom Ku

unread,
Jan 28, 2019, 3:25:00 AM1/28/19
to Jenkins Users
Hi,

no. I created branch1 from master then create and push commits on branch1 and don't make any changes on master branch during work on branch1. Then I created a PR from branch1 to master and in the Jenkins. When building the PR, I don't see any commits in the Recent changes view.

Another aspect is that, on the same scenario if there were commits on master (e.g. from merged branch2) during work on branch1, I see those commits of the master branch in the Recent changes view in Jenkins after PR build. Only commits for branch1 should be shown in the Recent changes view.

Both aspects occur IMO because of the wrong merge order "master into branchX" and not "branchX into master" and that's what confuses our developers.

Can you reproduce these aspects?

Rick

unread,
Jan 28, 2019, 3:52:57 AM1/28/19
to Mark Waite
no. I created branch1 from master then create and push commits on branch1 and don't make any changes on master branch during work on branch1. Then I created a PR from branch1 to master and in the Jenkins. When building the PR, I don't see any commits in the Recent changes view.
 There are no changes in the first build because it cannot compare with any records. But you can see the changes after that.

Both aspects occur IMO because of the wrong merge order "master into branchX" and not "branchX into master" and that's what confuses our developers.
I think Jenkins doesn't know the right merge order. So IMO you might need to make a fit flow for this. You can try to use git rebase.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Reply all
Reply to author
Forward
0 new messages