Multi branch source - PR versus branch build

44 views
Skip to first unread message

Dan Tran

unread,
Apr 30, 2017, 5:26:44 PM4/30/17
to Jenkins Users
Hi

I am experimenting BitBucket multi branch source plugin I think PR build is just same as branch build.

Basically, i force a syntax failure  the main source, and create a pull request from another branch.  
I am expecting the PR build also fails as in main. But  it is  not.

Am I missing something?

Thanks

0Dan

Kevin Burnett

unread,
May 1, 2017, 1:44:33 PM5/1/17
to Jenkins Users
dan,

i understand that you're using the bitbucket branch source plugin, you introduce a syntax error into the mainline branch (let's call it master), and you submit a pull request for a different branch (let's call it feature/new-hotness) that wasn't based off this bad master branch. your master build fails and your pull request build succeeds.

that is what i'd expect, because it doesn't automatically merge the feature branch into master or master into the feature branch. where have i misunderstood?

Dan Tran

unread,
May 1, 2017, 2:17:23 PM5/1/17
to Jenkins Users

So I misunderstood the mechanism of PR build where the target branch is not merged into the destination branch before build

what is the benefit of auto build both merge and pr for every new commit?  I can understand the benefit before issuing the PR, but from my experience ppl usually issue PR very early to solicit feed back and there for we have double builds

Thanks

-Dan

Kevin Burnett

unread,
May 3, 2017, 12:20:46 AM5/3/17
to Jenkins Users
i'm actually totally with you on this.

i've been wanting to only build branches (and never build PRs) for a while now. in fact, we've gone so far as to "kill" PR builds manually in our shared library in order to not chew up resources needlessly:

if (env.BRANCH_NAME && env.BRANCH_NAME.contains('PR-')) {
  error("IntentionallyFailingPullRequestBuild")
}

our workaround is annoying since our pull requests obviously always show up as broken in bitbucket server. :|

i think https://issues.jenkins-ci.org/browse/JENKINS-43426 is related, and lots of new use-cases will be supported when this new UI is eventually rolled out (i hope our "ignore PRs completely" use case is supported, but i'm not 100% sure what's in scope).

Dan Tran

unread,
May 3, 2017, 3:01:17 AM5/3/17
to Jenkins Users
for my use case, we only care about PR build.  I ended up to setup jenkins file to let branch builds pass thru ( ie always green).  and it is an on going confusion

Thanks

-Dan
Reply all
Reply to author
Forward
0 new messages